Playwright in a pipeline: GitHub Actions and containers
Run Playwright tests on every change in a GitHub Actions workflow. Choose between installing browsers and using the official Docker image. Keep the report when a run fails.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: an assembly line that tests every product on its way out. A factory does not trust one worker to check things when they feel like it. Each product passes the same test station before it leaves. If the station finds a fault, the product stops.
Daily List is a to-do list app. Tom has Playwright tests that pass on his laptop. Mei asks a fair question. Who runs them when Tom is on holiday? Leo sends a change many times a day.
The picture has a limit. A factory station checks a product once. A pipeline test can pass on Monday and fail on Tuesday with no code change, if the test is flaky.
What it is: Playwright is a free library from Microsoft that drives a real browser from code. This topic is one slice of that library: running those tests on every change. A is the recipe. means continuous integration, the habit of checking every change the same way. GitHub Actions is GitHub's service for that recipe. The file lives at .github/workflows/playwright.yml. A report artifact is the saved HTML (HyperText Markup Language) report. A Playwright Docker image is a ready-made container that already holds the browsers. The nearest neighbour is Tom running npx playwright test on his laptop. That run stops when he is away.
Why it matters: Laptop-only tests die when Tom is away. Leo can merge a broken Add task journey and nobody sees it until Lily does. A pipeline run puts a result beside the change, on a clean machine. Red means stop. Green means the checked journeys passed on that machine.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 5 in this section
- playwright
- a free Microsoft tool that drives a browser for tests
- flaky
- passing sometimes and failing sometimes with no product change
- workflow
- the steps a piece of work follows, start to finish
- github
- a web site that hosts code and runs checks
- hypertext
- text that links to other pages
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB A cloud machine runs the same tests on every change and keeps the evidence when something fails.
- Change arrives
- Machine starts
- Tests run
- Notes saved
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The test station on the line | The continuous integration (CI) workflow run |
| The product that arrives | A change pushed by a developer |
| The red stop light | A failed run on the pull request |
| The inspector's notes | The saved report and trace |
WHERE THIS PICTURE STOPS
- A product is checked once. A pipeline test can pass and fail on the same code if it is flaky.
- A factory station is built once. A workflow file changes with the project.
- A station does not need to be told what the product needs. A new cloud machine needs browsers installed.
HOOK
Every change, same station, notes kept.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
Red means stop, green means go on. Ask three things of the line: does it run on every change, install the browsers, and keep the report?
| In the trick | What it stands for |
|---|---|
| every change | each push starts a run |
| browsers | installed on the cloud machine |
| report | the saved report and trace |
TELL A FRIEND
An assembly line where every product passes the same test station and the inspector keeps notes. A Playwright pipeline does this for each change.
OFTEN MIXED UP WITH Where tests run in a pipeline. The pipeline lesson shows where tests sit among build steps. This lesson makes the Playwright tests one of those steps and saves the evidence.
Sources & standards — 5 sources
- Market practice
Continuous Integration (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Docker (Playwright documentation) ↗ — Microsoft (Playwright) · The official image is published at mcr.microsoft.com/playwright, holds the browsers and their system dependencies but not the Playwright package, and is meant for testing and development (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Sharding (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Understanding GitHub Actions (GitHub Docs) ↗ — GitHub · GitHub Actions workflows are files of jobs and steps that run when an event such as a push happens (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Docker (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
PRACTISE AND KEEP
Sources for this topic — 7 sources
- Market practice
Continuous Integration (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Docker (Playwright documentation) ↗ — Microsoft (Playwright) · The official image is published at mcr.microsoft.com/playwright, holds the browsers and their system dependencies but not the Playwright package, and is meant for testing and development (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Sharding (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Understanding GitHub Actions (GitHub Docs) ↗ — GitHub · GitHub Actions workflows are files of jobs and steps that run when an event such as a push happens (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Variables reference (GitHub Docs) ↗ — GitHub · Lists the default environment variables of GitHub Actions and says CI is always set to true in a workflow run, and that it can be overwritten (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Docker (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Implementation-specific
Setting up CI | Playwright ↗ — Microsoft (Playwright) · Playwright documentation, Setting up CI: generated configuration reads the CI variable for retries, workers and forbidOnly; examples inspected, not executed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.