Component & End-to-End Testing
Protect frontend behavior with component tests that query the UI the way users do and Playwright end-to-end tests of critical journeys, with network mocking and accessibility checks.
4 objectives 6 steps about 135 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Write component tests with Vitest and Testing Library that query by role and label, simulate user events and assert visible behavior rather than implementation details.
- Isolate tests from real services by mocking HTTP at the network level (for example with Mock Service Worker) and cover loading, error and success states.
- Write Playwright end-to-end tests for critical user journeys with resilient locators, web-first assertions and automated axe accessibility scans.
- Choose a balanced mix of unit, component and end-to-end tests for a feature, and diagnose flaky tests using traces and retry data.
Lesson plan
6 steps, about 135 min · 5 of 5 lessons available so far
- What to Test in a Frontend, and at Which Level Concept · 20 min
- Component Tests That Read Like User Stories Worked example · 25 min
- Mock the Network, Not Your Code Worked example · 20 min
- End-to-End Journeys with Playwright Worked example · 25 min
- Lab: Test a Checkout Flow at Every Level Lab · 30 min
- Check: Fix the Flaky and the Brittle Knowledge check · 8 questions
Practise it
For your app's search and checkout features, write component tests for success, empty and error states with mocked HTTP and two Playwright journeys that include an axe scan, then run the full suite ten times in a row with no flaky failures. Run at least one authenticated mobile flow and a WebKit flow, including an expired session and login refusal; isolate fixtures so repeated logins do not turn a rate-limit response into a misleading selector timeout.
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.