Typed event-wait values and event capture orchestration.
Download events accept:
:timeout(non_neg_integer/0) - Maximum time in milliseconds to wait for the operation. Playwright browser bookkeeping and navigation synchronization use the session timeout separately.:filename- Only capture downloads whose suggested filename matches this exact string or regex.:url- Only capture downloads whose URL matches this absolute string, regex, or URI predicate.:max_bytes(non_neg_integer/0) - Maximum number of response bytes to retain; defaults to 10,000,000.
Dialog events accept:
:timeout(non_neg_integer/0) - Maximum time in milliseconds to wait for the operation. Playwright browser bookkeeping and navigation synchronization use the session timeout separately.:decision(:accept,:dismiss,{:accept, prompt_text}, or a one-argument function) - Accept, dismiss, accept with prompt text, or decide from the captured dialog.:accept(trueorString.t/0) - Compatibility shorthand for accepting, optionally with prompt text.:dismiss(true) - Compatibility shorthand for dismissing the dialog.
File-chooser, popup, navigation, request, and response events accept the shared timeout option:
:timeout(non_neg_integer/0) - Maximum time in milliseconds to wait for the operation. Playwright browser bookkeeping and navigation synchronization use the session timeout separately.
Summary
Functions
Captures the first download matching the optional filename and URL filters.
Captures the browser file chooser opened by the action.
Captures the first document navigation or URL change. HTTP redirects resolve to their final URL and status.
Captures a new page opened by the action. Requires Playwright.
Types
@type dialog_option() :: {:timeout, non_neg_integer()} | {:decision, :accept | :dismiss | {:accept, String.t()} | (Fluffy.Dialog.t() -> :accept | :dismiss | {:accept, String.t()})} | {:accept, true | String.t()} | {:dismiss, true}
@type download_option() :: {:timeout, non_neg_integer()} | {:filename, binary() | struct()} | {:url, binary() | struct() | (term() -> term())} | {:max_bytes, non_neg_integer()}
@type network_option() :: {:timeout, non_neg_integer()} | {:matcher, String.t() | Regex.t() | (term() -> boolean())}
@type option() :: timeout_option() | download_option() | dialog_option() | network_option()
@type timeout_option() :: {:timeout, non_neg_integer()}
@type type() ::
:dialog
| :download
| :file_chooser
| :navigation
| :page
| :request
| :response
Functions
@spec dialog(term(), [dialog_option()]) :: t()
@spec download(term(), [download_option()]) :: t()
Captures the first download matching the optional filename and URL filters.
Playwright uses the session timeout separately to save the captured download.
@spec file_chooser(term(), [timeout_option()]) :: t()
Captures the browser file chooser opened by the action.
@spec popup(term(), [timeout_option()]) :: t()
Captures a new page opened by the action. Requires Playwright.
The session timeout applies separately to initializing the captured page.