Liking cljdoc? Tell your friends :D

web.primitives.sdk.core


*page*clj

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!`.
raw docstring

*timeout-ms*clj

How long eventually and the wait helpers keep retrying.

How long `eventually` and the wait helpers keep retrying.
raw docstring

attrclj

(attr el-id attribute)

becomes-hidden?clj

(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*).
raw docstring

becomes-visible?clj

(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*).
raw docstring

by-el-idclj

(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.
raw docstring

by-textclj

(by-text text)

Locator for visible text anywhere on the page.

Locator for visible text anywhere on the page.
raw docstring

click!clj

(click! el-id)

elclj

(el el-id)

Locator for the element carrying el-id.

Locator for the element carrying `el-id`.
raw docstring

el-id->stringclj

(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.
raw docstring

enabled?clj

(enabled? el-id)

eventuallyclj

(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.
raw docstring

eventually-falseclj

(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.
raw docstring

eventually=clj

(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.
raw docstring

goto!clj

(goto! url)

Navigate the bound page to url.

Navigate the bound page to `url`.
raw docstring

hover!clj

(hover! el-id)

pageclj

(page)

The Playwright Page currently bound by with-page.

The Playwright Page currently bound by `with-page`.
raw docstring

present?clj

(present? el-id)

press!clj

(press! key-name)

settleclj

(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.
raw docstring

textclj

(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).
raw docstring

text-contentclj

(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.
raw docstring

type-keys!clj

(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.
raw docstring

visible?clj

(visible? el-id)

wait-attachedclj

(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).
raw docstring

wait-hiddenclj

(wait-hidden locator)

Wait until the element is hidden or detached.

Wait until the element is hidden or detached.
raw docstring

wait-visibleclj

(wait-visible locator)

Wait until the element is visible and return its locator.

Wait until the element is visible and return its locator.
raw docstring

with-pagecljmacro

(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.
raw docstring

withinclj

(within el-id css)

Locator for css inside the element carrying el-id.

Locator for `css` inside the element carrying `el-id`.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close