Actions
Click
Click on an element.
Description of the element.
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.
button
left | right | middle
default:"left"
modifiers
Alt | Control | ControlOrMeta | Meta | Shift
default:"none"
Type
Focuses the element and triggers an input event with the entered text. It works for <input>
, <textarea>
and [contenteditable]
elements.
Description of the input element.
Skip actionability checks.
Select
Selects an option from a <select>
element.
Value of the option to select.
Description of the select element.
Skip actionability checks.
Hover
Hover over an element.
Description of the element.
Skip actionability checks.
modifiers
Alt | Control | ControlOrMeta | Meta | Shift
Upload files
Click on an element and upload files.
Description of the element.
Array of file paths to upload.
Skip actionability checks.
button
left | right | middle
default:"left"
modifiers
Alt | Control | ControlOrMeta | Meta | Shift
Press key
Produces a single keystroke. It accepts the logical key names that are emitted in the keyboardEvent.key property of the keyboard events:
Backquote, Minus, Equal, Backslash, Backspace, Tab, Delete, Escape,
ArrowDown, End, Enter, Home, Insert, PageDown, PageUp, ArrowRight,
ArrowUp, F1 - F12, Digit0 - Digit9, KeyA - KeyZ, etc.
Wait
Sleep for X milliseconds.
Recommended approach is to rely on auto-waiting of steps. Using explicit waits
can make tests flaky.
Wait to be visible
Wait for an element to be visible.
Description of the element.
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.
Expect text
Pass if all text values are present.
values
{text: string, exactMatch: boolean}[]
required
Text that must be present.
Whether to find an exact match: case-sensitive and whole-string.
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.