-
Notifications
You must be signed in to change notification settings - Fork 339
Test our JavaScript with Playwright #585
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
Comments
It would indeed be very good to have such testing. I don't have any experience with this, so if playwright seems a good solution for this, that sounds good to me |
It is at least what most people on Twitter recommended :-) |
I agree this would be an improvement! |
nowadays we use Playwright in our a11y tests, and we've discussed (here and following comments) expanding playwright to testing other aspects of the site too. So I think this can be closed. |
Description
Currently, we only test things that can be statically-generated by Python, using
pytest
.However, a lot of the functionality in this theme comes from JavaScript, which we cannot test simply by looking at the statically-generated HTML files. We currently do not test for interactive things like the dropdown switcher, which makes us more likely to miss regressions and bugs.
Proposed solution
We should investigate using the playwright pytest plugin to do basic "live behavior" testing of important aspects of the theme.
playwright
can install its own bundled version ofchromium
and is very well supported.Here's an example of their pytest plugin in-action from their docs:
I think we'd have access to anything in the
page
object. So for example we could check the inner HTML of a page after it was loaded inchromium
. This could let us test for things in a more reliable fashion.The text was updated successfully, but these errors were encountered: