steps, before, or after array. Each page documents the parameters,
shorthand form, and idiomatic examples for a single command. For mobile tests,
see Mobile commands.
See Test format for the global file shape and
Modules for how to call modules from a test.
AI
| Command | Summary |
|---|---|
act | Run an AI agent that performs actions to satisfy a natural-language goal. |
assert | Run an AI assertion against the DOM, accessibility tree, and screenshot. |
assertVisually | Run an AI assertion using a screenshot only. |
extract | Pull a value off the page with the AI agent and save it to env. |
Mouse
| Command | Summary |
|---|---|
blur | Remove keyboard focus from an element (or the active element). |
click | Click an element identified by description, CSS, or coordinates. |
doubleClick | Double-click an element. |
dragAndDrop | Drag from one element or position to another. |
focus | Move keyboard focus to an element. |
hover | Hover the mouse over an element. |
mouseDrag | Drag the mouse a relative delta from an origin. |
rightClick | Right-click an element to open a context menu. |
Keyboard
| Command | Summary |
|---|---|
copy | Write a value to the system clipboard. |
keyDown | Press a key down without releasing it. |
keyUp | Release a previously pressed key. |
paste | Paste the current clipboard contents. |
press | Press a key or key combination. |
select | Pick an option from a <select> dropdown. |
type | Type text into an input, optionally clearing and submitting. |
Form
| Command | Summary |
|---|---|
fileUpload | Attach a file to the next file picker the page opens. |
Scroll
| Command | Summary |
|---|---|
scrollDown | Scroll the page or a container down. |
scrollLeft | Scroll the page or a container left. |
scrollRight | Scroll the page or a container right. |
scrollUp | Scroll the page or a container up. |
Navigation
| Command | Summary |
|---|---|
closeTab | Close the active tab or a matching tab. |
goBack | Navigate back in the browser history. |
goForward | Navigate forward in the browser history. |
navigate | Navigate the current tab to a URL. |
newTab | Open a URL in a new tab and switch to it. |
refresh | Reload the current page. |
switchTab | Switch the active tab by index, URL substring, or URL regex. |
Waits
| Command | Summary |
|---|---|
wait | Pause execution for a fixed duration in milliseconds. |
waitForUrl | Wait until the page URL matches a substring, glob, regex, or domain. |
waitForUrlNotToMatch | Wait until the page URL stops matching a substring, glob, regex, or domain. |
Page checks
| Command | Summary |
|---|---|
checkPageContains | Assert that the visible page text contains a substring. |
checkPageDoesNotContain | Assert that the visible page text does NOT contain a substring. |
Element checks
| Command | Summary |
|---|---|
checkElement | Element-level assertion family for the element itself. |
checkElementAttribute | Element-level assertion family for an HTML attribute on the element. |
checkElementContent | Element-level assertion family for the element’s text content. |
checkElementName | Element-level assertion family for the element’s tag name. |
checkElementStyle | Element-level assertion family for a computed CSS style on the element. |
Network
| Command | Summary |
|---|---|
awaitListener | Block until a previously registered listener captures a request. |
getRecordedRequests | Retrieve the list of requests captured by recordRequests. |
graphqlRequest | Make a server-side GraphQL request and capture the response. |
header | Set an HTTP request header on outgoing requests. |
mock | Intercept a network route and return a custom response. |
recordRequests | Start recording every request that matches a URL pattern. |
registerRequestListener | Start listening for requests that match a URL pattern. |
removeRouteMock | Remove a previously installed route mock by key. |
request | Make an out-of-band HTTP request and capture the response. |
Storage
| Command | Summary |
|---|---|
cookie | Set a browser cookie via a name=value string. |
localStorage | Write a key/value pair into window.localStorage. |
Authentication
Visual
| Command | Summary |
|---|---|
captcha | Solve a captcha challenge on the current page. |
dialog | Auto-handle the next browser dialog (alert/confirm/prompt). |
visualDiff | Compare a viewport or element screenshot against a golden file. |
Connectivity
Scripts
| Command | Summary |
|---|---|
javascript | Run arbitrary JavaScript inside the test runtime. |