playwright.controller.Card

playwright.controller.Card(self, page, id)

Controller for shiny.express.ui.card.

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 card’s value.
loc_body Playwright Locator for the card body.
loc_container Playwright Locator for the card container.
loc_footer Playwright Locator for the card footer.
loc_title Playwright Locator for the card title.
page Playwright Page of the Shiny app.

Methods

Name Description
expect_body Expect the card body element to have the specified text.
expect_footer Expects the card footer to have a specific text.
expect_full_screen Verifies if the full screen mode is currently open.
expect_full_screen_available Expects whether full screen mode is available for the element.
expect_header Expects the card header to have a specific text.
expect_height Expects the card to have a specific height.
expect_max_height Expects the card to have a specific maximum height.
expect_min_height Expects the card to have a specific minimum height.
expect_width Expect the width attribute of a DOM element to have a specific value.
set_full_screen Sets the element to full screen mode or exits full screen mode.

expect_body

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

Expect the card body element to have the specified text.

Parameters

Name Type Description Default
value PatternOrStr | list[PatternOrStr] The expected text or a list of expected texts. required
timeout Timeout The maximum time to wait for the text to appear. Defaults to None. None

expect_full_screen

playwright.controller.Card.expect_full_screen(value, *, timeout=None)

Verifies if the full screen mode is currently open.

Parameters

Name Type Description Default
value bool True if the item is to be in full screen mode, False otherwise. required
timeout Timeout The maximum time to wait for the verification. Defaults to None. None

expect_full_screen_available

playwright.controller.Card.expect_full_screen_available(value, *, timeout=None)

Expects whether full screen mode is available for the element.

Parameters

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

expect_header

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

Expects the card header to have a specific text.

Parameters

Name Type Description Default
value PatternOrStr | None The expected text pattern or string. Note: None if the header is expected to not exist. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_height

playwright.controller.Card.expect_height(value, *, timeout=None)

Expects the card to have a specific height.

Parameters

Name Type Description Default
value StyleValue The expected height value. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_max_height

playwright.controller.Card.expect_max_height(value, *, timeout=None)

Expects the card to have a specific maximum height.

Parameters

Name Type Description Default
value StyleValue The expected maximum height value. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_min_height

playwright.controller.Card.expect_min_height(value, *, timeout=None)

Expects the card to have a specific minimum height.

Parameters

Name Type Description Default
value StyleValue The expected minimum height value. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_width

playwright.controller.Card.expect_width(value, *, timeout=None)

Expect the width attribute of a DOM element to have a specific value.

Parameters

Name Type Description Default
value AttrValue The expected value of the width attribute. required
timeout Timeout The maximum time to wait for the expectation to be fulfilled. Defaults to None. None

set_full_screen

playwright.controller.Card.set_full_screen(open, *, timeout=None)

Sets the element to full screen mode or exits full screen mode.

Parameters

Name Type Description Default
open bool True to open the element in full screen mode, False to exit full screen mode. required
timeout Timeout The maximum time to wait for the operation to complete. Defaults to None. None