How-to

Text contains assert (toContainText)

Text contains assert (toContainText) ​

Expect assertion: the Target text contains Value. This is not an exact match of the whole text.

Step model ​

action_nametoContainText
GroupExpect
TargetRequired
ValueRequired (text)
expected_valueUnused
TEST_ACCOUNTAllowed
Do not confuse withtoHaveText

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

Prerequisites ​

  1. The element with text exists.

Steps ​

  1. Add a toContainText step.
  2. Set Target.
  3. Enter the substring in Value.
  4. Save.

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

Examples ​

Status contains Submitted ​

Fields in the UI:

FieldValue
action_nametoContainText
Targetkind TESTID, value status
ValueSubmitted
value_source_typeINLINE

Step JSON fragment (copy-paste):

json
{
  "action_name": "toContainText",
  "target": {
    "kind": "TESTID",
    "value": "status"
  },
  "value_text": "Submitted",
  "value_source_type": "INLINE"
}

Common mistakes ​

  • Use toHaveText when the whole text must match.

Screenshots ​

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

Version 1.0.0 · Last updated 2026-10-03

Did this page help?