UNPKG

@luminati-io/webdriverio8

Version:

Next-gen browser and mobile automation test framework for Node.js

25 lines 1.24 kB
/** * * Pauses execution for a specific amount of time. It is recommended to not use this command to wait for an * element to show up. In order to avoid flaky test results it is better to use commands like * [`waitForExist`](/docs/api/element/waitForExist) or other waitFor* commands. * * <example> :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 }); * </example> * * @alias browser.pause * @param {number} milliseconds time in ms * @type utility * */ export function pause(milliseconds = 1000) { return new Promise((resolve) => setTimeout(resolve, milliseconds)); } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF1c2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29tbWFuZHMvYnJvd3Nlci9wYXVzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FvQkc7QUFDSCxNQUFNLFVBQVUsS0FBSyxDQUVqQixZQUFZLEdBQUcsSUFBSTtJQUVuQixPQUFPLElBQUksT0FBTyxDQUFDLENBQUMsT0FBTyxFQUFFLEVBQUUsQ0FBQyxVQUFVLENBQUMsT0FBTyxFQUFFLFlBQVksQ0FBQyxDQUFDLENBQUE7QUFDdEUsQ0FBQyJ9