Assertions
The checks that make a test pass or fail, and the three ways to add them.
The Assert button (main way)
- While recording, click Assert, then click an element in the browser.
- The dialog “Assertion for: <element>” opens. Optionally tick:
- Not — inverts the check (e.g. “is not visible”).
- Soft — if the check fails, the test records the failure but keeps running.
- Pick a check:
| Group | Check | Meaning |
|---|---|---|
| Visibility | toBeVisible | Element is visible on the page. |
| toBeHidden | Element is not visible. | |
| Text | toHaveText | Element text matches exactly (pre-filled with the current text). |
| toContainText | Element contains a piece of text. | |
| toHaveValue | Input has the expected value. | |
| State | toBeEnabled / toBeDisabled | Control is interactive / disabled. |
| toBeChecked / not.toBeChecked | Checkbox or radio is checked / unchecked. | |
| Collection / Attributes | toHaveCount | The locator matches N elements. |
| toHaveAttribute | An attribute (e.g. href, aria-expanded, data-state) has a value. | |
| toHaveClass | Element has a class (partial match allowed). | |
| Page | toHaveURL | The current page address matches (part of it or the full address). |
For checks that need a value, type it and click Add Assertion (or press Enter); Back (or Esc) returns to the list.
Right-click quick assertions
While recording, right-click an element → Assert Visible, Assert Hidden or Assert Text equals.
Network assertions
In Debug → Network, select a request. Under Assertion Actions:
- Status N — adds a step that waits for a response from that address with that status code.
- Endpoint — adds a step that waits for a response whose address contains that path, with the observed status code.
Something unclear or missing? Write to info@actify-studio.com.