暂停
暂停执行特定的时间。不建议使用此命令来等待元素显示。为了避免测试结果不稳定,最好使用waitForExist
或其他waitFor*命令。
用法
browser.pause(milliseconds)
参数
名称 | 类型 | 详情 |
---|---|---|
milliseconds | number | 时间(毫秒) |
示例
pause.js
it('should pause the execution', async () => {
const starttime = new Date().getTime()
await browser.pause(3000)
const endtime = new Date().getTime()
console.log(endtime - starttime) // outputs: 3000
});