Skip to content

Wait Steps

Source: src/tests/steps/actions/wait.step.ts.

See shared placeholder rules in Step Parameter Conventions.

Signature: the user waits for the current page to be loaded

What it does:

  • Waits for current page to reach domcontentloaded.

Parameters:

  • None.

Example:

When the user waits for the current page to be loaded

Signature: the user waits for the route {string} to be loaded

What it does:

  • Reads selected environment base URL.
  • Combines base URL with provided route.
  • Waits for full URL match.

Parameters:

ParameterRepresentsExpected data
{string}Route pathRelative route (for example /dashboard or dashboard).

Example:

When the user waits for the route "/dashboard" to be loaded

Signature: the user waits for the element {string} to become visible

What it does:

  • Resolves locator by name.
  • Waits until selector state is visible.

Parameters:

ParameterRepresentsExpected data
{string}Locator nameExisting locator key (for example successBanner).

Example:

When the user waits for the element "successBanner" to become visible

Signature: the user waits for the {string} element to disappear

What it does:

  • Resolves locator by name.
  • Waits until selector state is hidden.

Parameters:

ParameterRepresentsExpected data
{string}Locator nameExisting locator key (for example loadingSpinner).

Example:

When the user waits for the "loadingSpinner" element to disappear

Signature: the user waits for {int} seconds

What it does:

  • Pauses execution for provided seconds.

Parameters:

ParameterRepresentsExpected data
{int}Duration in secondsPositive integer (for example 2).

Example:

When the user waits for 2 seconds
  • Prefer route/element waits over fixed-duration waits where possible.
  • Fixed waits are best as last-resort stabilization steps.