DSL
Conditions
Every kind of condition, for landmarks, expectations and control flow.
A condition is an object with exactly one of these keys. Conditions are written in landmarks, a step's expect and if, when, loop_until, wait_for, scroll.until and paginate.stop_when; all, any and not combine them.
| Condition | Type | Description |
|---|---|---|
url | string or object | True when the page URL matches a glob (* within a path segment, ** across segments, ? one character), or a regular expression given as { "matches": … }. |
title | object | True when the page title matches; give exactly one of contains, equals or matches. |
visible | target | True when the target exists and is visible. |
hidden | target | True when the target is not visible, including when it does not exist. |
exists | target | True when the target is in the page, visible or not. |
absent | target | True when the target is not in the page. |
text | object | True when the target's text matches; give target and exactly one of contains, equals or matches. |
count | object | True when the number of elements matching target satisfies the bounds; give at least one of min, max and eq. |
network | object | True when a response matching url, and method and status if given, has been observed since the step started. |
var | object | Compares a value from inputs, vars, session or job with op and value. |
landmark | string | True when the named entry of the program's landmarks holds. |
all | condition[] | True when every condition in the list holds. |
any | condition[] | True when at least one condition in the list holds. |
not | condition | True when the given condition does not hold. |