How-to
Focused assert (toBeFocused)
Focused assert (toBeFocused)
Expect assertion: focus is on the Target.
Step model
action_name | toBeFocused |
| Group | Expect |
| Target | Required |
| Value | Unused |
| expected_value | Unused |
| TEST_ACCOUNT | Forbidden |
| Do not confuse with | focus, blur |
Target/Value facts match the source-of-truth catalog and Autotest step.
Prerequisites
- Focus must already be on the element before the assert.
Steps
- Add a
toBeFocusedstep. - Set Target.
- Leave Value empty.
- Save.
The step is stored on the autotest. Next - neighbouring steps or autotest run creation.
Examples
Focus is on email
Fields in the UI:
| Field | Value |
|---|---|
action_name | toBeFocused |
| Target | kind LABEL, value Email |
Step JSON fragment (copy-paste):
json
{
"action_name": "toBeFocused",
"target": {
"kind": "LABEL",
"value": "Email"
}
}Common mistakes
focusmoves focus.toBeFocusedasserts that focus is already there.
Screenshots
Screenshots of the step form for toBeFocused will be added here in a later pass.
Did this page help?