Skip to content

Commit 5e8b373

Browse files
committed
Bring back dynamic UI test; but with messages passed to .ui()
1 parent c9ee59c commit 5e8b373

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from shiny.express import render, ui
2+
3+
chat = ui.Chat(id="chat")
4+
5+
6+
@render.ui
7+
def chat_output():
8+
return chat.ui(messages=["A starting message"])
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from playwright.sync_api import Page, expect
2+
from utils.deploy_utils import skip_on_webkit
3+
4+
from shiny.playwright import controller
5+
from shiny.run import ShinyAppProc
6+
7+
8+
@skip_on_webkit
9+
def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
10+
page.goto(local_app.url)
11+
12+
chat = controller.Chat(page, "chat")
13+
14+
expect(chat.loc).to_be_visible(timeout=30 * 1000)
15+
chat.expect_latest_message("A starting message", timeout=30 * 1000)

0 commit comments

Comments
 (0)