PlaywrightEx.Dialog (PlaywrightEx v0.6.0)

Copy Markdown View Source

Interact with a Playwright Dialog.

There is no official documentation, since this is considered Playwright internal.

Reference: https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/client/dialog.ts

Summary

Functions

Returns when the dialog has been accepted.

Returns when the dialog has been dismissed.

Types

accept_opt()

@type accept_opt() ::
  {:connection, GenServer.name()}
  | {:timeout, timeout()}
  | {:prompt_text, binary()}

dismiss_opt()

@type dismiss_opt() :: {:connection, GenServer.name()} | {:timeout, timeout()}

guid()

@type guid() :: String.t()

Functions

accept(dialog_id, opts \\ [])

@spec accept(PlaywrightEx.guid(), [accept_opt() | PlaywrightEx.unknown_opt()]) ::
  {:ok, any()} | {:error, any()}

Returns when the dialog has been accepted.

Reference: https://playwright.dev/docs/api/class-dialog#dialog-accept

Options

  • :connection (term/0) - The Connection process name. Defaults to PlaywrightEx.Supervisor.Connection. The default value is PlaywrightEx.Supervisor.Connection.

  • :timeout (timeout/0) - Required. Maximum time for the operation (milliseconds).

  • :prompt_text (String.t/0) - A text to enter in prompt. Does not cause any effects if the dialog's type is not prompt.

dismiss(dialog_id, opts \\ [])

@spec dismiss(PlaywrightEx.guid(), [dismiss_opt() | PlaywrightEx.unknown_opt()]) ::
  {:ok, any()} | {:error, any()}

Returns when the dialog has been dismissed.

Reference: https://playwright.dev/docs/api/class-dialog#dialog-dismiss

Options

  • :connection (term/0) - The Connection process name. Defaults to PlaywrightEx.Supervisor.Connection. The default value is PlaywrightEx.Supervisor.Connection.

  • :timeout (timeout/0) - Required. Maximum time for the operation (milliseconds).