mido mido - 7 months ago 232
Javascript Question

WebDriver.io: how to make browser pause/ wait?

For testing, I am loading a page and clicking a button, I am using webdriver.io for testing Since the page is quite heavy, it takes a bit of time to load, I would like the global variable

browser
to wait few seconds before clicking the button.

I know there is
waitForVisible
method, but not good enough, I still have no idea if the js has added click event to the button, I am looking for something similar to
sleep
method in selenium webdriver.

Answer

I think you are asking about the pause() method:

pauses queue execution for a specific amount of time