Docs/Steps

AI Check

ai-check asserts a natural-language expectation about the current state of the page. At runtime, Assrt captures a snapshot of the visible UI and checks whether the expectation holds.

Shorthand

yaml
- ai-check: a success banner confirms the invoice was sent

Writing expectations that pass reliably

Keep expectations focused and observable. "The dashboard is visible" is good; "the user is happy" is not.

yaml
# good
- ai-check: the page shows a "Payment received" confirmation
- ai-check: at least three invoices are listed

# too vague
- ai-check: everything looks correct

# too specific for AI; use element-check instead
- ai-check: the total shows $1,240.00 in bold in the top right
When to reach for structural checks
If you can point at one element and say what it should contain, use element-check. AI checks shine when the expectation is about the page as a whole, or about a pattern that spans elements.