playwright.controller.InputCodeEditor
playwright.controller.InputCodeEditor(page, id)Controller for shiny.express.ui.input_code_editor.
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_editor | Playwright Locator for the inner code editor container. |
| loc_label | Playwright Locator for the label of the UI element. |
| loc_textarea | Playwright Locator for the textarea element. |
| page | Playwright Page of the Shiny app. |
Methods
| Name | Description |
|---|---|
| expect_height | Expect the height style to have a specific value. |
| expect_label | Expect the label of the input to have a specific text. |
| expect_language | Expect the language attribute to have a specific value. |
| expect_line_numbers | Expect the line numbers visibility to have a specific value. |
| expect_read_only | Expect the read-only state to have a specific value. |
| expect_tab_size | Expect the tab size to have a specific value. |
| expect_theme_dark | Expect the dark theme attribute to have a specific value. |
| expect_theme_light | Expect the light theme attribute to have a specific value. |
| expect_value | Expect the value of the code editor to have a specific value. |
| expect_width | Expect the input element to have a specific width. |
| expect_word_wrap | Expect the word wrap state to have a specific value. |
| set | Sets the code value in the editor. |
| submit | Triggers a submit by pressing Ctrl/Cmd+Enter. |
expect_height
playwright.controller.InputCodeEditor.expect_height(value, *, timeout=None)Expect the height style to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | StyleValue |
The expected height value. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_label
playwright.controller.InputCodeEditor.expect_label(value, *, timeout=None)Expect the label of the input to have a specific text.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected text value of the label. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_language
playwright.controller.InputCodeEditor.expect_language(value, *, timeout=None)Expect the language attribute to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected language (e.g., “python”, “r”, “javascript”). | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_line_numbers
playwright.controller.InputCodeEditor.expect_line_numbers(
value,
*,
timeout=None,
)Expect the line numbers visibility to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | bool | Whether line numbers should be shown. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_read_only
playwright.controller.InputCodeEditor.expect_read_only(value, *, timeout=None)Expect the read-only state to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | bool | Whether the editor should be read-only. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_tab_size
playwright.controller.InputCodeEditor.expect_tab_size(value, *, timeout=None)Expect the tab size to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | int | str | The expected tab size. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_theme_dark
playwright.controller.InputCodeEditor.expect_theme_dark(value, *, timeout=None)Expect the dark theme attribute to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected dark theme name. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_theme_light
playwright.controller.InputCodeEditor.expect_theme_light(value, *, timeout=None)Expect the light theme attribute to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected light theme name. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_value
playwright.controller.InputCodeEditor.expect_value(value, *, timeout=None)Expect the value of the code editor to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected value of the code editor. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_width
playwright.controller.InputCodeEditor.expect_width(value, *, timeout=None)Expect the input element to have a specific width.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | AttrValue |
The expected width. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_word_wrap
playwright.controller.InputCodeEditor.expect_word_wrap(value, *, timeout=None)Expect the word wrap state to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | bool | Whether word wrap should be enabled. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
set
playwright.controller.InputCodeEditor.set(value, *, submit=False, timeout=None)Sets the code value in the editor.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | str | The code to set. | required |
| submit | bool | Whether to trigger a submit (Ctrl/Cmd+Enter) after setting the text. Defaults to False. |
False |
| timeout | Timeout |
The maximum time to wait for the text to be set. Defaults to None. |
None |
submit
playwright.controller.InputCodeEditor.submit(timeout=None)Triggers a submit by pressing Ctrl/Cmd+Enter.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| timeout | Timeout |
The maximum time to wait for the submit. Defaults to None. |
None |