Steps
Learn about types of steps that you can use in your tests
Actions
Click
Click on an element.
Description of the element.
Timeout in milliseconds.
Sometimes, apps use non-trivial logic where hovering the element overlays it with another element that intercepts the click. This behavior is indistinguishable from a bug where element gets covered and the click is dispatched elsewhere. If you know this is taking place, you can bypass the actionability checks and force the click.
Type
Focuses the element and triggers an input event with the entered text. It works for <input>
, <textarea>
and [contenteditable]
elements.
Text to type.
Description of the input element.
Timeout in milliseconds.
Skip actionability checks.
Select
Selects an option from a <select>
element.
Value of the option to select.
Description of the select element.
Timeout in milliseconds.
Skip actionability checks.
Hover
Hover over an element.
Description of the element.
Timeout in milliseconds.
Skip actionability checks.
Upload files
Click on an element and upload files.
Description of the element.
Array of file paths to upload.
Timeout in milliseconds.
Skip actionability checks.
Press key
Produces a single keystroke. It accepts the logical key names that are emitted in the keyboardEvent.key property of the keyboard events:
Key to press.
Wait
Sleep for X milliseconds.
Recommended approach is to rely on auto-waiting of steps. Using explicit waits can make tests flaky.
Timeout in milliseconds.
Wait to be visible
Wait for an element to be visible.
Description of the element.
Timeout in milliseconds.
JS
Execute JavaScript and Playwright code.
Scope: page
, context
, request
, inputs
, faker
, expect
, variables from previous steps, and custom fixtures.
Use return { item1, item2 }
to pass variables to the scope of next steps.
Checks
Visual page validation
Compare screenshot of the page with the expected one.
Whether to validate the full page or just the viewport.
Whether to use AI to ignore false positive failures.
Explain which parts of the page to ignore.
Visual component validation
Compare screenshot of the component with the expected one.
Whether to compare the component visually.
Whether to use AI to ignore false positive failures.
Explain which parts of the component to ignore.
Expect element
Description of the element.
Timeout in milliseconds.
Expect text
Pass if all text values are present.
Timeout in milliseconds.
AI assert
Fail if any of the statements is not true.
Statements that must be true.
Navigation
Go to
Navigate to a URL.
Open new tab
Open a new tab and navigate to a URL.
Refresh
Refresh the page.