playwright.ChatController
playwright.ChatController(page, id)Controller for :func:shiny.ui.chat.
Attributes
| Name | Description |
|---|---|
| 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. |
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
playwright.ChatController.expect_latest_message(value, *, timeout=None)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
playwright.ChatController.expect_messages(value, *, timeout=None)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
playwright.ChatController.expect_user_input(value, *, timeout=None)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
playwright.ChatController.send_user_input(method='enter', timeout=None)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
playwright.ChatController.set_user_input(value, *, timeout=None)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 |