Waits
DrevOps\BehatSteps\Steps\Web\WaitTrait - Source, Example, Helpers
Wait for a period of time or for AJAX to finish.
- Wait a fixed number of seconds.
- Wait for jQuery and Drupal AJAX activity to settle, on demand or around every step that navigates or submits.
A wait onjQuery.activealone missesDrupal.ajaxupdates, so an assertion following a click can read the page before the update applies. The wait here watches both, and a page withoutDrupaltakes the jQuery check alone.
Skip the automatic waits with tag:@behat-steps-skip:WaitTrait.
Options
| Option | Type | Default | Tag | Description |
|---|---|---|---|---|
wait.enabled | boolean | TRUE | @behat-steps-skip:WaitTrait | Wait for AJAX around every navigating or submitting step of a @javascript scenario. |
wait.ajax_timeout | integer | 5 | - | Maximum time, in seconds, to wait for AJAX calls to complete. |
Steps
@When I wait for AJAX to finish
Wait for the AJAX calls to finish, using the configured timeout
When I wait for AJAX to finish
@When I wait for :seconds second(s)
Wait for a specified number of seconds
When I wait for 5 seconds
When I wait for 1 second
@When I wait for :seconds second(s) for AJAX to finish
Wait for the AJAX calls to finish
When I wait for 5 seconds for AJAX to finish
When I wait for 1 second for AJAX to finish