Step actions reference
Each English line you write becomes one action in this list. The parser maps natural language to one of these action keys; the executor (Playwright, under the hood) runs them. This page is the complete inventory.
Action shape
Section titled “Action shape”Every step is a single key-value pair. The key is the action; the value is
either a string (target text) or an object with a target and other fields:
- click: "Sign in button"
- type: target: "email field" text: "user@example.com"
- verifyVisible: "Welcome back"Some actions accept aliases so multiple natural phrasings map to the
same behavior — click and tapOn, type and inputText,
verifyVisible and assertVisible. Use whichever reads more naturally.
Optional steps
Section titled “Optional steps”Any action can take optional: true. If the target element isn’t found,
the step is marked skipped instead of failed and the run continues:
- click: target: "Cookie banner accept" optional: trueThis is most useful for cookie banners, A/B-tested elements, and anything that may or may not be there.
Navigation
Section titled “Navigation”navigate / openLink
Section titled “navigate / openLink”Go to a URL. Waits for the page to finish loading.
- navigate: "https://example.com"Navigate browser back one entry.
- back: truegoForward
Section titled “goForward”Navigate browser forward one entry.
- goForward: truerefresh
Section titled “refresh”Reload the current page.
- refresh: truelaunchApp
Section titled “launchApp”Open an app by URL. If the value isn’t an http(s):// URL, the step is a
no-op (reserved for native-app contexts).
- launchApp: "https://app.example.com"click / tapOn
Section titled “click / tapOn”Click (or tap) an element. If the element is outside the viewport, the executor scrolls to find an in-viewport equivalent before clicking.
- click: "Sign in button"type / inputText
Section titled “type / inputText”Type into a field. With a target, fills that specific field. Without one,
fills the currently focused input — or the first visible input on the page
as a fallback.
- type: target: "email field" text: "user@example.com"
- type: "user@example.com" # fills focused/first visible inputclear / clearText
Section titled “clear / clearText”Clear a field. Same target rules as type.
- clear: target: "search input"
- clear: true # clears focused/first visible inputpressKey
Section titled “pressKey”Press a single key. Use Playwright key names (Enter, Escape, Tab,
ArrowDown, etc.).
- pressKey: "Enter"longPress
Section titled “longPress”Click and hold for one second. Useful for context menus on mobile-style sites.
- longPress: "thumbnail image"doubleClick
Section titled “doubleClick”Double-click an element.
- doubleClick: "row item"rightClick
Section titled “rightClick”Right-click (context-menu click) an element.
- rightClick: "file in tree"Move the pointer over an element without clicking.
- hover: "user avatar"scroll / swipe
Section titled “scroll / swipe”Scroll the page. Direction defaults to down.
- scroll: "down"- scroll: direction: "up"Accepted values: down, up, left, right.
selectOption
Section titled “selectOption”Pick an option from a <select> dropdown. With a target, picks from that
specific dropdown; without, uses the first visible select on the page.
- selectOption: target: "country dropdown" value: "US"
- selectOption: "US"Check a checkbox. No-op if it’s already checked.
- check: "I agree to the terms"uncheck
Section titled “uncheck”Uncheck a checkbox. No-op if it’s already unchecked.
- uncheck: "Subscribe to newsletter"Assertions
Section titled “Assertions”All assertions wait up to 10 seconds for the condition to become true before failing. There’s no per-step override flag.
verifyVisible / assertVisible
Section titled “verifyVisible / assertVisible”Assert an element (or text) is visible. With a string target, falls back
to fuzzy text search if the exact text isn’t found — see
Locator resolution.
- verifyVisible: "Welcome back"
- verifyVisible: target: "Sign out button"verifyNotVisible / assertNotVisible
Section titled “verifyNotVisible / assertNotVisible”Assert an element is not visible.
- verifyNotVisible: "Loading spinner"verifyText
Section titled “verifyText”Assert exact text content of an element. With elementType: "text" (or
just a string), falls back to the same fuzzy text search as
verifyVisible.
- verifyText: target: "page heading" elementType: "heading" expected: "Dashboard"
- verifyText: "Welcome back"verifyContainsText
Section titled “verifyContainsText”Assert an element contains the given text (substring match).
- verifyContainsText: target: "status message" expected: "successfully"verifyValue
Section titled “verifyValue”Assert the value of an input matches.
- verifyValue: target: "email input" expected: "user@example.com"verifyAttribute
Section titled “verifyAttribute”Assert an HTML attribute equals an expected string.
- verifyAttribute: target: "submit button" attribute: "disabled" expected: "true"verifyCount
Section titled “verifyCount”Assert the number of matching elements. With elementType: "checkbox" or
"button", counts by ARIA role; otherwise by text match.
- verifyCount: elementType: "checkbox" count: 3
- verifyCount: target: "row item" count: 5verifyChecked / verifyNotChecked
Section titled “verifyChecked / verifyNotChecked”Assert a checkbox or radio is (or isn’t) checked.
- verifyChecked: "Remember me"- verifyNotChecked: "Subscribe to newsletter"verifyEnabled / verifyDisabled
Section titled “verifyEnabled / verifyDisabled”Assert an interactive element is (or isn’t) enabled.
- verifyEnabled: "Submit button"- verifyDisabled: "Submit button"verifyFocused
Section titled “verifyFocused”Assert an element currently has keyboard focus.
- verifyFocused: "search input"verifyEmpty
Section titled “verifyEmpty”Assert an element has no children or text.
- verifyEmpty: "empty cart message"verifyUrl
Section titled “verifyUrl”Assert the current page URL matches.
- verifyUrl: "https://example.com/dashboard"verifyTitle
Section titled “verifyTitle”Assert the document title matches.
- verifyTitle: "Dashboard — Example"Pause execution. Defaults to 2 seconds if no value given.
- wait: 5
- wait: seconds: 5Use sparingly — every assertion already auto-waits up to 10 seconds. Hard sleeps are usually a sign of a missing assertion.
waitForLoad
Section titled “waitForLoad”Wait for the network to go idle (no requests for 500ms). Times out at 15 seconds and continues without failing — the run keeps going either way.
- waitForLoad: truewaitForElement
Section titled “waitForElement”Wait for an element matching the given text to become visible. Default timeout 10 seconds, override per-step.
- waitForElement: "Dashboard"
- waitForElement: target: "Dashboard" timeout: 30000timeout is in milliseconds.
Screenshots and visual regression
Section titled “Screenshots and visual regression”screenshot / takeScreenshot
Section titled “screenshot / takeScreenshot”Capture a screenshot. With a target, captures just that element;
without, captures the full page.
- screenshot: true # full page
- screenshot: target: "search input" elementType: "input" # element-onlyWhen the test runs in visual regression mode with a saved baseline, the screenshot is compared against the baseline using a vision model. See Visual regression for the comparison mechanics.
Screenshot steps respect optional: true — if the target element isn’t
there, the step is skipped, not failed.
Action aliases
Section titled “Action aliases”A few actions accept multiple keys for readability. They’re identical:
| Canonical | Alias |
|---|---|
click | tapOn |
type | inputText |
clear | clearText |
verifyVisible | assertVisible |
verifyNotVisible | assertNotVisible |
screenshot | takeScreenshot |
navigate | openLink |
scroll | swipe |
See also
Section titled “See also”- YAML schema reference — the file structure these actions live inside
- Locator resolution — how
target: "Sign in button"finds the right element - Visual regression — what the
screenshotaction does on a baseline run