Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 17.7 — End-to-End, Visual and Accessibility Tests
React · Example 2 of 2

The shape of an end-to-end journey, in miniature

This runs in the preview with a MemoryRouter, so it is still an integration test. The Playwright version (above, in the walkthrough) uses the same steps against the real built app, real URLs and a real browser: same journey, more confidence, more cost.

Playwright drives your real built app in real browsers for a few critical journeys, screenshot comparisons catch visual breakage, axe catches common accessibility errors automatically, and a clear plan decides which check lives at which layer.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a Playwright test that searches for "mango" in a search box labelled "Search products" and checks that exactly 3 results (list items) appear.

02

Using the live helper, write a check that every <input> of type checkbox on the page has a name. Test it on a component with one labelled and one unlabelled checkbox.

Explain it without notes

01

What is an end-to-end test and how is Playwright different from Testing Library in jsdom?

02

How do Playwright's auto-waiting and web-first assertions reduce flakiness?

03

What are visual regression tests, and how do you keep them stable?

04

How would you split testing of a React shop app across unit, integration, E2E, visual and accessibility tests?

The shape of an end-to-end journey, in miniature

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

✓ a visitor logs in and reaches their courses