Page operations - navigation, content, evaluation, screenshots, events, and utility classes (Dialog, Download, ConsoleMessage, Clock, FileChooser, Worker, WebError). The Page class is the central API surface of Playwright. Wraps all Page methods with idiomatic Clojure functions.
Page operations - navigation, content, evaluation, screenshots, events, and utility classes (Dialog, Download, ConsoleMessage, Clock, FileChooser, Worker, WebError). The Page class is the central API surface of Playwright. Wraps all Page methods with idiomatic Clojure functions.
(add-script-tag page opts)Adds a script tag to the page.
Params:
page - Page instance.
opts - Map with :url, :path, or :content.
Returns: ElementHandle or anomaly map.
Adds a script tag to the page. Params: `page` - Page instance. `opts` - Map with :url, :path, or :content. Returns: ElementHandle or anomaly map.
(add-style-tag page opts)Adds a style tag to the page.
Params:
page - Page instance.
opts - Map with :url, :path, or :content.
Returns: ElementHandle or anomaly map.
Adds a style tag to the page. Params: `page` - Page instance. `opts` - Map with :url, :path, or :content. Returns: ElementHandle or anomaly map.
(bring-to-front page)Brings page to front (activates tab).
Params:
page - Page instance.
Brings page to front (activates tab). Params: `page` - Page instance.
(clock-fast-forward! clock ticks)Fast-forwards the clock by the given time.
Params:
clock - Clock instance.
ticks - Long. Time to advance in ms.
Fast-forwards the clock by the given time. Params: `clock` - Clock instance. `ticks` - Long. Time to advance in ms.
(clock-install! clock)Installs fake timers on the clock.
Params:
clock - Clock instance.
Installs fake timers on the clock. Params: `clock` - Clock instance.
(clock-pause-at! clock time)Pauses the clock at the given time.
Params:
clock - Clock instance.
time - Long. Unix timestamp in ms.
Pauses the clock at the given time. Params: `clock` - Clock instance. `time` - Long. Unix timestamp in ms.
(clock-resume! clock)Resumes the clock.
Params:
clock - Clock instance.
Resumes the clock. Params: `clock` - Clock instance.
(clock-set-fixed-time! clock time)Sets the clock to a fixed time.
Params:
clock - Clock instance.
time - Long. Unix timestamp in ms.
Sets the clock to a fixed time. Params: `clock` - Clock instance. `time` - Long. Unix timestamp in ms.
(clock-set-system-time! clock time)Sets the system time.
Params:
clock - Clock instance.
time - Long. Unix timestamp in ms.
Sets the system time. Params: `clock` - Clock instance. `time` - Long. Unix timestamp in ms.
(console-args msg)Returns the console message arguments as JSHandles.
Params:
msg - ConsoleMessage instance.
Returns: Vector of JSHandle.
Returns the console message arguments as JSHandles. Params: `msg` - ConsoleMessage instance. Returns: Vector of JSHandle.
(console-location msg)Returns the source location of the console message.
Params:
msg - ConsoleMessage instance.
Returns: String. The location string.
Returns the source location of the console message. Params: `msg` - ConsoleMessage instance. Returns: String. The location string.
(console-page msg)Returns the page the console message belongs to.
Params:
msg - ConsoleMessage instance.
Returns: Page instance.
Returns the page the console message belongs to. Params: `msg` - ConsoleMessage instance. Returns: Page instance.
(console-text msg)Returns the console message text.
Params:
msg - ConsoleMessage instance.
Returns: String.
Returns the console message text. Params: `msg` - ConsoleMessage instance. Returns: String.
(console-type msg)Returns the console message type (log, debug, info, error, warning, etc).
Params:
msg - ConsoleMessage instance.
Returns: String.
Returns the console message type (log, debug, info, error, warning, etc). Params: `msg` - ConsoleMessage instance. Returns: String.
(content page)Returns the full HTML content of the page.
Params:
page - Page instance.
Returns: String. HTML content.
Returns the full HTML content of the page. Params: `page` - Page instance. Returns: String. HTML content.
(dialog-accept! dialog)(dialog-accept! dialog prompt-text)Accepts the dialog.
Params:
dialog - Dialog instance.
prompt-text - String, optional. Text for prompt dialogs.
Accepts the dialog. Params: `dialog` - Dialog instance. `prompt-text` - String, optional. Text for prompt dialogs.
(dialog-default-value dialog)Returns the default value for prompt dialogs.
Params:
dialog - Dialog instance.
Returns: String.
Returns the default value for prompt dialogs. Params: `dialog` - Dialog instance. Returns: String.
(dialog-dismiss! dialog)Dismisses the dialog.
Params:
dialog - Dialog instance.
Dismisses the dialog. Params: `dialog` - Dialog instance.
(dialog-message dialog)Returns the dialog message.
Params:
dialog - Dialog instance.
Returns: String.
Returns the dialog message. Params: `dialog` - Dialog instance. Returns: String.
(dialog-type dialog)Returns the dialog type (alert, confirm, prompt, beforeunload).
Params:
dialog - Dialog instance.
Returns: String.
Returns the dialog type (alert, confirm, prompt, beforeunload). Params: `dialog` - Dialog instance. Returns: String.
(download-cancel! download)Cancels the download.
Params:
download - Download instance.
Cancels the download. Params: `download` - Download instance.
(download-failure download)Returns the download failure reason, or nil.
Params:
download - Download instance.
Returns: String or nil.
Returns the download failure reason, or nil. Params: `download` - Download instance. Returns: String or nil.
(download-page download)Returns the page the download belongs to.
Params:
download - Download instance.
Returns: Page instance.
Returns the page the download belongs to. Params: `download` - Download instance. Returns: Page instance.
(download-path download)Returns the local path to the downloaded file.
Params:
download - Download instance.
Returns: Path or nil.
Returns the local path to the downloaded file. Params: `download` - Download instance. Returns: Path or nil.
(download-save-as! download path)Saves the download to the given path.
Params:
download - Download instance.
path - String. Destination path.
Saves the download to the given path. Params: `download` - Download instance. `path` - String. Destination path.
(download-suggested-filename download)Returns the suggested filename.
Params:
download - Download instance.
Returns: String.
Returns the suggested filename. Params: `download` - Download instance. Returns: String.
(download-url download)Returns the download URL.
Params:
download - Download instance.
Returns: String.
Returns the download URL. Params: `download` - Download instance. Returns: String.
(emulate-media! page media-opts)Emulates media type and features.
Params:
page - Page instance.
opts - Map. Emulate media options.
Emulates media type and features. Params: `page` - Page instance. `opts` - Map. Emulate media options.
(evaluate page expression)(evaluate page expression arg)Evaluates JavaScript expression in the page context.
Params:
page - Page instance.
expression - String. JavaScript expression.
arg - Optional. Argument to pass to the expression.
Returns: Result of JavaScript evaluation or anomaly map on failure.
Evaluates JavaScript expression in the page context. Params: `page` - Page instance. `expression` - String. JavaScript expression. `arg` - Optional. Argument to pass to the expression. Returns: Result of JavaScript evaluation or anomaly map on failure.
(evaluate-handle page expression)(evaluate-handle page expression arg)Like evaluate, but returns a JSHandle.
Params:
page - Page instance.
expression - String. JavaScript expression.
arg - Optional. Argument.
Returns: JSHandle or anomaly map.
Like evaluate, but returns a JSHandle. Params: `page` - Page instance. `expression` - String. JavaScript expression. `arg` - Optional. Argument. Returns: JSHandle or anomaly map.
(expose-binding! page name f)Exposes a Clojure function as a binding.
Params:
page - Page instance.
name - String. Binding name.
fn - Function. The binding function.
Exposes a Clojure function as a binding. Params: `page` - Page instance. `name` - String. Binding name. `fn` - Function. The binding function.
(expose-function! page name f)Exposes a Clojure function to JavaScript.
Params:
page - Page instance.
name - String. Function name in JavaScript.
fn - Function. The Clojure function to expose.
Exposes a Clojure function to JavaScript. Params: `page` - Page instance. `name` - String. Function name in JavaScript. `fn` - Function. The Clojure function to expose.
(file-chooser-element fc)Returns the element handle for the file input.
Params:
fc - FileChooser instance.
Returns: ElementHandle.
Returns the element handle for the file input. Params: `fc` - FileChooser instance. Returns: ElementHandle.
(file-chooser-is-multiple? fc)Returns whether the file chooser accepts multiple files.
Params:
fc - FileChooser instance.
Returns: Boolean.
Returns whether the file chooser accepts multiple files. Params: `fc` - FileChooser instance. Returns: Boolean.
(file-chooser-page fc)Returns the page the file chooser belongs to.
Params:
fc - FileChooser instance.
Returns: Page instance.
Returns the page the file chooser belongs to. Params: `fc` - FileChooser instance. Returns: Page instance.
(file-chooser-set-files! fc files)Sets the files for the file chooser.
Params:
fc - FileChooser instance.
files - String path or vector of paths.
Sets the files for the file chooser. Params: `fc` - FileChooser instance. `files` - String path or vector of paths.
(frame-by-name page name)Returns a frame by its name attribute.
Params:
page - Page instance.
name - String. Frame name.
Returns: Frame or nil.
Returns a frame by its name attribute. Params: `page` - Page instance. `name` - String. Frame name. Returns: Frame or nil.
(frame-by-url page pattern)Returns a frame by matching URL pattern.
Params:
page - Page instance.
pattern - String glob, regex Pattern, or predicate.
Returns: Frame or nil.
Returns a frame by matching URL pattern. Params: `page` - Page instance. `pattern` - String glob, regex Pattern, or predicate. Returns: Frame or nil.
(frames page)Returns all frames in the page.
Params:
page - Page instance.
Returns: Vector of Frame instances.
Returns all frames in the page. Params: `page` - Page instance. Returns: Vector of Frame instances.
(get-by-alt-text page text)Locates elements by alt text.
Params:
page - Page instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by alt text. Params: `page` - Page instance. `text` - String or Pattern. Returns: Locator instance.
(get-by-label page text)Locates elements by their label text.
Params:
page - Page instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by their label text. Params: `page` - Page instance. `text` - String or Pattern. Returns: Locator instance.
(get-by-placeholder page text)Locates elements by placeholder text.
Params:
page - Page instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by placeholder text. Params: `page` - Page instance. `text` - String or Pattern. Returns: Locator instance.
(get-by-role page role)(get-by-role page role opts)Locates elements by their ARIA role.
Params:
page - Page instance.
role - AriaRole enum value.
opts - Map, optional. GetByRoleOptions:
:name - String or Pattern. Accessible name to match.
:exact - Boolean. Exact match for name.
:checked - Boolean. Match checked state.
:disabled - Boolean. Match disabled state.
:expanded - Boolean. Match expanded state.
:include-hidden - Boolean. Include hidden elements.
:level - Integer. Heading level.
:pressed - Boolean. Match pressed state.
:selected - Boolean. Match selected state.
Returns: Locator instance.
Locates elements by their ARIA role.
Params:
`page` - Page instance.
`role` - AriaRole enum value.
`opts` - Map, optional. GetByRoleOptions:
:name - String or Pattern. Accessible name to match.
:exact - Boolean. Exact match for name.
:checked - Boolean. Match checked state.
:disabled - Boolean. Match disabled state.
:expanded - Boolean. Match expanded state.
:include-hidden - Boolean. Include hidden elements.
:level - Integer. Heading level.
:pressed - Boolean. Match pressed state.
:selected - Boolean. Match selected state.
Returns:
Locator instance.(get-by-test-id page test-id)Locates elements by test ID attribute.
Params:
page - Page instance.
test-id - String or Pattern.
Returns: Locator instance.
Locates elements by test ID attribute. Params: `page` - Page instance. `test-id` - String or Pattern. Returns: Locator instance.
(get-by-text page text)Locates elements by their text content.
Params:
page - Page instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by their text content. Params: `page` - Page instance. `text` - String or Pattern. Returns: Locator instance.
(get-by-title page text)Locates elements by title attribute.
Params:
page - Page instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by title attribute. Params: `page` - Page instance. `text` - String or Pattern. Returns: Locator instance.
(go-back page)(go-back page nav-opts)Navigates back in history.
Params:
page - Page instance.
opts - Map, optional. Navigation options.
Returns: Response or nil, or anomaly map on failure.
Navigates back in history. Params: `page` - Page instance. `opts` - Map, optional. Navigation options. Returns: Response or nil, or anomaly map on failure.
(go-forward page)(go-forward page nav-opts)Navigates forward in history.
Params:
page - Page instance.
opts - Map, optional. Navigation options.
Returns: Response or nil, or anomaly map on failure.
Navigates forward in history. Params: `page` - Page instance. `opts` - Map, optional. Navigation options. Returns: Response or nil, or anomaly map on failure.
(is-closed? page)Returns true if the page has been closed.
Params:
page - Page instance.
Returns: Boolean.
Returns true if the page has been closed. Params: `page` - Page instance. Returns: Boolean.
(locator page selector)Creates a Locator for finding elements on the page.
Params:
page - Page instance.
selector - String. CSS or text selector.
Returns: Locator instance.
Creates a Locator for finding elements on the page. Params: `page` - Page instance. `selector` - String. CSS or text selector. Returns: Locator instance.
(main-frame page)Returns the main frame of the page.
Params:
page - Page instance.
Returns: Frame instance.
Returns the main frame of the page. Params: `page` - Page instance. Returns: Frame instance.
(navigate page url)(navigate page url nav-opts)Navigates the page to a URL.
Params:
page - Page instance.
url - String. URL to navigate to.
opts - Map, optional. Navigation options.
Returns: Response or nil, or anomaly map on failure.
Navigates the page to a URL. Params: `page` - Page instance. `url` - String. URL to navigate to. `opts` - Map, optional. Navigation options. Returns: Response or nil, or anomaly map on failure.
(on-close page handler)Registers a handler for page close.
Params:
page - Page instance.
handler - Function called with the page when it closes.
Registers a handler for page close. Params: `page` - Page instance. `handler` - Function called with the page when it closes.
(on-console page handler)Registers a handler for console messages.
Params:
page - Page instance.
handler - Function that receives a ConsoleMessage.
Registers a handler for console messages. Params: `page` - Page instance. `handler` - Function that receives a ConsoleMessage.
(on-dialog page handler)Registers a handler for dialogs.
Params:
page - Page instance.
handler - Function that receives a Dialog.
Registers a handler for dialogs. Params: `page` - Page instance. `handler` - Function that receives a Dialog.
(on-download page handler)Registers a handler for downloads.
Params:
page - Page instance.
handler - Function that receives a Download.
Registers a handler for downloads. Params: `page` - Page instance. `handler` - Function that receives a Download.
(on-page-error page handler)Registers a handler for page errors.
Params:
page - Page instance.
handler - Function that receives an error string.
Registers a handler for page errors. Params: `page` - Page instance. `handler` - Function that receives an error string.
(on-popup page handler)Registers a handler for popup pages.
Params:
page - Page instance.
handler - Function that receives a Page.
Registers a handler for popup pages. Params: `page` - Page instance. `handler` - Function that receives a Page.
(on-request page handler)Registers a handler for requests.
Params:
page - Page instance.
handler - Function that receives a Request.
Registers a handler for requests. Params: `page` - Page instance. `handler` - Function that receives a Request.
(on-response page handler)Registers a handler for responses.
Params:
page - Page instance.
handler - Function that receives a Response.
Registers a handler for responses. Params: `page` - Page instance. `handler` - Function that receives a Response.
(once-dialog page handler)Registers a one-time handler for the next dialog. The handler is automatically removed after the first dialog is handled.
Params:
page - Page instance.
handler - Function that receives a Dialog.
Registers a one-time handler for the next dialog. The handler is automatically removed after the first dialog is handled. Params: `page` - Page instance. `handler` - Function that receives a Dialog.
(opener page)Returns the opener page, if any.
Params:
page - Page instance.
Returns: Page or nil.
Returns the opener page, if any. Params: `page` - Page instance. Returns: Page or nil.
(page-clock page)Returns the Clock for a page.
Params:
page - Page instance.
Returns: Clock instance.
Returns the Clock for a page. Params: `page` - Page instance. Returns: Clock instance.
(page-context page)Returns the BrowserContext that the page belongs to.
Params:
page - Page instance.
Returns: BrowserContext instance.
Returns the BrowserContext that the page belongs to. Params: `page` - Page instance. Returns: BrowserContext instance.
(page-keyboard page)Returns the Keyboard for this page.
Params:
page - Page instance.
Returns: Keyboard instance.
Returns the Keyboard for this page. Params: `page` - Page instance. Returns: Keyboard instance.
(page-mouse page)Returns the Mouse for this page.
Params:
page - Page instance.
Returns: Mouse instance.
Returns the Mouse for this page. Params: `page` - Page instance. Returns: Mouse instance.
(page-touchscreen page)Returns the Touchscreen for this page.
Params:
page - Page instance.
Returns: Touchscreen instance.
Returns the Touchscreen for this page. Params: `page` - Page instance. Returns: Touchscreen instance.
(pdf page)(pdf page pdf-opts)Generates a PDF of the page. Only works in Chromium headless.
Params:
page - Page instance.
opts - Map, optional. PDF options.
Returns: byte[] of the PDF data, or anomaly map on failure.
Generates a PDF of the page. Only works in Chromium headless. Params: `page` - Page instance. `opts` - Map, optional. PDF options. Returns: byte[] of the PDF data, or anomaly map on failure.
(reload page)(reload page nav-opts)Reloads the page.
Params:
page - Page instance.
opts - Map, optional. Reload options.
Returns: Response or nil, or anomaly map on failure.
Reloads the page. Params: `page` - Page instance. `opts` - Map, optional. Reload options. Returns: Response or nil, or anomaly map on failure.
(route! page pattern handler)Registers a route handler for URL pattern.
Params:
page - Page instance.
pattern - String glob or regex Pattern.
handler - Function that receives a Route.
Registers a route handler for URL pattern. Params: `page` - Page instance. `pattern` - String glob or regex Pattern. `handler` - Function that receives a Route.
(route-from-har! page har)(route-from-har! page har route-opts)Routes requests from a HAR file. Replays recorded responses for matching requests.
Use with :update true to record actual responses into the HAR for later replay.
Params:
page - Page instance.
har - String. Path to the HAR file.
opts - Map, optional. RouteFromHAR options:
:url - String glob or regex Pattern. Only intercept matching URLs.
:not-found - Keyword. :abort or :fallback.
:update - Boolean. Whether to update HAR with actual network data.
:update-content - Keyword. :embed or :attach.
:update-mode - Keyword. :full or :minimal.
Routes requests from a HAR file. Replays recorded responses for matching requests.
Use with :update true to record actual responses into the HAR for later replay.
Params:
`page` - Page instance.
`har` - String. Path to the HAR file.
`opts` - Map, optional. RouteFromHAR options:
:url - String glob or regex Pattern. Only intercept matching URLs.
:not-found - Keyword. :abort or :fallback.
:update - Boolean. Whether to update HAR with actual network data.
:update-content - Keyword. :embed or :attach.
:update-mode - Keyword. :full or :minimal.(route-web-socket! page pattern handler)Registers a handler for WebSocket connections matching a URL pattern.
The handler receives a WebSocketRoute that can be used to mock the WebSocket connection (send messages, intercept client messages, etc.).
Params:
page - Page instance.
pattern - String glob, regex Pattern, or predicate fn.
handler - Function that receives a WebSocketRoute.
Registers a handler for WebSocket connections matching a URL pattern. The handler receives a WebSocketRoute that can be used to mock the WebSocket connection (send messages, intercept client messages, etc.). Params: `page` - Page instance. `pattern` - String glob, regex Pattern, or predicate fn. `handler` - Function that receives a WebSocketRoute.
(screenshot page)(screenshot page ss-opts)Takes a screenshot of the page.
Params:
page - Page instance.
opts - Map, optional. Screenshot options.
Returns: byte[] of the image data, or anomaly map on failure.
Takes a screenshot of the page. Params: `page` - Page instance. `opts` - Map, optional. Screenshot options. Returns: byte[] of the image data, or anomaly map on failure.
(set-content! page html)(set-content! page html set-opts)Sets the HTML content of the page.
Params:
page - Page instance.
html - String. HTML content.
opts - Map, optional. Options.
Sets the HTML content of the page. Params: `page` - Page instance. `html` - String. HTML content. `opts` - Map, optional. Options.
(set-default-navigation-timeout! page timeout)Sets the default navigation timeout.
Params:
page - Page instance.
timeout - Double. Timeout in milliseconds.
Sets the default navigation timeout. Params: `page` - Page instance. `timeout` - Double. Timeout in milliseconds.
(set-default-timeout! page timeout)Sets the default timeout for page operations.
Params:
page - Page instance.
timeout - Double. Timeout in milliseconds.
Sets the default timeout for page operations. Params: `page` - Page instance. `timeout` - Double. Timeout in milliseconds.
(set-extra-http-headers! page headers)Sets extra HTTP headers for all requests on this page.
Params:
page - Page instance.
headers - Map of string->string.
Sets extra HTTP headers for all requests on this page. Params: `page` - Page instance. `headers` - Map of string->string.
(set-viewport-size! page width height)Sets the viewport size.
Params:
page - Page instance.
width - Long. Width in pixels.
height - Long. Height in pixels.
Sets the viewport size. Params: `page` - Page instance. `width` - Long. Width in pixels. `height` - Long. Height in pixels.
(title page)Returns the page title.
Params:
page - Page instance.
Returns: String.
Returns the page title. Params: `page` - Page instance. Returns: String.
(unroute! page pattern)Removes a route handler.
Params:
page - Page instance.
pattern - String glob or regex Pattern.
Removes a route handler. Params: `page` - Page instance. `pattern` - String glob or regex Pattern.
(url page)Returns the current page URL.
Params:
page - Page instance.
Returns: String.
Returns the current page URL. Params: `page` - Page instance. Returns: String.
(video page)Returns the Video for this page, if recording.
Params:
page - Page instance.
Returns: Video or nil.
Returns the Video for this page, if recording. Params: `page` - Page instance. Returns: Video or nil.
(viewport-size page)Returns the viewport size of the page.
Params:
page - Page instance.
Returns: Map with :width and :height, or nil.
Returns the viewport size of the page. Params: `page` - Page instance. Returns: Map with :width and :height, or nil.
(wait-for-download page action)(wait-for-download page action opts)Waits for a download to start while executing action.
Params:
page - Page instance.
action - No-arg function that triggers the download.
opts - Optional map. {:predicate fn, :timeout ms}
Returns: Download or anomaly map on timeout.
Waits for a download to start while executing `action`.
Params:
`page` - Page instance.
`action` - No-arg function that triggers the download.
`opts` - Optional map. {:predicate fn, :timeout ms}
Returns:
Download or anomaly map on timeout.(wait-for-file-chooser page action)(wait-for-file-chooser page action opts)Waits for a file chooser dialog while executing action.
Params:
page - Page instance.
action - No-arg function that triggers the file chooser (e.g. clicking an input).
opts - Optional map. {:predicate fn, :timeout ms}
Returns: FileChooser or anomaly map on timeout.
Example: (let [fc (page/wait-for-file-chooser pg #(locator/click (page/locator pg "input[type=file]")))] (page/file-chooser-set-files! fc "/path/to/file.txt"))
Waits for a file chooser dialog while executing `action`.
Params:
`page` - Page instance.
`action` - No-arg function that triggers the file chooser (e.g. clicking an input).
`opts` - Optional map. {:predicate fn, :timeout ms}
Returns:
FileChooser or anomaly map on timeout.
Example:
(let [fc (page/wait-for-file-chooser pg
#(locator/click (page/locator pg "input[type=file]")))]
(page/file-chooser-set-files! fc "/path/to/file.txt"))(wait-for-function page expression)Waits for a JavaScript function to return a truthy value.
Params:
page - Page instance.
expression - String. JavaScript expression.
Returns: JSHandle or anomaly map on timeout.
Waits for a JavaScript function to return a truthy value. Params: `page` - Page instance. `expression` - String. JavaScript expression. Returns: JSHandle or anomaly map on timeout.
(wait-for-load-state page)(wait-for-load-state page state)Waits for the page to reach a load state.
Params:
page - Page instance.
state - Keyword, optional. :load :domcontentloaded :networkidle.
Returns: nil or anomaly map on timeout.
Waits for the page to reach a load state. Params: `page` - Page instance. `state` - Keyword, optional. :load :domcontentloaded :networkidle. Returns: nil or anomaly map on timeout.
(wait-for-popup page action)(wait-for-popup page action opts)Waits for a popup page to open while executing action.
Params:
page - Page instance.
action - No-arg function that triggers the popup.
opts - Optional map. {:predicate fn, :timeout ms}
Returns: Page (the popup) or anomaly map on timeout.
Waits for a popup page to open while executing `action`.
Params:
`page` - Page instance.
`action` - No-arg function that triggers the popup.
`opts` - Optional map. {:predicate fn, :timeout ms}
Returns:
Page (the popup) or anomaly map on timeout.(wait-for-response page url-or-fn callback)Waits for a response matching the URL or predicate.
Params:
page - Page instance.
url-or-fn - String or predicate fn.
callback - Runnable to trigger the response.
Returns: Response or anomaly map on timeout.
Waits for a response matching the URL or predicate. Params: `page` - Page instance. `url-or-fn` - String or predicate fn. `callback` - Runnable to trigger the response. Returns: Response or anomaly map on timeout.
(wait-for-selector page selector)(wait-for-selector page selector wait-opts)Waits for a selector to satisfy a condition.
Params:
page - Page instance.
selector - String. CSS selector.
opts - Map, optional. Wait options.
Returns: ElementHandle or nil, or anomaly map on timeout.
Waits for a selector to satisfy a condition. Params: `page` - Page instance. `selector` - String. CSS selector. `opts` - Map, optional. Wait options. Returns: ElementHandle or nil, or anomaly map on timeout.
(wait-for-timeout page timeout)Waits for the specified time in milliseconds.
Params:
page - Page instance.
timeout - Double. Time to wait in ms.
Waits for the specified time in milliseconds. Params: `page` - Page instance. `timeout` - Double. Time to wait in ms.
(wait-for-url page url)Waits for the page to navigate to a URL.
Params:
page - Page instance.
url - String glob, regex Pattern, or predicate.
Waits for the page to navigate to a URL. Params: `page` - Page instance. `url` - String glob, regex Pattern, or predicate.
(web-error-error we)Returns the underlying error for this web error.
Params:
we - WebError instance.
Returns: String. The error message.
Returns the underlying error for this web error. Params: `we` - WebError instance. Returns: String. The error message.
(web-error-page we)Returns the page that generated this web error, if any.
Params:
we - WebError instance.
Returns: Page instance or nil.
Returns the page that generated this web error, if any. Params: `we` - WebError instance. Returns: Page instance or nil.
(worker-evaluate worker expression)(worker-evaluate worker expression arg)Evaluates JavaScript in the worker context.
Params:
worker - Worker instance.
expression - String.
arg - Optional argument.
Returns: Result or anomaly map.
Evaluates JavaScript in the worker context. Params: `worker` - Worker instance. `expression` - String. `arg` - Optional argument. Returns: Result or anomaly map.
(worker-url worker)Returns the worker URL.
Params:
worker - Worker instance.
Returns: String.
Returns the worker URL. Params: `worker` - Worker instance. Returns: String.
(workers page)Returns all workers in the page.
Params:
page - Page instance.
Returns: Vector of Worker instances.
Returns all workers in the page. Params: `page` - Page instance. Returns: Vector of Worker instances.
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 |