Waits

Any command that targets an element has a built-in "wait until element visible" behavior. Read "Automatic Waits" to learn more.

Wait for a specific duration using I.wait

If you want the test to wait for a specific amount of time, you can use the I.wait command.

Set the number of seconds you want to wait for in the first argument.

This example below starts a countdown timer of 60 seconds and waits for 10 seconds before pressing the "Stop" button to stop the timer.

// Go to google.com
I.goTo("https://google.com")
I.click("Accept all") // accept cookies

// Start a timer for 60 seconds
I.fill("Search", "set timer for 60 seconds")
I.pressEnter()

// Stop the timer after 10 seconds
I.wait(10) 
I.click("Stop")









 

Reference: I.wait command

Wait for a given amount of time

Usage

I.wait(seconds)

Parameters

ParameterTypeRemarks
secondsnumberNumber of seconds to wait for
Last Updated: