AI-assisted test writing and the Playwright MCP server
Let an artificial intelligence (AI) helper see the page through Playwright Model Context Protocol (MCP) and draft tests. Check every line and prove it can fail.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a fast apprentice whose drafts you must always check. The apprentice works quickly and never gets tired. Some drafts are good. Some look fine and are wrong. A careful master reads every draft before it goes into the shop.
Daily List is a to-do list app. Tom asks an (AI) helper to write a that adds a task. The helper cannot see the real page. It guesses that the button is called Save. The real button is called Add task. The test fails.
The picture has a limit. A human apprentice learns the product and remembers it. An AI helper may forget between sessions. It can sound sure while it is wrong.
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: letting a helper see the page before it drafts a test. The (MCP) is an open way for an AI app to call outside tools. The Playwright is one tool. You start it with npx and the package @playwright/mcp@latest. An accessibility snapshot is a text outline of roles and names, such as a button named Add task. The Playwright test agents are three helpers with set jobs: a planner, a generator and a healer. The nearest neighbour is codegen, which records your clicks. MCP lets the helper click and read. You still review the draft.
Why it matters: A helper that cannot see the page invents button names. Tom then spends the afternoon fixing a test of a Save button that Daily List does not have. With a snapshot of the teaching site, the draft can use Add task. The draft is still a draft. If Tom merges it without proving it can fail, a green test may check nothing, and Mei trusts an empty guard.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 1 in this section
- playwright
- a free Microsoft tool that drives a browser for tests
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 Using a fast (AI) helper that can see the real page, then reviewing and proving every test it drafts.
- Let it look
- Read the draft
- Run it yourself
- Break it on purpose
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The fast apprentice | The artificial intelligence (AI) helper |
| The shop window | The page seen through the Model Context Protocol (MCP) server |
| The master who reads every draft | The tester who reviews |
| Dropping the part to see if the frame rings | Breaking the feature to see the test fail |
WHERE THIS PICTURE STOPS
- A human apprentice learns your product. A helper may forget it between sessions.
- An apprentice can say they are unsure. A helper may sound sure while wrong.
- The master takes the blame. A tool does not, so the tester does.
HOOK
Let it look, then read it, run it and break it.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
Let it look, then read it, run it and break it. Four steps before an draft joins the suite.
| In the trick | What it stands for |
|---|---|
| look | the page seen through the server |
| read | the tester reviews the draft |
| run | the test passes |
| break | break the feature to see the test fail |
TELL A FRIEND
A fast apprentice whose drafts the master always checks. The helper drafts Playwright tests and the tester proves them.
OFTEN MIXED UP WITH Testing with AI assistants, and checking their output. The (AI) assistants lesson covers safe prompts and checking claims. This lesson adds a helper that drives a real browser and writes Playwright tests.
Sources & standards — 5 sources
- Market practice
Playwright MCP (Playwright documentation) ↗ — Microsoft (Playwright) · The Playwright MCP server lets a language model use a browser through structured accessibility snapshots, started with npx and usable from clients that support the protocol (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
Playwright Test Agents (Playwright documentation) ↗ — Microsoft (Playwright) · Playwright ships a planner that writes a Markdown test plan, a generator that turns it into tests and a healer that repairs failing tests, set up with npx playwright init-agents (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
Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Prefer user-facing locators and web-first assertions, and avoid fixed waits (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. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).
- Market practice
ISTQB Certified Tester Foundation Level Syllabus v4.0.1 ↗ — International Software Testing Qualifications Board · Section 6.2, Benefits and Risks of Test Automation: a tool needs ongoing effort to give lasting benefits, and its risks need analysis and mitigation (confirmed against the syllabus, read in full text from a mirror copy of the publisher PDF, v4.0.1, 15 September 2024)
v4.0.1 is dated 15 September 2024 and is a list of corrections to v4.0 (21 April 2023) that reworded six learning objectives — not a cosmetic reissue. 78 pages.
Two traps this entry exists to stop. v4.0.2 is the German edition (1 March 2025, 94 pages), so sorting by version number reaches the wrong document. And the widely-repeated per-chapter question allocation "8 / 5 / 4 / 11 / 9 / 3" is wrong: it is 8 / 6 / 4 / 11 / 9 / 2, derived from three official sample-exam answer keys and confirmed against the Exam Structure Tables.
The single most consequential detail for a question bank: white-box coverage — statement and branch — is K2 "Explain", not K3 "Apply" (FL-4.3.1, FL-4.3.2, FL-4.3.3), and MC/DC, path and condition coverage are declared out of scope in §4.3. A question asking a candidate to compute branch coverage is testing something this syllabus does not.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read from two independent PDF-to-markdown conversions mirrored on raw.githubusercontent.com. They are treated as faithful because they were produced by unrelated parties with different tooling, agree on the full 64-item objective set including wording, and reproduce the same internal inconsistency present in the source PDF. Chapter 1 reads "testware that supports" where Appendix B reads "that support". A conversion artefact does not replicate across two toolchains.
The licence permits attributed non-commercial extracts and use as the basis for articles. Whether a site that sells a pass may rely on that is an owner's decision, not this entry's.
7 November 2026 review: actual publisher PDF 4.0.1, 15 September 2024, 78 pages, front matter/copyright and relevant numbered operative sections 0.5–0.10 and chapters 1–6 compared with CTFLpractice lessons. Earlier mirror/search descriptions are historical access records. TheK2 white-box objectives require explanation; the source does not justify a categorical ban on small numeric illustrations that support explanation. Later Exam Rules 1.2§4.1.4 usesK2 for keyword definitions, while syllabus§0.5 usesK1; keep dated scopes distinct. No copied questions or figure assets.
- Market practice
mcp-readme ↗ — raw.githubusercontent.com · Reviewed 6 November 2026: Configuration, profiles/initial state, standalone/security only. 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: Configuration, profiles/initial state, standalone/security only. 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 — 5 sources
- Market practice
Playwright MCP (Playwright documentation) ↗ — Microsoft (Playwright) · The Playwright MCP server lets a language model use a browser through structured accessibility snapshots, started with npx and usable from clients that support the protocol (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
Playwright Test Agents (Playwright documentation) ↗ — Microsoft (Playwright) · Playwright ships a planner that writes a Markdown test plan, a generator that turns it into tests and a healer that repairs failing tests, set up with npx playwright init-agents (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
Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Prefer user-facing locators and web-first assertions, and avoid fixed waits (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. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).
- Market practice
ISTQB Certified Tester Foundation Level Syllabus v4.0.1 ↗ — International Software Testing Qualifications Board · Section 6.2, Benefits and Risks of Test Automation: a tool needs ongoing effort to give lasting benefits, and its risks need analysis and mitigation (confirmed against the syllabus, read in full text from a mirror copy of the publisher PDF, v4.0.1, 15 September 2024)
v4.0.1 is dated 15 September 2024 and is a list of corrections to v4.0 (21 April 2023) that reworded six learning objectives — not a cosmetic reissue. 78 pages.
Two traps this entry exists to stop. v4.0.2 is the German edition (1 March 2025, 94 pages), so sorting by version number reaches the wrong document. And the widely-repeated per-chapter question allocation "8 / 5 / 4 / 11 / 9 / 3" is wrong: it is 8 / 6 / 4 / 11 / 9 / 2, derived from three official sample-exam answer keys and confirmed against the Exam Structure Tables.
The single most consequential detail for a question bank: white-box coverage — statement and branch — is K2 "Explain", not K3 "Apply" (FL-4.3.1, FL-4.3.2, FL-4.3.3), and MC/DC, path and condition coverage are declared out of scope in §4.3. A question asking a candidate to compute branch coverage is testing something this syllabus does not.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read from two independent PDF-to-markdown conversions mirrored on raw.githubusercontent.com. They are treated as faithful because they were produced by unrelated parties with different tooling, agree on the full 64-item objective set including wording, and reproduce the same internal inconsistency present in the source PDF. Chapter 1 reads "testware that supports" where Appendix B reads "that support". A conversion artefact does not replicate across two toolchains.
The licence permits attributed non-commercial extracts and use as the basis for articles. Whether a site that sells a pass may rely on that is an owner's decision, not this entry's.
7 November 2026 review: actual publisher PDF 4.0.1, 15 September 2024, 78 pages, front matter/copyright and relevant numbered operative sections 0.5–0.10 and chapters 1–6 compared with CTFLpractice lessons. Earlier mirror/search descriptions are historical access records. TheK2 white-box objectives require explanation; the source does not justify a categorical ban on small numeric illustrations that support explanation. Later Exam Rules 1.2§4.1.4 usesK2 for keyword definitions, while syllabus§0.5 usesK1; keep dated scopes distinct. No copied questions or figure assets.
- Market practice
mcp-readme ↗ — raw.githubusercontent.com · Reviewed 6 November 2026: Configuration, profiles/initial state, standalone/security only. 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: Configuration, profiles/initial state, standalone/security only. 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.