When I wait {number} seconds

This step waits up to a specified number of seconds for the page to settle and returns as soon as the page becomes idle. It is the compact form of the timed wait: you write the number directly after "wait" without the word "for". Settlement is defined the same way as all smart-settle steps: DOM ready, no active fetch or XHR, no pending timers, and no DOM mutations for at least 250 ms. If the page becomes idle before the budget expires, the step exits early.

The number can be followed by second, seconds, or the shorthand s - or omitted entirely when using s. This compact phrasing is well-suited to feature files that need to express a short pause concisely. Both I and we pronouns are accepted, and the pronoun may be omitted entirely when chaining with And.

Accepted phrasings

When I wait 1 second
When I wait 5 seconds
When we wait 3s
And wait 2s
And wait 2 seconds
When we wait 1 second
When we wait 5 seconds
When we wait 4s

Examples

When I wait 1 second
When I wait 5 seconds
When we wait 3s
And wait 2s

In a real scenario

Scenario: Editor fills in and saves a content form
  Given I am logged in as "editor"
  When I go to "/content/add/article"
    And I wait 6s
    And I fill in "My Test Article" for "Title"
    And I press "Save"
    And I wait 2s
  Then I should see "My Test Article"

Related steps

Back to Wait Steps