The Playwright Page the SDK acts on. Bind it once per test with
with-page, or pass a page explicitly to use-page!.
The Playwright Page the SDK acts on. Bind it once per test with `with-page`, or pass a page explicitly to `use-page!`.
How long eventually and the wait helpers keep retrying.
How long `eventually` and the wait helpers keep retrying.
(attr el-id attribute)(becomes-hidden? el-id)True once the element is hidden or gone (waits up to timeout-ms).
True once the element is hidden or gone (waits up to *timeout-ms*).
(becomes-visible? el-id)True once the element is visible (waits up to timeout-ms).
True once the element is visible (waits up to *timeout-ms*).
(by-el-id el-id)CSS selector matching an element whose id or data-testid is el-id.
Primitives expose el-id as :id on inputs and :data-testid on
containers and buttons; this matches both.
CSS selector matching an element whose id or data-testid is `el-id`. Primitives expose el-id as :id on inputs and :data-testid on containers and buttons; this matches both.
(by-text text)Locator for visible text anywhere on the page.
Locator for visible text anywhere on the page.
(click! el-id)(el el-id)Locator for the element carrying el-id.
Locator for the element carrying `el-id`.
(el-id->string el-id)Resolve an el-id exactly the way components do, so tests can pass the same keyword / vector the view used.
Resolve an el-id exactly the way components do, so tests can pass the same keyword / vector the view used.
(enabled? el-id)(eventually f)Poll f until it returns a truthy value or timeout-ms passes.
Returns the last value. MUI animates most state changes (dialogs,
transitions, drawers, lazy editors), so read-after-act queries use this
instead of reading the DOM once.
Poll `f` until it returns a truthy value or *timeout-ms* passes. Returns the last value. MUI animates most state changes (dialogs, transitions, drawers, lazy editors), so read-after-act queries use this instead of reading the DOM once.
(eventually-false f)Poll f until it returns falsy or timeout-ms passes. Returns the last value.
Poll `f` until it returns falsy or *timeout-ms* passes. Returns the last value.
(eventually= expected read)Poll read until it returns a value equal to expected or timeout-ms
passes. Returns the last value read. Use for read-after-act assertions so a
re-frame / React re-render has time to land before the value is compared.
Poll `read` until it returns a value equal to `expected` or *timeout-ms* passes. Returns the last value read. Use for read-after-act assertions so a re-frame / React re-render has time to land before the value is compared.
(hover! el-id)(page)The Playwright Page currently bound by with-page.
The Playwright Page currently bound by `with-page`.
(present? el-id)(press! key-name)(settle act! read expected)Run the side-effecting action act!, then poll read until it equals
expected (or timeout-ms passes). Returns the final value read.
This is the building block for state-changing SDK actions: it retries the
read so the caller never observes a value from before the UI re-rendered.
When read never reaches expected, act! is re-run once per poll so a
dropped event (e.g. a key press that raced a re-render) is repeated.
Run the side-effecting action `act!`, then poll `read` until it equals `expected` (or *timeout-ms* passes). Returns the final value read. This is the building block for state-changing SDK actions: it retries the read so the caller never observes a value from before the UI re-rendered. When `read` never reaches `expected`, `act!` is re-run once per poll so a dropped event (e.g. a key press that raced a re-render) is repeated.
(text el-id)Trimmed visible text of the element (as rendered, so CSS text-transform applies, e.g. MUI buttons are upper-cased).
Trimmed visible text of the element (as rendered, so CSS text-transform applies, e.g. MUI buttons are upper-cased).
(text-content el-id)Trimmed text as written in the markup, ignoring CSS text-transform.
Trimmed text as written in the markup, ignoring CSS text-transform.
(type-keys! text delay-ms)Type text one key at a time with delay-ms between keys, like a user.
Type `text` one key at a time with `delay-ms` between keys, like a user.
(visible? el-id)(wait-attached locator)Wait until the element is in the DOM (it may be hidden).
Wait until the element is in the DOM (it may be hidden).
(wait-hidden locator)Wait until the element is hidden or detached.
Wait until the element is hidden or detached.
(wait-visible locator)Wait until the element is visible and return its locator.
Wait until the element is visible and return its locator.
(with-page page & body)Run body with page as the page every SDK function acts on.
Run body with `page` as the page every SDK function acts on.
(within el-id css)Locator for css inside the element carrying el-id.
Locator for `css` inside the element carrying `el-id`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |