Fluffy.Dialog (Fluffy v0.7.0)

Copy Markdown View Source

A browser dialog delivered to event listeners and waits.

Register a listener before the triggering action, assert on its metadata, then accept or dismiss it. An unresolved dialog blocks browser actions. A wait only observes the dialog; it does not handle it. With no dialog registrations, Playwright dismisses dialogs automatically.

Summary

Functions

Accepts the dialog, optionally supplying prompt text.

Dismisses the dialog.

Types

t()

@type t() :: %Fluffy.Dialog{
  connection: GenServer.server(),
  default_value: String.t(),
  id: String.t(),
  message: String.t(),
  timeout: non_neg_integer(),
  type: :alert | :confirm | :prompt | :beforeunload
}

Functions

accept(dialog, prompt_text \\ nil)

@spec accept(t(), String.t() | nil) :: :ok

Accepts the dialog, optionally supplying prompt text.

dismiss(dialog)

@spec dismiss(t()) :: :ok

Dismisses the dialog.