playwright.controller.Chat
self, page, id) playwright.controller.Chat(
Controller for shiny.express.ui.chat
.
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 chat. |
loc_input | Playwright Locator for the chat’s |
loc_input_button | Playwright Locator for the chat’s |
loc_input_container | Playwright Locator for the chat input container. |
loc_latest_message | Playwright Locator for the last message in the chat. |
loc_messages | Playwright Locator for the chat messages. |
page | Playwright Page of the Shiny app. |
Methods
Name | Description |
---|---|
expect_latest_message | Expects the last message in the chat. |
expect_messages | Expects the chat messages. |
expect_user_input | Expects the user message in the chat. |
send_user_input | Sends the user message in the chat. |
set_user_input | Sets the user message in the chat. |
expect_latest_message
*, timeout=None) playwright.controller.Chat.expect_latest_message(value,
Expects the last message in the chat.
Parameters
Name | Type | Description | Default |
---|---|---|---|
value | PatternOrStr |
The expected last message. | required |
timeout | Timeout |
The maximum time to wait for the expectation to pass. Defaults to None . |
None |
expect_messages
*, timeout=None) playwright.controller.Chat.expect_messages(value,
Expects the chat messages.
Parameters
Name | Type | Description | Default |
---|---|---|---|
value | PatternOrStr |
The expected messages. | required |
timeout | Timeout |
The maximum time to wait for the expectation to pass. Defaults to None . |
None |
expect_user_input
*, timeout=None) playwright.controller.Chat.expect_user_input(value,
Expects the user message in the chat.
Parameters
Name | Type | Description | Default |
---|---|---|---|
value | PatternOrStr |
The expected user message. | required |
timeout | Timeout |
The maximum time to wait for the expectation to pass. Defaults to None . |
None |
send_user_input
='enter', timeout=None) playwright.controller.Chat.send_user_input(method
Sends the user message in the chat.
Parameters
Name | Type | Description | Default |
---|---|---|---|
method | Literal[‘enter’, ‘click’] | The method to send the user message. Defaults to "enter" . |
'enter' |
timeout | Timeout |
The maximum time to wait for the chat input to be visible and interactable. Defaults to None . |
None |
set_user_input
*, timeout=None) playwright.controller.Chat.set_user_input(value,
Sets the user message in the chat.
Parameters
Name | Type | Description | Default |
---|---|---|---|
value | str | The message to send. | required |
timeout | Timeout |
The maximum time to wait for the chat input to be visible and interactable. Defaults to None . |
None |