-
Notifications
You must be signed in to change notification settings - Fork 4k
[refactor] Improve chat input test organization with query parameter navigation #13055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
| v3 = st.container().chat_input( | ||
| "Chat input 3 (callback)", key="chat_input_3", on_submit=on_submit | ||
| if key is None or key == "width_300": | ||
| width_300_value = st.container().chat_input( |
| st.session_state["chat_input_3"], | ||
|
|
||
| if key is None or key == "width_stretch": | ||
| width_stretch_value = st.container().chat_input( |
1226891 to
9be2bb9
Compare
9be2bb9 to
ee934a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the st_chat_input E2E test infrastructure to use query parameters for selective rendering of chat inputs, improving test isolation and organization. The changes replace rendering all chat inputs simultaneously with a query parameter-based approach that displays only one chat input at a time.
Key Changes
- Added query parameter system (
?key=<chat_input_key>) for selective chat input display - Renamed chat input keys from generic names (e.g.,
chat_input_11) to descriptive names (e.g.,audio_with_files) - Updated output formatting pattern from
key value:tokey - value: - Introduced
use_chat_input()decorator andgoto_chat_input()helper for streamlined test navigation - Updated all 40+ test functions to use the new navigation pattern
Reviewed Changes
Copilot reviewed 2 out of 150 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
e2e_playwright/st_chat_input.py |
Refactored test app to conditionally render chat inputs based on query parameter; renamed keys to be descriptive; updated output formatting |
e2e_playwright/st_chat_input_test.py |
Added navigation utilities (use_chat_input decorator, goto_chat_input helper); updated helper functions to use new output format; applied decorator to all test functions |
e2e_playwright/__snapshots__/**/*.png |
Updated snapshot files reflecting the new test isolation approach (all new files) |
ee934a3 to
b81a1f2
Compare
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
b81a1f2 to
c734cbd
Compare

Describe your changes
Refactored the
st_chat_input.pytest app to use query parameters for displaying specific chat inputs. This improves test isolation by allowing tests to focus on a single chat input at a time, rather than rendering all inputs simultaneously. The changes include:use_chat_inputdecorator andgoto_chat_inputhelper function to simplify test navigationScreenshot or video (only for visual changes)
No visual changes to the component itself, only test infrastructure improvements.
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.