playwright.controller.Toast

playwright.controller.Toast(page, id)

Controller for shiny.express.ui.toast.

Toast notifications are temporary, non-intrusive messages that appear on screen.

Attributes

Name Description
expect Expectation method equivalent to playwright.expect(self.loc).
id The browser DOM id of the UI element.
loc Playwright Locator for the toast element.
loc_body Playwright Locator for the toast body content.
loc_header Playwright Locator for the toast header.
page Playwright Page of the Shiny app.

Methods

Name Description
expect_autohide Expects the toast to have the specified autohide setting.
expect_body Expects the toast body to have the specified text.
expect_header Expects the toast header to have the specified text.
expect_hidden Expects the toast to be hidden.
expect_position Expects the toast’s container to be in the specified position.
expect_type Expects the toast to have the specified type class.
expect_visible Expects the toast to be visible.

expect_autohide

playwright.controller.Toast.expect_autohide(value, *, timeout=None)

Expects the toast to have the specified autohide setting.

Parameters

Name Type Description Default
value bool True if autohide is expected to be enabled, False otherwise. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_body

playwright.controller.Toast.expect_body(value, *, timeout=None)

Expects the toast body to have the specified text.

Parameters

Name Type Description Default
value PatternOrStr The expected text pattern or string. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_header

playwright.controller.Toast.expect_header(value, *, timeout=None)

Expects the toast header to have the specified text.

Parameters

Name Type Description Default
value PatternOrStr The expected text pattern or string. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_hidden

playwright.controller.Toast.expect_hidden(timeout=None)

Expects the toast to be hidden.

Parameters

Name Type Description Default
timeout Timeout The maximum time to wait for the toast to be hidden. Defaults to None. None

expect_position

playwright.controller.Toast.expect_position(value, *, timeout=None)

Expects the toast's container to be in the specified position.

Parameters

Name Type Description Default
value str The expected position (e.g., “top-left”, “bottom-right”). required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_type

playwright.controller.Toast.expect_type(value, *, timeout=None)

Expects the toast to have the specified type class.

Parameters

Name Type Description Default
value ToastType The expected type (e.g., “success”, “danger”, “info”, “warning”). required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_visible

playwright.controller.Toast.expect_visible(timeout=None)

Expects the toast to be visible.

Parameters

Name Type Description Default
timeout Timeout The maximum time to wait for the toast to be visible. Defaults to None. None