Click Steps
Beginners: start with Creating Tests or Template Steps if you need the authoring workflow first. This page is the exact click-step reference.
Source: src/tests/steps/actions/click.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 click steps when the scenario needs a direct UI action against an existing locator.
Step catalog
Section titled “Step catalog”1. Click element
Section titled “1. Click element”Signature
Section titled “Signature”the user clicks on the {string} element
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step click/clickWhat it does
Section titled “What it does”- Resolves locator by name.
- Performs a standard Playwright click.
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{string} | Target locator name | Existing locator key (for example loginButton). |
Example
Section titled “Example”When the user clicks on the "loginButton" element2. Double click element
Section titled “2. Double click element”Signature
Section titled “Signature”the user double clicks on the {string} element
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step click/double-clickWhat it does
Section titled “What it does”- Resolves locator by name.
- Performs
dblclick()on the matched element.
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{string} | Target locator name | Existing locator key (for example rowItem). |
Example
Section titled “Example”When the user double clicks on the "rowItem" element3. Right click element
Section titled “3. Right click element”Signature
Section titled “Signature”the user right clicks on the {string} element
Install with CLI
Section titled “Install with CLI”npx appraisejs@latest add step click/right-clickWhat it does
Section titled “What it does”- Resolves locator by name.
- Performs
click({ button: 'right' }).
Parameters
Section titled “Parameters”| Parameter | Represents | Expected data |
|---|---|---|
{string} | Target locator name | Existing locator key (for example contextMenuTarget). |
Example
Section titled “Example”When the user right clicks on the "contextMenuTarget" elementCommon failures
Section titled “Common failures”- Step fails if locator cannot be resolved.
- Step fails if element is not interactable in current page state.