Element Check
element-check asserts the state of a single element. It is the fastest and most deterministic assertion in Assrt, and should be your default when you know what to point at.
yaml
- element-check:
element: the invoice total
visible: true
enabled: true
text: "$1,240.00"
attributes:
data-status: paid| Field | Type | Description |
|---|---|---|
elementrequired | string | Target element. |
visible | boolean | Whether the element is laid out and not hidden. |
enabled | boolean | Whether the element is interactable. |
text | string | Exact text the element should contain. |
text-contains | string | Substring the text should contain. |
attributes | Record<string, string> | Attribute key/value pairs to match. |