Skip to content
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 Playwright tests #39

Open
8 tasks
dantownsend opened this issue Oct 10, 2022 · 5 comments
Open
8 tasks

Add Playwright tests #39

dantownsend opened this issue Oct 10, 2022 · 5 comments
Labels
good first issue Good for newcomers hacktoberfest A good issue for someone contributing to Hacktoberfest.

Comments

@dantownsend
Copy link
Member

dantownsend commented Oct 10, 2022

We use Playwright to test other UI projects in the Piccolo ecosystem (see Piccolo Admin).

Playwright is a E2E / UI testing framework.

Phase 1

Approximate time needed: 1 to 2 hours, depending on existing knowledge of Playwright.

  • Create a new folder called something like e2e.
  • Create requirements/test-requirements.txt, containing Playwright and Pytest.
  • Create a Playwright test (e.g. e2e/test_homepage.py), which performs some simple tests - e.g. loading the homepage, entering something into the search bar, and submitting it.
  • Create scripts/run-tests.sh, which runs pytest.

Phase 2

Can be done in a separate PR.

Approximate time needed is 1 to 2 hours, depending on knowledge of GitHub actions.

  • Run the tests using GitHub actions for a range of Sphinx versions (e.g. v4, v5), and Python versions.
    • Build the static files (cd docs && make html)
    • Have a Pytest fixture like this, which serves the static files. Hint, you should be able to use something like this, as a simple Python static file server.
  • Save screenshots of the tests as build artefacts, so we can quickly check that the theme isn't broken on any Sphinx versions when reviewing a PR.
@dantownsend dantownsend added good first issue Good for newcomers hacktoberfest A good issue for someone contributing to Hacktoberfest. labels Oct 10, 2022
@mikebarr24
Copy link
Contributor

Hey @dantownsend. Would it be OK if I worked on this issue?

@dantownsend
Copy link
Member Author

@mikebarr24 Yes, of course - would be great 👍

@mikebarr24
Copy link
Contributor

@dantownsend Thank you! I'm new to this project and a lot of what I will be doing will be new to me. If you are looking for a fast fix to this, I'm happy to drop this.

Otherwise, I'm looking forward to getting involved!

@dantownsend
Copy link
Member Author

@mikebarr24 There's no pressure - just tackle it in your own time. Hopefully it's an interesting one for you. I find Playwright quite exciting, and am introducing it into all of my projects.

@mikebarr24 mikebarr24 mentioned this issue Oct 16, 2022
@mikebarr24
Copy link
Contributor

Hey @dantownsend.
You're right! Playwright is a great package to have been introduced to!

I'm having some issues with the script file. I can't get the server to close after tests have run. Not sure if you're aware of any fix for this. I've created a PR anyway for you to have a look at. Happy to take on any feedback.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest A good issue for someone contributing to Hacktoberfest.
Projects
None yet
Development

No branches or pull requests

2 participants