-
Notifications
You must be signed in to change notification settings - Fork 27
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
UI tests with Playwright #413
Conversation
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.
Thanks Blake for the PR. One thing that might simplify the setup quite a bit is the usage of our CLI entrypoint directly. Meaning, instead of starting the API and UI yourself, just run
ragna/ragna/deploy/_cli/core.py
Lines 100 to 101 in 0cb205f
@app.command(help="Start the web UI.") | |
def ui( |
directly. I'm not 100% sure this works, but it should.
I will try this and see what happens. I think I initially thought you couldn't snag a typer function like that but maybe I'm wrong. |
@pmeier (cc @pierrotsmnrd) Then, separate issue, clicking on the "start chat" button gives me a pydantic validation error that only shows up in playwright (line 182). I wasn't seeing the issues with the server in previous versions of this PR where I spun up each server separately. Final thought: given that we're expecting the bokeh/fast-api integration soon-ish, does it make sense to punt on some of these issues until that is merged? At least a couple of these roadblocks might solve themselves. |
You've set the timeout to only 5 seconds, which is a little to low. A timeout is there to prevent the test suite to run indefinitely when something goes wrong. Since you have a proper check on when the server is started, I suggest you increase the timeout to something like 30 seconds. Recall that CI machines are small so it might take them 2-3 times to get this server up compared to your local setup.
I've seen these error before when using Chrome / Chromium. That seems to be a bug in With increasing the timeout to 30 seconds everything runs smoothly locally for me. I'll push this change to your branch to see if CI is happy as well. |
@pmeier This is ready for another look. Video from failing playwright tests is now uploaded as an artifact. Waiting half a second before clicking "start conversation" seems to resolve all the failures I was seeing. There's probably some backend thing where the system isn't fully ready for the click yet even though the button exists. I don't feel like this needs to be investigated urgently since real users won't be clicking buttons in less than half a second after the dialog appears. ragna/tests/deploy/ui/test_ui.py Lines 148 to 151 in 855c0d3
|
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.
Good work Blake! A few minor comments, but this already looks pretty good.
@pmeier Done :) |
Co-authored-by: Philip Meier <[email protected]>
Added some tests for the UI with Playwright! Here's a couple decisions I made that could use another gut check or two:
Questions: