playwright.controller.InputSwitch

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

Controller for shiny.express.ui.input_switch.

Attributes

Name Description
expect Expectation method equivalent to playwright.expect(self.loc).
id The browser DOM id of the UI element.
loc Playwright Locator of the UI element.
loc_container Playwright Locator for the container of the UI element.
loc_label Playwright Locator for the label of the UI element.
page Playwright Page of the Shiny app.

Methods

Name Description
expect_checked Expect the input checkbox to be checked.
expect_label Expect the label of the input to have a specific text.
expect_width Expect the width attribute of a input’s container to have a specific value.
set Sets the input checkbox.

expect_checked

playwright.controller.InputSwitch.expect_checked(value, *, timeout=None)

Expect the input checkbox to be checked.

Parameters

value: bool

Whether the input checkbox is checked.

timeout: Timeout = None

The maximum time to wait for the expectation to be fulfilled. Defaults to None.

expect_label

playwright.controller.InputSwitch.expect_label(value, *, timeout=None)

Expect the label of the input to have a specific text.

Parameters

value: PatternOrStr

The expected text value of the label.

timeout: Timeout = None

The maximum time to wait for the expectation to be fulfilled. Defaults to None.

expect_width

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

Expect the width attribute of a input's container to have a specific value.

Parameters

value: AttrValue

The expected value of the width attribute.

timeout: Timeout = None

The maximum time to wait for the expectation to be fulfilled. Defaults to None.

set

playwright.controller.InputSwitch.set(value, *, timeout=None, **kwargs)

Sets the input checkbox.

Parameters

value: bool

The value of the input checkbox.

timeout: Timeout = None

The maximum time to wait for the input checkbox to be set. Defaults to None.