How-to

Visibility assert (toBeVisible)

Visibility assert (toBeVisible)

Expect assertion: Target must be visible. A failed step fails the autotest result.

Step model

action_nametoBeVisible
GroupExpect
TargetRequired
ValueUnused
expected_valueUnused
TEST_ACCOUNTForbidden
Do not confuse withwaitForSelector

Target/Value facts match the source-of-truth catalog and Autotest step.

Prerequisites

  1. The locator uniquely identifies the element.

Steps

  1. Add a toBeVisible step.
  2. Set Target.
  3. Optionally set timeout_ms.
  4. Save.

The step is stored on the autotest. Next - neighbouring steps or autotest run creation.

Examples

Success message

Fields in the UI:

FieldValue
action_nametoBeVisible
Targetkind TEXT, value Saved
timeout_ms10000

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 ROLE heading with one name can match two nodes (app bar and card title). Playwright strict mode then fails. Switch kind to CSS with 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.

Version 1.1.0 · Last updated 2026-09-14

Did this page help?