Skip to main content

Behat script to wait for n seconds

If you want your program to wait for n seconds, use below code.

Paste Behat Script to your FeatureContext.php file and your Gherkin step to your feature file.

Example 1: Using Sleep Method

Gherkin

And I wait 5 seconds

Behat Script

/**
   * Waits a while, for debugging.
   *
   * @param int $seconds
   *   How long to wait.
   *
   * @When I wait :seconds second(s)
   */
  public function wait($seconds) {
    sleep($seconds);
  }

behat with mink and drupal extension course on udemy

Tags
Submitted by tgoswami on September 12, 2020

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.