playwright.controller.Sidebar
playwright.controller.Sidebar(page, id)Controller for shiny.express.ui.sidebar.
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 sidebar. |
| loc_container | Playwright Locator for the sidebar layout. |
| loc_content | Playwright Locator for the content of the sidebar. |
| loc_handle | Playwright Locator for the open/close handle of the sidebar. |
| loc_position | Playwright Locator for the position of the sidebar. |
| loc_title | Playwright Locator for the title of the sidebar. |
| page | Playwright Page of the Shiny app. |
Methods
| Name | Description |
|---|---|
| expect_bg_color | Asserts that the sidebar has the expected background color. |
| expect_class | Asserts that the sidebar has or does not have a CSS class. |
| expect_desktop_state | Asserts that the sidebar has the expected state on desktop. |
| expect_gap | Asserts that the sidebar has the expected gap. |
| expect_handle | Asserts that the sidebar handle exists or does not exist. |
| expect_mobile_max_height | Asserts that the sidebar has the expected maximum height on mobile. |
| expect_mobile_state | Asserts that the sidebar has the expected state on mobile. |
| expect_open | Expect the sidebar to be open or closed. |
| expect_padding | Asserts that the sidebar has the expected padding. |
| expect_position | Asserts that the sidebar is in the expected position. |
| expect_text | Asserts that the sidebar has the expected text. |
| expect_title | Asserts that the sidebar has the expected title. |
| expect_width | Asserts that the sidebar has the expected width. |
| set | Sets the sidebar to be open or closed. |
expect_bg_color
playwright.controller.Sidebar.expect_bg_color(value, *, timeout=None)Asserts that the sidebar has the expected background color.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected background color of the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the background color to appear. Defaults to None. |
None |
expect_class
playwright.controller.Sidebar.expect_class(
class_name,
*,
has_class=True,
timeout=None,
)Asserts that the sidebar has or does not have a CSS class.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| class_name | str | The CSS class to check for. | required |
| has_class | bool | True if the sidebar should have the CSS class, False otherwise. |
True |
| timeout | Timeout |
The maximum time to wait for the sidebar to appear. Defaults to None. |
None |
expect_desktop_state
playwright.controller.Sidebar.expect_desktop_state(value, *, timeout=None)Asserts that the sidebar has the expected state on desktop.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | Literal[‘open’, ‘closed’, ‘always’] | The expected state of the sidebar on desktop. | required |
| timeout | Timeout |
The maximum time to wait for the state to appear. Defaults to None. |
None |
expect_gap
playwright.controller.Sidebar.expect_gap(value, *, timeout=None)Asserts that the sidebar has the expected gap.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected gap of the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the gap to appear. Defaults to None. |
None |
expect_handle
playwright.controller.Sidebar.expect_handle(exists, *, timeout=None)Asserts that the sidebar handle exists or does not exist.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| exists | bool | True if the sidebar open/close handle should exist, False otherwise. |
required |
| timeout | Timeout |
The maximum time to wait for the sidebar handle to appear. Defaults to None. |
None |
expect_mobile_max_height
playwright.controller.Sidebar.expect_mobile_max_height(value, *, timeout=None)Asserts that the sidebar has the expected maximum height on mobile.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected maximum height of the sidebar on mobile. | required |
| timeout | Timeout |
The maximum time to wait for the maximum height to appear. Defaults to None. |
None |
expect_mobile_state
playwright.controller.Sidebar.expect_mobile_state(value, *, timeout=None)Asserts that the sidebar has the expected state on mobile.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | Literal[‘open’, ‘closed’, ‘always’] | The expected state of the sidebar on mobile. | required |
| timeout | Timeout |
The maximum time to wait for the state to appear. Defaults to None. |
None |
expect_open
playwright.controller.Sidebar.expect_open(value, *, timeout=None)Expect the sidebar to be open or closed.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | bool | True if the sidebar should be open, False to be closed. |
required |
| timeout | Timeout |
The maximum time to wait for the sidebar to open or close. Defaults to None. |
None |
expect_padding
playwright.controller.Sidebar.expect_padding(value, *, timeout=None)Asserts that the sidebar has the expected padding.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | str | list[str] |
The expected padding of the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the padding to appear. Defaults to None. |
None |
expect_position
playwright.controller.Sidebar.expect_position(value, *, timeout=None)Asserts that the sidebar is in the expected position.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | Literal[‘left’, ‘right’] | The expected position of the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the sidebar to appear. Defaults to None. |
None |
expect_text
playwright.controller.Sidebar.expect_text(value, *, timeout=None)Asserts that the sidebar has the expected text.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected text in the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the text to appear. Defaults to None. |
None |
expect_title
playwright.controller.Sidebar.expect_title(value, *, timeout=None)Asserts that the sidebar has the expected title.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected title of the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the title to appear. Defaults to None. |
None |
expect_width
playwright.controller.Sidebar.expect_width(value, *, timeout=None)Asserts that the sidebar has the expected width.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected width of the sidebar. | required |
| timeout | Timeout |
The maximum time to wait for the width to appear. Defaults to None. |
None |
set
playwright.controller.Sidebar.set(open, *, timeout=None)Sets the sidebar to be open or closed.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| open | bool | True to open the sidebar and False to close it. |
required |
| timeout | Timeout |
The maximum time to wait for the sidebar to open or close. Defaults to None. |
None |