Skip to content

YAML steps ​

Every step a YAML test can use. A step is one verb with its value: - goto: /cart, or with fields, - click: { target: "#save", timeout: 2000 }. Fields can also sit beside the verb on their own lines. Steps with a plain-value form name the field it fills.

Text values can use ${params.name}, ${saved.key}, ${secret.NAME}, ${env.NAME}, ${attempt}, ${attempts} and ${last} (see Variables). Where a number or true / false goes, a variable works too.

Go ​

goto ​

Opens a URL. A relative URL is joined to the pack's site.baseURL. Only http and https addresses open (not file:).

Also written as - goto: <url>.

FieldType
url (required)textThe URL.
waitUntilload, domcontentloaded, networkidle, commitWhen the page counts as loaded (default load).

back ​

Goes back in the browser history.

Also written as - back.

reload ​

Reloads the page.

Also written as - reload.

clear ​

Clears cookies, the open site's local and session storage, or both (the default), for a clean start.

Also written as - clear or - clear: <what>.

FieldType
whatcookies, storage, allWhat to clear (default all).

Act ​

click ​

Clicks an element. With done, waits for that element to show, which also tells a click that landed from one that didn't.

Also written as - click: <target>.

FieldType
target (required)targetThe element.
donetargetAn element that shows once the click worked.
buttonleft, right, middleWhich mouse button (default left).
positionmapA spot inside the element, { x, y } in pixels from its top-left corner, to use instead of its middle (for canvases, maps and image pickers).
timeoutwhole numberTime limit in ms (default 15000).

dblclick ​

Double-clicks an element.

Also written as - dblclick: <target>.

FieldType
target (required)targetThe element.
positionmapA spot inside the element, { x, y } in pixels from its top-left corner, to use instead of its middle (for canvases, maps and image pickers).
timeoutwhole numberTime limit in ms (default 15000).

fill ​

Replaces the text in an input, text area or editable element.

FieldType
target (required)targetThe field.
value (required)text, number or true / falseThe text to put in.

type ​

Types text key by key, for fields that react to each key (search as you type).

FieldType
target (required)targetThe field.
text (required)textThe text.
delaywhole numberPause between keys in ms.

press ​

Presses a key or a combination (Enter, Escape, Control+A). With a target, on that element.

Also written as - press: <key>.

FieldType
key (required)textThe key: Enter, Tab, ArrowDown, Control+S, …
targettargetPress on this element instead of the page.

check ​

Ticks a checkbox or picks a radio button.

Also written as - check: <target>.

FieldType
target (required)targetThe element.

uncheck ​

Unticks a checkbox.

Also written as - uncheck: <target>.

FieldType
target (required)targetThe element.

select ​

Picks options in a select element, by value or label.

FieldType
target (required)targetThe select element.
option (required)text or list of textThe option, or a list of them.

hover ​

Moves the mouse over an element.

Also written as - hover: <target>.

FieldType
target (required)targetThe element.
positionmapA spot inside the element, { x, y } in pixels from its top-left corner, to use instead of its middle (for canvases, maps and image pickers).

upload ​

Sets the files of a file input. Paths are relative to the pack folder, and the files must be inside it.

FieldType
target (required)targetThe file input.
files (required)text or list of textA file, or a list of files.

scroll ​

Scrolls the page or an element to the top or bottom, or scrolls an element into view.

Also written as - scroll: <to>.

FieldType
totop, bottomtop or bottom.
targettargetThe element to scroll (with to) or to bring into view.

Wait ​

wait ​

Waits a number of milliseconds. Time spent paused doesn't count.

Also written as - wait: <ms>.

FieldType
ms (required)whole numberMilliseconds.

waitFor ​

Waits until an element is in a state (default visible).

Also written as - waitFor: <target>.

FieldType
target (required)targetThe element.
statevisible, hidden, attached, detachedvisible, hidden, attached or detached.
timeoutwhole numberTime limit in ms (default 30000).

idle ​

Waits until the network is quiet and the pack's idle check (if it has one) says the app is idle.

Also written as - idle.

FieldType
timeoutwhole numberTime limit in ms (default 30000).
quietMswhole numberHow long the network must be quiet (default 500).

Check ​

expect ​

Checks the page. Give one check; with not, the opposite. Retries until it passes or times out (default 5000 ms). A failed check fails the attempt.

