How-to
Field value assert (toHaveValue)
Field value assert (toHaveValue)
Expect assertion: the Target field value equals Value.
Step model
action_name | toHaveValue |
| Group | Expect |
| Target | Required |
| Value | Required (text) |
| expected_value | Unused |
| TEST_ACCOUNT | Allowed |
| Do not confuse with | toHaveText, fill |
Target/Value facts match the source-of-truth catalog and Autotest step.
Prerequisites
- Target is a field with a value.
Steps
- Add a
toHaveValuestep. - Set Target.
- Enter the expected field value in Value.
- Save.
The step is stored on the autotest. Next - neighbouring steps or autotest run creation.
Examples
Buyer email
Fields in the UI:
| Field | Value |
|---|---|
action_name | toHaveValue |
| Target | kind LABEL, value Email |
| Value | buyer@shop.test |
| value_source_type | INLINE |
Step JSON fragment (copy-paste):
json
{
"action_name": "toHaveValue",
"target": {
"kind": "LABEL",
"value": "Email"
},
"value_text": "buyer@shop.test",
"value_source_type": "INLINE"
}Common mistakes
- The visible field label is not its value. Use
toHaveTextortoContainTextfor a label.
Screenshots
Screenshots of the step form for toHaveValue will be added here in a later pass.
Did this page help?