Test Steps Reference
Every action, how targets resolve, what waits, timeouts, and variables.
Execution model
- Steps run top to bottom. The first failing step stops the test; its screenshot is captured.
- There are no automatic retries of steps or tests. Only the internal fallbacks described below are retried.
- A test's steps share one browser session. Tests in a run execute sequentially (1280 × 800).
- Per-step timeout defaults to 8 seconds.
Actions
| Action | Target | Value | Behavior |
|---|---|---|---|
| navigate | Path or URL. Paths resolve against the environment URL. | — | Waits for the page to load, then up to 20 s for at least three visible interactive elements. |
| click | Visible text, or css:<selector>. | — | See target resolution. |
| fill | Input label, or css:<selector>. | Text to type. | Finds the input by its label. |
| select | Dropdown label. | Option to choose. | Tries text matches, then label-based selection. |
| upload | File input label. | File reference. | A placeholder file is generated when the reference is missing. |
| assert | Text, or URL pattern. | Depends on condition. | See assert conditions. |
| waitFor | Text. | — | Waits until text containing it is visible, within the step timeout. |
| wait | Seconds. | — | Fixed pause, capped at 60 seconds. |
| screenshot | Optional frame name. | — | Saves the first canvas, otherwise the page, as a named frame. |
| capture | Regex with one capture group. url:<regex> reads the page URL instead. response:<call> <field> reads a field of the app's API response, e.g. response:PUT /api/designs pdf_url. | Variable name. | Polls up to 30 s and stores the match or field value for later {{name}} use. |
| assert color | CSS selector of a <canvas>. Empty means the first canvas. | Hex color, e.g. #0d5ea0. | See color checks. |
| assert data | API URL the page fetches. | json.path == expected. | Fetches inside the page session and compares a JSON field. |
| assert response | Path of the list the app fetches, e.g. /api/orders. | One rule: all status == Pending, count >= 1, or shown name. | Checks the list the app itself loaded after the previous step. all needs every item to match, count compares the item count, shown needs the first items' text on the page. Fails when the app made no such request. |
| assert download | *.pdf or part of a file name the previous step downloaded, or a file URL such as {{pdfUrl}}. | Optional contains <text>. | The file must exist, not be empty, and start with %PDF if it is a PDF. A URL is fetched with the test's session and retried for up to 60 s while the server still generates the file. contains reads the file's text (a PDF's extracted text) and ignores case and spacing. |
AI generation uses only navigate, click, fill, select, upload, assert, and waitFor. The other actions are written or recorded by hand.
How click targets resolve
A click target is matched against what is visible, in this order, taking the first match of the first stage that finds one:
- Button with that exact accessible name
- Link with that exact name
- Element with that exact text
- Case-insensitive match of the full text
- Case-insensitive substring
- Substring after dropping generic words such as the, button, type
If nothing matches, the render is awaited and the chain runs once more. A failed click reports up to 12 visible buttons and links, which is the fastest way to correct a target.
Matching is not strict. If two buttons both contain Save, the first in page order is clicked and the step passes. Use a more specific label, or css: with a stable selector.
Assert conditions
| Condition | Passes when | Waits? |
|---|---|---|
visible (default) | The target text is visible. | Up to the step timeout. |
hidden | The target text is not visible. | Up to the step timeout. |
contains | The page text contains the target text. | No. |
equals | The first matching element's text equals the value exactly. | No. |
urlMatches | The current URL matches the target (case-insensitive regex). | No. |
AI visual check | A vision model judges the statement in the target against a screenshot. | Settles 2.5 s. Retried once if the judge fails. |
Conditions that do not wait read the page as it is. Put a waitFor step before them when content loads asynchronously.
For an AI visual check, naming a frame captured by an earlier screenshot step compares against that frame. Screenshots of your page are sent to the vision model; see Security.
Color checks
The check reads pixels from a <canvas> element (WebGL or 2D) — for example a 3D or design preview. It does not read <img> elements or CSS colors. Leave the target empty for the first canvas on the page, or give a CSS selector.
Enter the expected hex color and a region as four numbers — x, y, w, h — in percent of the canvas (0–100). Pick opens your app in a browser, takes a screenshot, and lets you drag the rectangle.
The check samples a 4 × 4 grid in the region and compares hue (within 20°) and saturation, polling for up to 30 s so late-loading textures can settle. Brightness is not compared, so two shades of the same hue can both pass.
Variables
| Variable | Source | Use in |
|---|---|---|
{{username}}, {{password}} | The environment's credentials. | A step's target or value, as the whole string. |
{{name}} | A capture step's variable. | Later steps. |
{{query:name}} | A captured value. | The target URL of assert data. |
Credentials are replaced with markers: real values do not appear in test definitions, results, or logs. Login runs once per run and the session is reused.
Checking a generated PDF
When a save returns the document's URL in its API response, rather than offering a download, capture the URL and assert the file:
| # | Action | Target | Value |
|---|---|---|---|
| 1 | click | Save to My Product Designs | |
| 2 | capture | response:PUT /api/designs pdf_url | pdfUrl |
| 3 | assert download | {{pdfUrl}} | contains Flat Direct Embroidery |
Add one assert download step for each piece of text the document must hold.