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
NIEVA

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.

Common questions

What people usually ask

Start whenever you like

Reviews

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!