assertCondition
Assert that a visibility or script condition holds.
The assertCondition command checks one or more conditions and fails the step if any of them does not hold. The conditions are the same ones that runFlow accepts in when.
Parameters
| Parameter | Type | Description |
|---|---|---|
visible | Selector | Fails if the element is not visible. See Selectors. |
notVisible | Selector | Fails if the element is still visible. |
true | JavaScript string | Fails if the expression is falsy. Write it as ${...}. |
platform | String | Android or iOS. On another platform the step is skipped and counts as passed. |
timeout | Integer | Milliseconds to wait for visible and notVisible. If missing, the selector's own timeout is used, otherwise there is no extra wait. |
When you set several conditions, they are checked in the order visible, notVisible, true.
Usage examples
yaml
- assertCondition:
visible: "Welcome"
timeout: 5000yaml
- assertCondition:
notVisible: "Loading…"
true: ${output.count > 0}Run the check only on Android:
yaml
- assertCondition:
platform: Android
visible:
id: "toolbar"