GuideBeginner
E2E Testing with Playwright
Learn end-to-end (E2E) testing through the browser with Playwright, in its Python flavor (`pytest-playwright`). E2E sits at the tip of the test pyramid: few tests, more expensive to run, but they test the WHOLE system the way a real user would. Working on a minimal Reservo page (pick a room, tier, and hours, get a quote, book, and see the confirmation), you'll practice user-centric locators (`get_by_role`, `get_by_label`, `get_by_test_id`) instead of brittle CSS/XPath selectors, actions with auto-waiting, and web-first assertions with `expect()` that automatically retry up to a timeout — the technique that kills flakiness at the root, with not a single fixed `sleep`. You'll cover how to structure a suite with the `page` fixture, `conftest.py`, and per-test browser context isolation, how to handle real-world UI (dialogs, navigation, file uploads), and how to debug with the trace viewer and UI mode before running everything in CI. It closes with a final project: the complete E2E suite for Reservo's booking flow, with edge cases and the CI pipeline.
- 64
- lessons
- 8
- modules
- English · Spanish
- available in
- Yes
- certificate
- Free
- access
Outcomes
What you'll be able to do
- Understand what E2E testing is (testing the whole system through the browser, like a real user) and its place in the test pyramid: few, expensive, valuable
- Install and configure Playwright for Python (`pytest-playwright`) and write the first test navigating and verifying a page's title
- Use user-centric locators (`get_by_role`, `get_by_label`, `get_by_text`, `get_by_test_id`) instead of brittle CSS/XPath selectors, and run actions (`click`, `fill`, `select_option`) with auto-waiting
- Write web-first assertions with `expect(locator)` that automatically retry up to a timeout, killing flakiness at the root
- Test a page's real flow: get a quote by room and tier, validate invalid input, book, and verify the confirmation
- Structure a suite with the `page` fixture, `conftest.py`, scope hooks, and per-test browser context isolation
- Handle real-world UI (network and navigation waits, dialogs, page navigation, file uploads) without ever reaching for a fixed `sleep`
- Debug failures with the trace viewer and UI mode, and run the suite in CI (GitHub Actions) with retries and parallel execution
- Build a complete E2E suite for Reservo's booking flow, with edge cases, organized fixtures, and the CI pipeline
Before you start
What you need to bring
It's for you if...
- Devs who already write unit or integration tests with pytest and want to cover a web app's full flow from the browser
- Frontend or full-stack teams that need a reliable E2E suite, without `sleep`s or tests that fail at random
- Devs migrating from Selenium or other browser automation tools to Playwright
- QA engineers who want to automate critical user flows with locators resistant to UI changes
Requirements and materials
- Testing Fundamentals and TDD guide completed (or equivalent: working with pytest, fixtures, running tests)
- Basic HTML and DOM knowledge (forms, buttons, attributes)
- Python 3.14, `pip`, and the ability to install `playwright` + `pytest-playwright` and download the Chromium browser locally
Content
The syllabus, module by module
Open any of them to see its lessons.
- 1. Module introduction: an E2E test drives the whole system
- 2. What E2E is and the top of the pyramid
- 3. E2E vs unit: when to use each
- 4. What Playwright is and auto-waiting
- 5. Installing pytest-playwright and Chromium
- 6. The Reservo page and how to serve it
- 7. The first test: navigate and assert
- 8. Mini-project: your first E2E test
- 1. Module introduction: find and act, like a user would
- 2. User-centric locators: `get_by_role` and `get_by_label`
- 3. Why NOT locate by fragile CSS or XPath
- 4. Locating by text, test id and placeholder
- 5. Actions: `click`, `fill`, `check`, `select_option`, `press`
- 6. Auto-waiting: why you NEVER put a `sleep`
- 7. Chaining, filtering and strict mode
- 8. Mini-project: locate and act on Reservo
- 1. Module introduction: verifying the page's state
- 2. What a web-first assertion is and `expect(locator)`
- 3. The auto-retry that kills flakiness
- 4. `to_have_text`, `to_have_value` and `to_be_visible`
- 5. `to_be_enabled`, `to_be_checked` and `to_have_count`
- 6. Assertions on the page and negatives
- 7. The timeout of assertions
- 8. Mini-project: assert Reservo's price
- 1. Module introduction: the full lap around the track
- 2. Serving the page and the base-URL fixture
- 3. The quote test: basic → $75.00
- 4. Changing room/tier and the price recalculates
- 5. The booking flow and the confirmation
- 6. Validation: invalid hours
- 7. Parametrizing room × tier × hours
- 8. Mini-project: test the Reservo flow
- 1. Module introduction: the structure of a suite
- 2. The `page` fixture from `pytest-playwright`
- 3. `conftest.py` and the local-server fixture with `yield`
- 4. A fixture's `scope`: `function` vs `session`
- 5. Isolation: a fresh context per test
- 6. Custom fixtures that prepare state: `booked_page`
- 7. Parametrizing tests with fixtures
- 8. Mini-project: a well-structured suite
- 1. Module introduction: real-world UI
- 2. Waiting without `wait_for_timeout`
- 3. Browser dialogs with `page.on("dialog")`
- 4. Navigation between pages
- 5. Iframes with `frame_locator`
- 6. Uploading a file with `set_input_files`
- 7. Flakiness: why never a `sleep`, and retries
- 8. Mini-project: handle a multi-step flow
- 1. Module introduction: see what happened and run without you
- 2. The trace viewer and the `trace.zip`
- 3. Screenshots and videos on failure
- 4. Headed mode, slowmo and PWDEBUG for debugging
- 5. The GitHub Actions YAML and headless in CI
- 6. Retries in CI for residual flakiness
- 7. Parallelism and sharding with pytest-xdist
- 8. Mini-project: debug and run in CI
- 1. Module introduction: from the pieces to the product
- 2. The page under test and the `live_server` fixture
- 3. The quote tests
- 4. The booking flow and the confirmation dialog
- 5. Edge cases and validation
- 6. Structure: `conftest.py`, parametrize and isolation
- 7. Config, tracing and the CI workflow
- 8. Project: the Reservo E2E suite
Common questions
What people usually ask
No limit. It's a free guide: come in whenever you like, as often as you like.
No. Modules run from easier to harder, but you can jump to the one you need. Progress is saved per lesson.
Whatever is needed is listed under “What you need to bring”, above. If nothing is listed there, you can start from zero.
In the Club's WhatsApp group, and every two weeks there's a live with an instructor where questions get worked through.
Yes. It's issued automatically once you finish every lesson, with a verifiable code you can share on LinkedIn.
Start whenever you like
What students say
These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.
No approved reviews yet.
Be the first to share your experience!