Assertions
Every expect retries until it passes or the step’s timeout runs out.
On an element
Section titled “On an element”- expect: <selector> # visible text: … # contains (whitespace normalised), or /regex/ value: … # exact field value count: 3 # number of matches enabled: true # also checked, focused, selected visible: true # or hidden: true absent: true # no visible match (same as hidden: true) exists: false # no match at all, not even hidden (checked on its own) width: <= 375 # 400, >= 400, <= 360, 300..360 (quote values starting with > or <) height: ">= 300" inside: window # or a selector: fully within it scrolls: false # nothing in it scrolls; true, vertical or horizontal app: TextEdit # look in another appabsent is about what a person sees; exists about what’s in the app. Sizes are CSS px on the web and points on desktop.
scrolls looks at the element and everything inside it: false passes when nothing overflows into a scrollbar, true when something does, vertical/horizontal when something scrolls that way and nothing the other way. overflow: hidden clips and doesn’t count. On macOS it reads native scroll areas; web content in a native window (WKWebView, Tauri) fails with NOT_SUPPORTED, so test that page as a web app.
Without an element
Section titled “Without an element”| Form | Passes when |
|---|---|
{ url: /\/dashboard$/ } |
The page URL matches (exact or regex) |
{ title: Todo } |
The page or window title matches |
{ file: ./out/report.pdf, contains: Total } |
The file exists (and contains the text); exists: false for absent |
{ equals: ["${a}", "${b}"] } |
Two values are equal |
{ app: Preview, running: true } |
The app is running; frontmost: true for in front |
{ run: <command>, output: … } |
The command’s whole output matches (exactly, or /regex/) |
{ run: <command>, contains: … } |
Its output contains the text |
{ run: <command> } |
It exits 0; add code: for other codes |
run: takes a command or the same mapping as the run: step. It’s re-run until it matches; afterwards ${output} and ${exit_code} hold the last try’s.
Made by
© 2026 Bussin Bytes Ltd · sisyphus.bussinbytes.io
