M. Kodirov

STAGE 05 / LESSON 06

End-to-end testing with Playwright

An end-to-end test follows a real user flow through the browser.

THE IDEA

Understand it.

Use an end-to-end test for an important path, such as signing in and creating a task. Prefer accessible labels and roles so the test resembles how a user finds controls.

Run against an isolated test environment with controlled data. Avoid using production accounts or making real external payments or messages as part of routine tests.

SEE IT IN CONTEXT

A task creation flow

test("creates a task", async ({ page }) => {
  await page.goto("/tasks");
  await page.getByLabel("Task title").fill("Review API");
  await page.getByRole("button", { name: "Create task" }).click();
  await expect(page.getByText("Review API")).toBeVisible();
});

This assumes a configured test environment and a page with matching accessible labels.

LEARN FROM REAL WEBSITES

See it in the real world.

These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.

GitHub

Public documentation checked November 2026

Browser checks for Primer

The Primer React testing guide describes Playwright visual regression and automated accessibility checks against components in Storybook.

  1. Storybook component
  2. Playwright browser
  3. Visual and accessibility checks

What to learn: A real browser can verify rendered UI behavior; this example covers component checks, not a complete GitHub.com user journey.

Read the source: Primer React testing guide

Microsoft

Public workflow checked November 2026

Cross-browser testing in CI

Microsoft's public Playwright workflow runs test jobs across browsers and Node.js versions.

  1. Code change
  2. GitHub Actions test jobs
  3. Browser test results

What to learn: Automating browser tests catches differences across environments. This workflow tests the Playwright project itself.

Read the source: Microsoft Playwright test workflow

TRY IT YOURSELF

Practice.

Why should a test use its own disposable data?

Show one possible answer

It avoids changing real users’ information and makes the expected state predictable and repeatable.

GO DEEPER

Official references.