Skip to content

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 click steps when the scenario needs a direct UI action against an existing locator.

the user clicks on the {string} element

Terminal window
npx appraisejs@latest add step click/click
  • Resolves locator by name.
  • Performs a standard Playwright click.
ParameterRepresentsExpected data
{string}Target locator nameExisting locator key (for example loginButton).
When the user clicks on the "loginButton" element

the user double clicks on the {string} element

Terminal window
npx appraisejs@latest add step click/double-click
  • Resolves locator by name.
  • Performs dblclick() on the matched element.
ParameterRepresentsExpected data
{string}Target locator nameExisting locator key (for example rowItem).
When the user double clicks on the "rowItem" element

the user right clicks on the {string} element

Terminal window
npx appraisejs@latest add step click/right-click
  • Resolves locator by name.
  • Performs click({ button: 'right' }).
ParameterRepresentsExpected data
{string}Target locator nameExisting locator key (for example contextMenuTarget).
When the user right clicks on the "contextMenuTarget" element
  • Step fails if locator cannot be resolved.
  • Step fails if element is not interactable in current page state.