Wait Steps
Beginners: start with Running Tests if you are still learning when waits are necessary. This page is the exact synchronization-step reference.
Source: src/tests/steps/actions/wait.step.ts.
See shared placeholder rules in Step Parameter Conventions.
Prefer installing published steps with npx appraisejs@latest add step ...
instead of adding the package to your project with npm install.
Use this when
Section titled “Use this when”Use wait steps when the scenario needs route or element synchronization and fixed-duration waiting is not enough or not appropriate.
Step catalog
Section titled “Step catalog”1. Wait for current page load
Section titled “1. Wait for current page load”Signature
Section titled “Signature”the user waits for the current page to be loaded
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step wait/wait-for-page-loadWhat it does
Section titled “What it does”- Waits for current page to reach
domcontentloaded.
Parameters
Section titled “Parameters”- None.
Example
Section titled “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
Section titled “Signature”the user waits for the route {string} to be loaded
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step wait/wait-for-url-routeWhat it does
Section titled “What it does”- Reads selected environment base URL.
- Combines base URL with provided route.
- Waits for full URL match.
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{string} | Route path | Relative route (for example /dashboard or dashboard). |
Example
Section titled “Example”When the user waits for the route "/dashboard" to be loaded3. Wait for element visibility
Section titled “3. Wait for element visibility”Signature
Section titled “Signature”the user waits for the element {string} to become visible
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step wait/wait-for-elementWhat it does
Section titled “What it does”- Resolves locator by name.
- Waits until selector state is
visible.
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{string} | Locator name | Existing locator key (for example successBanner). |
Example
Section titled “Example”When the user waits for the element "successBanner" to become visible4. Wait for element disappearance
Section titled “4. Wait for element disappearance”Signature
Section titled “Signature”the user waits for the {string} element to disappear
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step wait/wait-for-element-to-disappearWhat it does
Section titled “What it does”- Resolves locator by name.
- Waits until selector state is
hidden.
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{string} | Locator name | Existing locator key (for example loadingSpinner). |
Example
Section titled “Example”When the user waits for the "loadingSpinner" element to disappear5. Wait fixed duration
Section titled “5. Wait fixed duration”Signature
Section titled “Signature”the user waits for {int} seconds
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step wait/wait-for-specific-amount-of-secondsWhat it does
Section titled “What it does”- Pauses execution for provided seconds.
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{int} | Duration in seconds | Positive integer (for example 2). |
Example
Section titled “Example”When the user waits for 2 secondsCommon failures
Section titled “Common failures”- Prefer route/element waits over fixed-duration waits where possible.
- Fixed waits are best as last-resort stabilization steps.