|
6 | 6 | import asyncio |
7 | 7 | import json |
8 | 8 |
|
9 | | -from textual.widgets import Footer, Select |
| 9 | +from textual.widgets import Footer, Input, Select |
10 | 10 |
|
11 | 11 | from tests.conftest import ENTRYPOINT_NUMBERS |
12 | 12 | from uipath.dev.ui.panels import NewRunPanel, RunDetailsPanel, RunHistoryPanel |
@@ -171,3 +171,33 @@ async def test_new_run_button(app): |
171 | 171 |
|
172 | 172 | assert "hidden" not in new_panel.classes |
173 | 173 | assert "hidden" in details.classes |
| 174 | + |
| 175 | + |
| 176 | +async def test_chat_mode_greeting(app): |
| 177 | + """Start a chat run, send a message, verify it completes without timeout.""" |
| 178 | + async with app.run_test() as pilot: |
| 179 | + await _wait_for_entrypoint(app) |
| 180 | + await pilot.pause() |
| 181 | + |
| 182 | + # Set valid JSON input (required for run creation) |
| 183 | + json_input = app.query_one("#json-input", JsonInput) |
| 184 | + json_input.text = json.dumps({"name": "Tester"}) |
| 185 | + await pilot.pause() |
| 186 | + |
| 187 | + # Click the Chat button to start a chat-mode run |
| 188 | + await pilot.click("#chat-btn") |
| 189 | + await pilot.pause() |
| 190 | + |
| 191 | + # Details panel should be visible with chat input focused |
| 192 | + details_panel = app.query_one("#details-panel", RunDetailsPanel) |
| 193 | + chat_input = details_panel.query_one("#chat-input", Input) |
| 194 | + |
| 195 | + # Type a message and submit |
| 196 | + chat_input.value = "Hello there" |
| 197 | + await pilot.press("enter") |
| 198 | + |
| 199 | + # Wait for the run to complete (would timeout at 60s if auto-resume is broken) |
| 200 | + run = await _wait_for_status(app, "completed") |
| 201 | + |
| 202 | + assert run.output_data is not None |
| 203 | + assert "greeting" in run.output_data |
0 commit comments