Wait Steps
Source: src/tests/steps/actions/wait.step.ts.
See shared placeholder rules in Step Parameter Conventions.
Step catalog
Section titled “Step catalog”1. Wait for current page load
Section titled “1. Wait for current page load”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 loaded2. Wait for route to load
Section titled “2. Wait for route to load”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:
| Parameter | Represents | Expected data |
|---|---|---|
{string} | Route path | Relative route (for example /dashboard or dashboard). |
Example:
When the user waits for the route "/dashboard" to be loaded3. Wait for element visibility
Section titled “3. Wait for element visibility”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:
| Parameter | Represents | Expected data |
|---|---|---|
{string} | Locator name | Existing locator key (for example successBanner). |
Example:
When the user waits for the element "successBanner" to become visible4. Wait for element disappearance
Section titled “4. Wait for element disappearance”Signature: the user waits for the {string} element to disappear
What it does:
- Resolves locator by name.
- Waits until selector state is
hidden.
Parameters:
| Parameter | Represents | Expected data |
|---|---|---|
{string} | Locator name | Existing locator key (for example loadingSpinner). |
Example:
When the user waits for the "loadingSpinner" element to disappear5. Wait fixed duration
Section titled “5. Wait fixed duration”Signature: the user waits for {int} seconds
What it does:
- Pauses execution for provided seconds.
Parameters:
| Parameter | Represents | Expected data |
|---|---|---|
{int} | Duration in seconds | Positive integer (for example 2). |
Example:
When the user waits for 2 secondsUsage guidance
Section titled “Usage guidance”- Prefer route/element waits over fixed-duration waits where possible.
- Fixed waits are best as last-resort stabilization steps.