Fluffy.Event (Fluffy v0.7.0)

Copy Markdown View Source

Event descriptions shared by waits and listeners.

Constructors accept an optional unary predicate. A false or nil result skips the event. Predicates inspect event metadata; use ordinary assertions on the awaited value to check its contents.

Download events support both backends. Other events require Playwright. Request and response registrations accept scope: :page (the default) or scope: :context. Page events observe the context; all other events observe the page selected when registering.

Summary

Functions

Describes a dialog event, optionally filtered by a unary predicate.

Describes a download event, optionally filtered by a unary predicate.

Describes a file_chooser event, optionally filtered by a unary predicate.

Describes a frame_navigated event, optionally filtered by a unary predicate.

Describes a page event, optionally filtered by a unary predicate.

Describes a popup event, optionally filtered by a unary predicate.

Describes a request event, optionally filtered by a unary predicate.

Describes a response event, optionally filtered by a unary predicate.

Types

option()

@type option() :: {:timeout, non_neg_integer()} | {:scope, :page | :context}

t()

@type t() :: %Fluffy.Event{predicate: (term() -> term()) | nil, type: type()}

type()

@type type() ::
  :download
  | :popup
  | :page
  | :frame_navigated
  | :dialog
  | :file_chooser
  | :request
  | :response

Functions

dialog(predicate \\ nil)

(Playwright only)
@spec dialog((term() -> term()) | nil) :: t()

Describes a dialog event, optionally filtered by a unary predicate.

download(predicate \\ nil)

@spec download((term() -> term()) | nil) :: t()

Describes a download event, optionally filtered by a unary predicate.

file_chooser(predicate \\ nil)

(Playwright only)
@spec file_chooser((term() -> term()) | nil) :: t()

Describes a file_chooser event, optionally filtered by a unary predicate.

frame_navigated(predicate \\ nil)

(Playwright only)
@spec frame_navigated((term() -> term()) | nil) :: t()

Describes a frame_navigated event, optionally filtered by a unary predicate.

page(predicate \\ nil)

(Playwright only)
@spec page((term() -> term()) | nil) :: t()

Describes a page event, optionally filtered by a unary predicate.

popup(predicate \\ nil)

(Playwright only)
@spec popup((term() -> term()) | nil) :: t()

Describes a popup event, optionally filtered by a unary predicate.

request(predicate \\ nil)

(Playwright only)
@spec request((term() -> term()) | nil) :: t()

Describes a request event, optionally filtered by a unary predicate.

response(predicate \\ nil)

(Playwright only)
@spec response((term() -> term()) | nil) :: t()

Describes a response event, optionally filtered by a unary predicate.