DEV Community

Cover image for Webship-js: When I wait
webship.co
webship.co

Posted on

2

Webship-js: When I wait

The "when I wait" step in Webship-JS is crucial for ensuring that your automated tests simulate realistic user behavior. It allows you to introduce pauses or delays in the test execution, ensuring that elements load fully or actions complete before the next steps are executed. This step is particularly important when dealing with dynamic content or AJAX requests, as it guarantees that the page is ready for the next interaction, preventing errors due to incomplete loading or unresponsive elements. By using this step, you enhance the reliability and accuracy of your tests.

This step definition specifies that the user will pause or wait for a defined duration—either a set number of seconds/minutes, a maximum number of seconds/minutes, or until the page fully loads—before proceeding to the next step.

This step is typically used where a delay or time-based action is expected.

  • When I wait until the page loaded
  • When I wait {number} seconds
  • When I wait max {number} seconds
  • When I wait {number} minutes
  • When I wait max {number} minutes

When I wait until the page loaded

This step definition acts as a command to wait until the page's body fully loads before performing any actions on the page

The page body loading time is set to 10 seconds. If the body isn't loaded within this time frame, an error will be triggered for this step definition.

Example:

When I wait until the page is loaded
When we wait until the page loaded
Enter fullscreen mode Exit fullscreen mode

See the full article:https://webship.co/blog/webship-js-when-i-wait

You can see more step definitions: https://webship.co/docs

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay