Harden the suite: cross-browser CI, parallel runs, typed data, selector + flake fixes - #1
Merged
Merged
Conversation
The Proceed To Checkout button is an <a> without href, so it has no ARIA link role; matching on display text also breaks under i18n.
Propagate the types through page-object signatures so pyright catches a missing or misspelled field before it ever reaches the form.
Adds the pull_request trigger so the full cross-browser matrix runs as required status checks on each PR, not just on push.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Playwright+pytest E2E suite for more deterministic, scalable CI execution by adding cross-browser coverage, parallelism support, and stronger typing around generated test data and page-object APIs.
Changes:
- Add cross-browser GitHub Actions matrix (chromium/firefox/webkit) and run the suite in parallel via
pytest-xdist. - Introduce typed test data (
TypedDict) for users and payment cards, and propagate types through tests and page objects. - Refactor repeated signup steps into a reusable
register_via_uiflow; improve selector stability and update docs/config accordingly.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/data_generator.py | Adds TypedDict-based shapes for generated user and payment card data. |
| tests/test_checkout.py | Uses typed User fixture and the shared register_via_ui flow for the purchase journey. |
| tests/test_auth.py | Refactors signup test to use shared flow; annotates fixtures as User. |
| requirements.txt | Pins Python test dependencies and adds pytest-xdist for parallel execution. |
| README.md | Updates stack + local run instructions for cross-browser and parallel runs. |
| pytest.ini | Removes hardcoded --browser so CLI/CI matrix can override. |
| pages/signup_page.py | Types fill_account_details to accept User. |
| pages/flows.py | Adds shared cross-page register_via_ui flow to deduplicate tests. |
| pages/checkout_page.py | Types payment flow input as PaymentCard. |
| pages/cart_page.py | Switches checkout selector to stable CSS class (a.check_out). |
| conftest.py | Exposes base_url for xdist workers; expands ad/consent host blocking; types helper signature. |
| .gitignore | Tweaks ignored artifacts and virtualenv entries. |
| .github/workflows/tests.yml | Runs suite on push/PR via cross-browser matrix; installs target browser and runs -n 4. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Repo-specific guidance: layout, run commands, selector/POM/typing conventions, and what to flag in review (sleep, XPath, text selectors, loosened pins, order-dependent tests).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
- ci: cross-browser matrix (chromium/firefox/webkit), parallel -n 4,
runs on every push and pull request
- fix(cart): Proceed-To-Checkout is an with no href → no ARIA link role.
Switched to the stable a.check_out class (also survives i18n)
- fix(ci): expose base_url fixture so xdist workers can navigate
(pytest-base-url doesn't propagate the ini value to -n workers); block the
fundingchoices consent overlay that intercepted clicks
- refactor: typed test data with TypedDict (User, PaymentCard), propagated
through page-object signatures so pyright catches bad fields before the form
- refactor(tests): extract register_via_ui flow, kill duplicate signup steps
- build: pin dependency versions for reproducible CI
- test: stop hardcoding --browser in pytest.ini so the CLI override works
- docs/chore: README + .gitignore