How-to

Text assert (toHaveText)

Text assert (toHaveText)

Asserts that Target text matches Value.

Step model

action_nametoHaveText
GroupExpect
TargetRequired
ValueRequired (text)
expected_valueUnused
TEST_ACCOUNTAllowed
Do not confuse withtoBeVisible, toHaveAttribute

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

Prerequisites

  1. The element with text exists.

Steps

  1. Add a toHaveText step.
  2. Set Target.
  3. Put the expected text in Value.
  4. Save.

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

Examples

Card title

Fields in the UI:

FieldValue
action_nametoHaveText
Targetkind ROLE, value heading, name Profile
ValueProfile
value_source_typeINLINE

Step JSON fragment (copy-paste):

json
{
  "action_name": "toHaveText",
  "target": {
    "kind": "ROLE",
    "value": "heading",
    "name": "Profile"
  },
  "value_text": "Profile",
  "value_source_type": "INLINE"
}

Common mistakes

  • Match the exact text including spaces and case as the page renders it.

Screenshots

Screenshots of the step form for toHaveText will be added here in a later pass.

Version 1.0.0 · Last updated 2026-09-11

Did this page help?