.enablePerformanceMetrics() 建議編輯
自版本: 2.2.0啟用/停用在瀏覽器中收集效能指標。指標收集僅在呼叫此命令後開始。
用法
.enablePerformanceMetrics([enable], [callback])
範例
describe('collect performance metrics', function() {
it('enables the metrics collection, does some stuff and collects the metrics', function() {
browser
.enablePerformanceMetrics()
.navigateTo('https://www.google.com')
.getPerformanceMetrics((result) => {
if (result.status === 0) {
const metrics = result.value;
console.log(metrics);
}
});
});
});
參數
名稱 | 類型 | 描述 |
---|---|---|
enable 選用 |
布林值 | 是否啟用或停用效能指標收集。預設值: |
callback 選用 |
函數 | 命令完成時要呼叫的回呼函數。 |