How-to
Visibility assert (toBeVisible)
Visibility assert (toBeVisible)
Expect assertion: Target must be visible. A failed step fails the autotest result.
Step model
action_name | toBeVisible |
| Group | Expect |
| Target | Required |
| Value | Unused |
| expected_value | Unused |
| TEST_ACCOUNT | Forbidden |
| Do not confuse with | waitForSelector |
Target/Value facts match the source-of-truth catalog and Autotest step.
Prerequisites
- The locator uniquely identifies the element.
Steps
- Add a
toBeVisiblestep. - Set Target.
- Optionally set
timeout_ms. - Save.
The step is stored on the autotest. Next - neighbouring steps or autotest run creation.
Examples
Success message
Fields in the UI:
| Field | Value |
|---|---|
action_name | toBeVisible |
| Target | kind TEXT, value Saved |
| timeout_ms | 10000 |
Step JSON fragment (copy-paste):
json
{
"action_name": "toBeVisible",
"target": {
"kind": "TEXT",
"value": "Saved"
},
"timeout_ms": 10000
}Common mistakes
- waitForSelector waits for presence; toBeVisible asserts visibility.
- A
ROLEheading with one name can match two nodes (app bar and card title). Playwright strict mode then fails. Switch kind toCSSwith a one-node selector, or drop the extra assert. - Breakdown: How to author autotest steps without false failures.
Screenshots
Screenshots of the step form for toBeVisible will be added here in a later pass.
Did this page help?