FieldType
targettargetThe element to check (not needed for url and title).
visibletrue / falseThe element is visible.
hiddentrue / falseThe element is hidden or gone.
texttext or { regex }The element's whole text.
containsTexttext or { regex }Text the element contains.
valuetext or { regex }An input's value.
countwhole numberHow many elements match.
checkedtrue / falseA checkbox is ticked.
enabledtrue / falseThe element is enabled.
disabledtrue / falseThe element is disabled.
urltext or { regex }The page URL (relative to the site's baseURL, or a regex).
titletext or { regex }The page title.
nottrue / falseCheck the opposite.
timeoutwhole numberHow long to retry in ms (default 5000).

Keep ​

shot ​

Saves a screenshot of the page, the whole page, or one element.

Also written as - shot: <name>.

FieldType
name (required)textThe screenshot's name.
fullPagetrue / falseThe whole page, not only what's in view.
targettargetOnly this element.

scrollShots ​

Scrolls the page (or an element) top to bottom and saves a screenshot per screen.

Also written as - scrollShots: <name>.

FieldType
name (required)textThe screenshots' name.
targettargetScroll this element instead of the page.
maxwhole numberAt most this many (default 20).

keepText ​

Saves an element's text (or the given text) with the attempt.

FieldType
name (required)textThe text's name.
targettargetThe element to read.
texttextText to keep instead of an element's.

saveSignIn ​

Saves the browser's cookies and local storage as the site's sign-in, for runs that start signed in (site.signIn: saved). Put it at the end of a login test.

Also written as - saveSignIn.

note ​

A note for the people who review the result.

Also written as - note: <text>.

FieldType
text (required)text

log ​

A line in the attempt's log.

Also written as - log: <text>.

FieldType
text (required)text

flag ​

Raises a flag the pack declares in flags.

Also written as - flag: <name>.

FieldType
name (required)textThe flag.
detailtextWhat happened.

metric ​

Saves a number: the given value, or the first number in an element's text.

FieldType
name (required)textThe metric's name.
valuetext, number or true / falseThe number.
targettargetRead the number from this element.
unittextThe unit: s, ms, items, …

save ​

Keeps a value for later tests (read it as ${saved.key}): the given value, or an element's text. Kept from a test's last attempt.

FieldType
key (required)textThe name to keep it under.
valueany valueThe value.
targettargetKeep this element's text.

info ​

Saves a fact about the whole run (an app version, a mode), shown on the run page.

FieldType
key (required)textThe fact's name.
value (required)text, number or true / falseIts value.

Shape ​

step ​

A titled group of steps, shown as one step live and in the timeline.

FieldType
title (required)textThe title.
steps (required)stepsThe steps.

if ​

Runs then when the condition holds, else else. Conditions: has (an element is visible), hasNot, or equals (two values).

FieldType
hastargetHolds when this element is visible.
hasNottargetHolds when this element is not visible.
equalslist of text, number or true / falseHolds when the two values are the same text.
timeoutwhole numberWith has or hasNot: wait up to this long in ms for the element (default 0: look once).
then (required)stepsThe steps when it holds.
elsestepsThe steps when it doesn't.

repeat ​

Runs steps a number of times, or until an element shows (at most max times, default 20).

FieldType
timeswhole numberHow many times.
untiltargetStop once this element shows.
maxwhole numberWith until: give up after this many rounds.
steps (required)stepsThe steps.

child ​

Runs a child test (one with inside: <this test>) here, as its own attempt.

Also written as - child: <id>.

FieldType
id (required)textThe child test's id.

skip ​

Ends the attempt as skipped, with the reason.

Also written as - skip: <reason>.

FieldType
reason (required)text

use ​

Calls one of the pack's own helpers (from helpers in a code pack file) with arguments.

Also written as - use: <helper>.

FieldType
helper (required)textThe helper's name.
argslist of any valueIts arguments.

Targets ​

A target is a Playwright selector string ("#save", "text=Save", "[data-test=save]"), or a map with one of role, label, placeholder, text, alt, title, testId or css, plus optional filters:

KeySame as in Playwright
role with name, exact, checked, disabled, expanded, pressed, selected, level, includeHiddengetByRole
label, placeholder, text, alt, title (with exact)getByLabel, getByPlaceholder, getByText, getByAltText, getByTitle
testIdgetByTestId
csslocator(css)
hasText, hasNotText, hasfilter()
nth (from 0, -1 is the last), first, lastnth(), first(), last()
withina target to look inside
framean iframe to look inside

Text in name, label, text and the other text keys can be a regex: { regex: "^Save", flags: i }.

Released under the Apache-2.0 license.