-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Add tabulator UI tests #3633
Add tabulator UI tests #3633
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3633 +/- ##
==========================================
+ Coverage 81.90% 83.55% +1.64%
==========================================
Files 206 207 +1
Lines 28067 29642 +1575
==========================================
+ Hits 22989 24767 +1778
+ Misses 5078 4875 -203
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@maximlt why don't we add env setup for running test with PlayWright in a separate PR and merge it into master? That would be convenient for future PRs that add new UI tests to run on GitHub Actions without duplicating the setup steps from this PR. |
What do you mean by env setup exactly? I should have marked this PR as Draft from the beginning as it's still WIP and I'm currently writing more tests. I should merge it soon though. |
I see. By env setup, I meant the changes to |
Ok I see. I think the changes I've made are just to try to be more explicit in the way the UI tests are setup (e.g. just installing Chromium) but don't actually change anything in how the tests run. I've tried to fix the coverage going down on this PR with |
Yeah I don't think those changes are particularly consequential just saves installing other browsers pointlessly. |
Merging, despite a couple of flaky tests failing as they're not part of the new tests added in this PR. I wouldn't be surprised however to see that this PR introduces more flaky tests... The last runs were pretty robust, I'll watch the test suite over the next runs to see if it uncovers some. |
Starts to address #3631
Very much WIP at this stage, I'm getting used to PlayWright's API and developing a workflow to write these tests.
time.sleep()
wait_until
function that I use after triggering an event on the UI side and waiting for an effect on the Python side, this should be more robust that usingtime.sleep()
.page.locator('text="blabla"')
) as they avoid to have to rely on internal details. Yet they can't always be used.As for my workflow to write these scripts, I combine two approaches. First run a script with
python script.py
that opens a Panel app and the Playwright Inspector that I've found useful to get used to the selectors and to record some actions (it generates the corresponding Python code automatically). Here's an example of the script I use:In the second approach I open a Jupyter Notebook and execute this code:
And this code that makes use of the
async
API offered by Playwright to control the browser.With this second approach I can easily explore Playwright's API.
Writing tests that cover all the behaviors offered by the widget is going to be a lot of work but is also going to be definitively worth it in the long run.