playwright-e2e-mcp 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -24
- package/dist/cli/ci.js +3 -0
- package/dist/cli/ci.js.map +1 -1
- package/dist/cli/doctor.d.ts +12 -1
- package/dist/cli/doctor.js +34 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/guard.d.ts +11 -0
- package/dist/cli/guard.js +80 -0
- package/dist/cli/guard.js.map +1 -0
- package/dist/cli/upload.d.ts +14 -0
- package/dist/cli/upload.js +81 -0
- package/dist/cli/upload.js.map +1 -0
- package/dist/discovery.d.ts +61 -0
- package/dist/discovery.js +108 -0
- package/dist/discovery.js.map +1 -0
- package/dist/http.d.ts +10 -1
- package/dist/http.js +50 -4
- package/dist/http.js.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +2 -0
- package/dist/oauth.js +1 -1
- package/dist/oauth.js.map +1 -1
- package/dist/server.d.ts +24 -4
- package/dist/server.js +98 -15
- package/dist/server.js.map +1 -1
- package/dist/skills.d.ts +23 -0
- package/dist/skills.js +101 -0
- package/dist/skills.js.map +1 -0
- package/dist/tools/analyze-history.d.ts +15 -0
- package/dist/tools/analyze-history.js +44 -9
- package/dist/tools/analyze-history.js.map +1 -1
- package/dist/tools/audit-accessibility.d.ts +6 -0
- package/dist/tools/audit-performance.d.ts +6 -0
- package/dist/tools/check-test-change.d.ts +44 -0
- package/dist/tools/check-test-change.js +132 -0
- package/dist/tools/check-test-change.js.map +1 -0
- package/dist/tools/compare-visual-state.d.ts +6 -0
- package/dist/tools/diagnose-flaky.js +5 -1
- package/dist/tools/diagnose-flaky.js.map +1 -1
- package/dist/tools/generate-e2e-test.d.ts +3 -0
- package/dist/tools/generate-e2e-test.js +3 -0
- package/dist/tools/generate-e2e-test.js.map +1 -1
- package/dist/tools/get-failure.js +3 -1
- package/dist/tools/get-failure.js.map +1 -1
- package/dist/tools/get-run-status.js +8 -2
- package/dist/tools/get-run-status.js.map +1 -1
- package/dist/tools/inspect-page.d.ts +6 -0
- package/dist/tools/inspect-page.js +3 -1
- package/dist/tools/inspect-page.js.map +1 -1
- package/dist/tools/list-tests.js +16 -12
- package/dist/tools/list-tests.js.map +1 -1
- package/dist/tools/probe-script.js +181 -15
- package/dist/tools/probe-script.js.map +1 -1
- package/dist/tools/quarantine.d.ts +61 -0
- package/dist/tools/quarantine.js +133 -0
- package/dist/tools/quarantine.js.map +1 -0
- package/dist/tools/run-test.d.ts +10 -1
- package/dist/tools/run-test.js +38 -6
- package/dist/tools/run-test.js.map +1 -1
- package/dist/tools/save-login.d.ts +145 -0
- package/dist/tools/save-login.js +264 -0
- package/dist/tools/save-login.js.map +1 -0
- package/dist/tools/shared.d.ts +49 -2
- package/dist/tools/shared.js +57 -6
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/structured.d.ts +8 -1
- package/dist/tools/structured.js +8 -1
- package/dist/tools/structured.js.map +1 -1
- package/dist/tools/suggest-fix.js +4 -0
- package/dist/tools/suggest-fix.js.map +1 -1
- package/dist/tools/validate-selector.d.ts +6 -0
- package/dist/tools/validate-selector.js +10 -2
- package/dist/tools/validate-selector.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/live-reporter.d.ts +29 -0
- package/dist/utils/live-reporter.js +145 -0
- package/dist/utils/live-reporter.js.map +1 -0
- package/dist/utils/playwright-runner.js +36 -14
- package/dist/utils/playwright-runner.js.map +1 -1
- package/dist/utils/pro-client.d.ts +29 -0
- package/dist/utils/pro-client.js +114 -0
- package/dist/utils/pro-client.js.map +1 -0
- package/dist/utils/pytest-runner.d.ts +102 -0
- package/dist/utils/pytest-runner.js +715 -0
- package/dist/utils/pytest-runner.js.map +1 -0
- package/dist/utils/quarantine.d.ts +64 -0
- package/dist/utils/quarantine.js +106 -0
- package/dist/utils/quarantine.js.map +1 -0
- package/dist/utils/test-change-guard.d.ts +90 -0
- package/dist/utils/test-change-guard.js +516 -0
- package/dist/utils/test-change-guard.js.map +1 -0
- package/dist/utils/totp.d.ts +26 -0
- package/dist/utils/totp.js +84 -0
- package/dist/utils/totp.js.map +1 -0
- package/dist/utils/update-check.d.ts +50 -0
- package/dist/utils/update-check.js +75 -0
- package/dist/utils/update-check.js.map +1 -0
- package/examples/github-actions/playwright-e2e.yml +80 -0
- package/examples/gitlab-ci/playwright-e2e.yml +71 -0
- package/package.json +2 -2
- package/skill/playwright-e2e-mcp/SKILL.md +45 -7
- package/skill/playwright-e2e-mcp/references/setup.md +12 -1
- package/skill/playwright-e2e-mcp/references/tools.md +42 -1
package/README.md
CHANGED
|
@@ -17,6 +17,12 @@ Your Playwright test fails. Your AI finds out why, fixes it, and proves the fix
|
|
|
17
17
|
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="https://raw.githubusercontent.com/xsignon-secure/E2E/main/docs/demo.gif" alt="An agent runs the failing checkout test, suggest-fix proposes a locator proven on the page at failure, and the applied fix is re-run and verified green" width="760">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">⭐ <b>If it saves you a debugging session, <a href="https://github.com/xsignon-secure/E2E">a star</a> helps other Playwright users find it.</b></p>
|
|
25
|
+
|
|
20
26
|
<p align="center">
|
|
21
27
|
<a href="#getting-started">Getting started</a> ·
|
|
22
28
|
<a href="#tools">Tools</a> ·
|
|
@@ -56,10 +62,12 @@ red at HEAD ─▶ bisect-failure (runs it across git history, names the breakin
|
|
|
56
62
|
- **Fixes are proven, not guessed.** Every fix is re-run before it's kept, and undone if the test is still red.
|
|
57
63
|
- **Honest.** It won't paper over a real bug to make a test pass.
|
|
58
64
|
- **Works on CI failures too.** Load a CI job's report and traces and get the same diagnosis and fixes.
|
|
65
|
+
- **TypeScript and Python.** Works on `@playwright/test` suites and on `pytest-playwright` ones, with the same failure diagnosis and traces.
|
|
59
66
|
- **Flakiness with evidence.** Names the flaky test, whether it's a race, shared state or test order, and the seed that reproduces it.
|
|
60
|
-
- **Lean.**
|
|
61
|
-
with Playwright MCP plus a shell
|
|
62
|
-
|
|
67
|
+
- **Lean.** With the `core` tool set, finding and fixing a broken locator took about **5,500 tokens**
|
|
68
|
+
versus about **7,900** with Playwright MCP plus a shell. All 19 tools add about 16k tokens of
|
|
69
|
+
definitions to every request, so load only the [profiles](#configuration) you use ([benchmark](#benchmark)).
|
|
70
|
+
- **Free and open source.** MIT, no account, no API key, no telemetry. Every tool is free; an optional paid Pro only adds hosted CI history.
|
|
63
71
|
|
|
64
72
|
## 🚀 What only this MCP does
|
|
65
73
|
|
|
@@ -69,6 +77,8 @@ page. None of them, as of October 2026, does the following. This one does:
|
|
|
69
77
|
|
|
70
78
|
| Capability | What you get |
|
|
71
79
|
| --- | --- |
|
|
80
|
+
| 🛡️ **A guard against "fixes" that check less** | `check-test-change` compares a changed test with its old self and blocks a fix that went green by deleting an assertion, skipping the test or adding `.only`; it warns on weaker matchers, hard waits, forced clicks and swallowed errors. The same check runs in CI as `guard` |
|
|
81
|
+
| 🧊 **Quarantine with an owner and an expiry** | `quarantine` keeps a flaky test running and reported while its failure stops blocking the build, with who fixes it, why, and the date it blocks again |
|
|
72
82
|
| 🎯 **Find the commit that broke a test** | `bisect-failure` runs the test across your git history, in a temporary worktree that leaves your checkout alone, and names the first bad commit with its diff and the failure |
|
|
73
83
|
| 🧪 **Flake-risk audit of your test code** | `audit-tests` finds hard waits, one-shot assertions, missing `await`s and fragile selectors. It ranks them by how flaky those tests really were, then applies the safe rewrites and re-runs them to prove them |
|
|
74
84
|
| ✅ **Fixes that prove themselves** | `suggest-fix` swaps in a locator proven unique on the DOM at failure, re-runs the test and reverts if it's still red. It refuses to patch over a real app bug |
|
|
@@ -95,13 +105,20 @@ keeps your suite green.
|
|
|
95
105
|
| ♿ | "Check this page for accessibility" | Runs axe-core (WCAG 2.2 AA) and returns each problem with a ready-to-paste locator and regression test. |
|
|
96
106
|
| ⚡ | "Why is this page slow?" | Measures Web Vitals (LCP, CLS, INP, TBT) on desktop or a throttled phone, names the slow element and the elements that jump, and hands back a budget test. |
|
|
97
107
|
| 🧪 | "Show me the error state" | Mocks API responses (500s, empty lists, slow calls) so the AI can inspect, audit or measure states that are hard to reach. |
|
|
108
|
+
| 🔑 | "Log in and save the session" | Logs in once (password from an environment variable, **authenticator code generated from the TOTP secret**), checks the session works and saves it for tests and page tools; reuses it until it expires. The password never passes through the chat. |
|
|
109
|
+
| 🛡️ | "Did that fix cheat?" | Compares the changed tests with git and blocks a fix that passes by deleting assertions or skipping tests. |
|
|
110
|
+
| 🧊 | "Quarantine this flaky test" | Keeps it running and reported, stops it failing the build, with an owner and an expiry date. |
|
|
98
111
|
| 🔐 | "Test the page after login" | Works behind sign-in with saved sessions, headers and click/fill steps, in Chromium, Firefox or WebKit, and can record or replay network traffic from a HAR file. |
|
|
112
|
+
| 🗂️ | "Check the page that opens in a new tab" | Follows popups and new tabs with a `switchTab` step and lists every open tab. |
|
|
113
|
+
| 🔒 | "Look, but don't change anything" | `blockWrites` stops POST, PUT, PATCH and DELETE requests from reaching the real backend while the AI inspects a page. |
|
|
114
|
+
| 🐍 | "Run my pytest suite" | Runs `pytest-playwright` projects with the same tools: failures with the test's own file and line, the code frame and the trace. |
|
|
99
115
|
| 🤖 | "Do it in CI" | A [GitHub Action and `ci` command](#ci-github-action-and-ci-command) post the diagnosis, flaky verdict and fix diffs on your PR. |
|
|
100
116
|
|
|
101
117
|
## Requirements
|
|
102
118
|
|
|
103
119
|
- Node.js 22 or newer
|
|
104
|
-
- A project that uses `@playwright/test`, with a browser installed (`npx playwright install chromium`)
|
|
120
|
+
- A project that uses `@playwright/test`, with a browser installed (`npx playwright install chromium`),
|
|
121
|
+
or a Python project that uses `pytest-playwright` ([see below](#python-projects-pytest-playwright))
|
|
105
122
|
- Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Codex, Gemini CLI or any other MCP client
|
|
106
123
|
|
|
107
124
|
## Getting started
|
|
@@ -112,7 +129,7 @@ other servers alone:
|
|
|
112
129
|
|
|
113
130
|
```bash
|
|
114
131
|
npx -y playwright-e2e-mcp init # --client all | cursor,vscode … · --dry-run
|
|
115
|
-
npx -y playwright-e2e-mcp doctor # checks Node, Playwright, browsers
|
|
132
|
+
npx -y playwright-e2e-mcp doctor # checks Node, Playwright, browsers, client setup and updates
|
|
116
133
|
```
|
|
117
134
|
|
|
118
135
|
**Or let your agent do it.** Paste this into any coding agent:
|
|
@@ -172,6 +189,9 @@ Click [Install in Cursor](https://cursor.com/en/install-mcp?name=playwright-e2e&
|
|
|
172
189
|
or go to **Settings → MCP → Add new MCP server** and paste the standard config. For one
|
|
173
190
|
project only, put it in `.cursor/mcp.json`.
|
|
174
191
|
|
|
192
|
+
Only fixing failing tests? [Install the core tools only](https://cursor.com/en/install-mcp?name=playwright-e2e&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBsYXl3cmlnaHQtZTJlLW1jcCIsIi0tdG9vbHM9Y29yZSJdfQ==): the seven-tool fix loop
|
|
193
|
+
(`--tools=core`), about 5k tokens of tool definitions instead of 16k.
|
|
194
|
+
|
|
175
195
|
</details>
|
|
176
196
|
|
|
177
197
|
<details>
|
|
@@ -253,8 +273,8 @@ Running and fixing your own tests needs your project, so use the local install f
|
|
|
253
273
|
| --- | --- |
|
|
254
274
|
| Skill only, any agent | `npx skills add xsignon-secure/E2E` |
|
|
255
275
|
| MCP Registry | `io.github.xsignon-secure/E2E` ([listing](https://registry.modelcontextprotocol.io/)); registry-aware clients find it there |
|
|
256
|
-
| Straight from GitHub, no npm | `npx -y github:xsignon-secure/E2E#v0.
|
|
257
|
-
| Release tarball | `npm install -D https://github.com/xsignon-secure/E2E/releases/download/v0.
|
|
276
|
+
| Straight from GitHub, no npm | `npx -y github:xsignon-secure/E2E#v0.8.0` (pin a release tag) |
|
|
277
|
+
| Release tarball | `npm install -D https://github.com/xsignon-secure/E2E/releases/download/v0.8.0/playwright-e2e-mcp-0.8.0.tgz` |
|
|
258
278
|
| Docker | `docker run -i --rm -v "$PWD:/work" ghcr.io/xsignon-secure/playwright-e2e-mcp` (published on each release; see [Development](docs/development.md#docker)) |
|
|
259
279
|
| Local checkout | `"command": "node", "args": ["/path/to/E2E/dist/index.js"]` |
|
|
260
280
|
|
|
@@ -271,6 +291,80 @@ Run my Playwright tests and fix whatever fails.
|
|
|
271
291
|
Your agent should run the suite, read the failure, and propose a fix it has re-run. To check the
|
|
272
292
|
setup without your own tests, ask it to run `examples/sample-test.spec.ts` from this repo.
|
|
273
293
|
|
|
294
|
+
### Updating
|
|
295
|
+
|
|
296
|
+
How you get a new release depends on how you installed it:
|
|
297
|
+
|
|
298
|
+
| Installed with | To update |
|
|
299
|
+
| --- | --- |
|
|
300
|
+
| `npx -y playwright-e2e-mcp` (the setup above, and what `init` writes) | Restart your MCP client. npx (npm 10, which comes with Node 22) asks npm for the latest version on each launch and fetches it. |
|
|
301
|
+
| `npm install -D playwright-e2e-mcp` in the project | `npm install -D playwright-e2e-mcp@latest` |
|
|
302
|
+
| `npm install -g playwright-e2e-mcp` | `npm install -g playwright-e2e-mcp@latest` |
|
|
303
|
+
| GitHub Action `uses: xsignon-secure/E2E@v0.x.y` | Change the tag (Dependabot's `github-actions` updates do it for you) |
|
|
304
|
+
| Docker | `docker pull ghcr.io/xsignon-secure/playwright-e2e-mcp:latest` |
|
|
305
|
+
| Claude Desktop bundle (`.mcpb`) | Download the new bundle from the [latest release](https://github.com/xsignon-secure/E2E/releases/latest) and open it |
|
|
306
|
+
| Git clone | `git pull && npm ci` |
|
|
307
|
+
| Agent skill copied by `init` or `npx skills add` | Run the same command again |
|
|
308
|
+
|
|
309
|
+
`npx -y playwright-e2e-mcp doctor` tells you whether a newer version is out and prints the
|
|
310
|
+
command for your setup. Upgrade notes for each release are on the
|
|
311
|
+
[releases page](https://github.com/xsignon-secure/E2E/releases).
|
|
312
|
+
|
|
313
|
+
## Python projects (pytest-playwright)
|
|
314
|
+
|
|
315
|
+
The same server works on Python suites. When the project has no Node Playwright but has a
|
|
316
|
+
`pytest.ini`, a `[tool.pytest…]` table in `pyproject.toml`, `setup.cfg` / `tox.ini` pytest
|
|
317
|
+
settings or a `conftest.py`, the tools run `python -m pytest` instead:
|
|
318
|
+
|
|
319
|
+
- **`run-test`** runs the suite, a file, `tests/test_cart.py::TestCart::test_add` or
|
|
320
|
+
`tests/test_cart.py:42` (the test at that line). `grep` becomes `-k`, `browser` becomes
|
|
321
|
+
`--browser`, `retries` uses pytest-rerunfailures. Failures that finished are kept even when
|
|
322
|
+
the run is killed.
|
|
323
|
+
- **`get-failure`** shows the message, the code frame, expected vs actual and, from the trace
|
|
324
|
+
pytest-playwright keeps (`--tracing retain-on-failure` is added for you), the failed action,
|
|
325
|
+
the DOM at failure, network and console.
|
|
326
|
+
- **`list-tests`**, **`analyze-history`**, **`quarantine`** and the **`ci`** command work as for Node.
|
|
327
|
+
- Not yet for Python: **`suggest-fix`** points at the DOM at failure but does not patch `.py`
|
|
328
|
+
files, **`diagnose-flaky`** says so and suggests re-running, and **`audit-tests`**,
|
|
329
|
+
**`check-test-change`** and **`generate-e2e-test`** read and write TypeScript/JavaScript specs
|
|
330
|
+
only. The page tools (`inspect-page`, `validate-selector`, …) launch the browser with Node
|
|
331
|
+
Playwright, so they need `@playwright/test` installed in the project.
|
|
332
|
+
|
|
333
|
+
Results come from a small pytest plugin the server loads with `-p` from its temp folder; nothing
|
|
334
|
+
is installed in your project. It uses your Python: `PW_MCP_PYTHON`, else `.venv`, `venv` or `env`
|
|
335
|
+
in the project, else `python3` / `python`.
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
pip install pytest-playwright && playwright install chromium
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## What's new in 0.8
|
|
342
|
+
|
|
343
|
+
- **Python suites:** projects that use `pytest-playwright` work with `run-test`, `get-failure`
|
|
344
|
+
and `list-tests`, traces included ([details](#python-projects-pytest-playwright)).
|
|
345
|
+
- **Popups and new tabs:** a `switchTab` step follows the page into a popup or new tab, and
|
|
346
|
+
results list every open tab.
|
|
347
|
+
- **Look without changing anything:** `blockWrites` (or `PW_MCP_BLOCK_WRITES=1`) stops the page
|
|
348
|
+
tools from sending POST, PUT, PATCH or DELETE requests to a real backend.
|
|
349
|
+
- **Crashed runs still report:** when Playwright dies before writing its report, the failures
|
|
350
|
+
that finished are kept and the run is marked partial.
|
|
351
|
+
- **Stricter heal guard:** an assertion inside a `try` whose `catch` swallows the error is
|
|
352
|
+
blocked, and a web-first assertion without `await` is flagged.
|
|
353
|
+
- **MCP 2026-07-28:** the new stateless protocol revision, cache hints, a server icon, the agent
|
|
354
|
+
skill served over the Skills extension, and a Server Card for discovery.
|
|
355
|
+
- **Update check:** `doctor` says when a newer version is out and how to update
|
|
356
|
+
([Updating](#updating)).
|
|
357
|
+
|
|
358
|
+
## What's new in 0.7
|
|
359
|
+
|
|
360
|
+
- **Log in once, safely:** `save-login` signs in (2FA codes included) with secrets read from the
|
|
361
|
+
environment, checks the session and saves it as a `storageState` file; it reuses the session
|
|
362
|
+
until it stops working.
|
|
363
|
+
- **Heal guard:** `check-test-change` and `playwright-e2e-mcp guard` block a test "fix" that
|
|
364
|
+
passes by checking less (deleted assertions, skipped tests, `.only`).
|
|
365
|
+
- **Flaky-test quarantine:** `quarantine` stops a known flaky test from failing the build for a
|
|
366
|
+
set time, with an owner and a reason, while it keeps running and being reported.
|
|
367
|
+
|
|
274
368
|
## What's new in 0.6
|
|
275
369
|
|
|
276
370
|
- **Find the commit that broke a test:** `bisect-failure` runs the test across git history in a
|
|
@@ -306,6 +400,9 @@ setup without your own tests, ask it to run `examples/sample-test.spec.ts` from
|
|
|
306
400
|
| `diagnose-flaky` | Run a failing test 2–10 times **with retries disabled** and return an evidence verdict: `CONSISTENTLY FAILING`, `FLAKY` or `NOT REPRODUCING`; tells parallelism and **test-order** bugs from races |
|
|
307
401
|
| `analyze-history` | Rank flaky, regressed and broken tests from the local run history, group failures by cause, list the slowest tests, show stability by day, name **the commit where each test went bad**, or show one test's timeline |
|
|
308
402
|
| `audit-tests` | Audit the **test code** for flake risks (hard waits, one-shot assertions instead of web-first ones, missing `await`s, `.only`, force clicks, `networkidle`, element handles, layout selectors), ranked by how flaky those tests have been in the run history; `fix: true` rewrites the mechanical ones, re-runs the files and reverts if they fail |
|
|
403
|
+
| `save-login` | **Log in once and save the session** (`storageState`): steps with `{{env:E2E_PASSWORD}}` and `{{totp}}` (authenticator code from a secret in the environment), a check that the session works, and reuse until it expires; secrets never pass through the chat |
|
|
404
|
+
| `check-test-change` | **Heal guard**: compare changed tests with git (or a proposed fix with the file) and BLOCK deleted assertions, skipped or removed tests and `.only`; WARN on weaker matchers, hard waits, `force: true`, swallowed errors and raised timeouts or retries |
|
|
405
|
+
| `quarantine` | Quarantine a flaky test with an owner, a reason and an expiry (default 14 days): it keeps running and being reported, but its failure no longer fails `run-test` or `ci` until the entry expires. Stored in `playwright-quarantine.json` |
|
|
309
406
|
| `bisect-failure` | **Find the commit that broke a test**: binary-search git history between a good and a bad commit, running the test at each step in a temporary worktree (your checkout is untouched), and report the first bad commit, what it changed and how the test failed |
|
|
310
407
|
|
|
311
408
|
Two **prompts** package the main workflows for clients that show them as slash commands:
|
|
@@ -315,8 +412,8 @@ Every argument and example output is in the **[tool reference](docs/tools.md)**.
|
|
|
315
412
|
MCP tool annotations (`readOnlyHint`, `destructiveHint`, …), so clients can show accurate safety
|
|
316
413
|
prompts.
|
|
317
414
|
|
|
318
|
-
**Only need the fix loop?** `--tools=core` (or `PW_MCP_TOOLS=core`) exposes
|
|
319
|
-
tool-definition context by about three quarters. Other profiles: `triage`, `inspect`, `author`.
|
|
415
|
+
**Only need the fix loop?** `--tools=core` (or `PW_MCP_TOOLS=core`) exposes seven tools and cuts the
|
|
416
|
+
tool-definition context by about three quarters ([one-click core install for Cursor](https://cursor.com/en/install-mcp?name=playwright-e2e&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBsYXl3cmlnaHQtZTJlLW1jcCIsIi0tdG9vbHM9Y29yZSJdfQ==)). Other profiles: `triage`, `inspect`, `author`.
|
|
320
417
|
|
|
321
418
|
<details>
|
|
322
419
|
<summary><b>Typical workflow</b></summary>
|
|
@@ -375,15 +472,31 @@ steps:
|
|
|
375
472
|
- uses: actions/setup-node@v6
|
|
376
473
|
with: { node-version: 24 }
|
|
377
474
|
- run: npm ci && npx playwright install --with-deps chromium
|
|
378
|
-
- uses: xsignon-secure/E2E@v0.
|
|
475
|
+
- uses: xsignon-secure/E2E@v0.8.0
|
|
379
476
|
with:
|
|
380
477
|
flaky-runs: 3 # 0 skips the flaky verdict
|
|
381
478
|
suggest: 2 # suggest-fix diffs for the first 2 failures
|
|
382
479
|
# args: --browser chromium tests/checkout
|
|
383
480
|
```
|
|
384
481
|
|
|
482
|
+
A complete, ready-to-copy workflow is available in [`examples/github-actions/playwright-e2e.yml`](examples/github-actions/playwright-e2e.yml), including artifact upload and commented options for `guard: true` and Pro Cloud.
|
|
483
|
+
|
|
484
|
+
**GitLab CI:** [`examples/gitlab-ci/playwright-e2e.yml`](examples/gitlab-ci/playwright-e2e.yml) runs the heal guard on merge requests, the same `ci` diagnosis, and posts the report as a merge request comment when you give it a project access token. Any other CI (Jenkins, CircleCI, AWS CodeBuild) works the same way: run `npx -y playwright-e2e-mcp ci --output e2e-report.md` and keep the file.
|
|
485
|
+
|
|
385
486
|
Inputs: `project-root`, `args`, `flaky-runs`, `suggest`, `comment`, `review`,
|
|
386
|
-
`verify-fixes`, `fail-on-failure`, `version`, `github-token`. Outputs: `exit-code`,
|
|
487
|
+
`verify-fixes`, `guard`, `pro-key`, `pro-url`, `fail-on-failure`, `version`, `github-token`. Outputs: `exit-code`,
|
|
488
|
+
`report`, `guard`.
|
|
489
|
+
|
|
490
|
+
Quarantined tests (`playwright-quarantine.json`, see [`quarantine`](docs/tools.md#quarantine))
|
|
491
|
+
are honoured here too: when every failure is quarantined and unexpired, `ci` exits `0` and the
|
|
492
|
+
report lists them.
|
|
493
|
+
|
|
494
|
+
**Heal guard in CI.** `guard: true` checks the PR's changed tests against the base branch first
|
|
495
|
+
and fails the job if a test was made to pass by checking less. Without the Action:
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
npx -y playwright-e2e-mcp guard --base origin/main # exit 1 on BLOCK; --strict fails on warnings too
|
|
499
|
+
```
|
|
387
500
|
|
|
388
501
|
## Configuration
|
|
389
502
|
|
|
@@ -393,10 +506,17 @@ Inputs: `project-root`, `args`, `flaky-runs`, `suggest`, `comment`, `review`,
|
|
|
393
506
|
| Environment variable | Default | Purpose |
|
|
394
507
|
| --- | --- | --- |
|
|
395
508
|
| `PW_MCP_PROJECT_ROOT` | server cwd | Default project root for every tool |
|
|
396
|
-
| `PW_MCP_TOOLS` | all | Which tools to expose, as tool names and/or profiles, comma separated (same as the `--tools=` flag). Profiles: `core` (run, status, failure, fix, flaky, list), `triage` (run, status, failure, CI report, flaky, history, test audit, bisect, list), `inspect` (page, selector, accessibility, performance, visual), `author` (list, page, selector, generate, run). All
|
|
509
|
+
| `PW_MCP_TOOLS` | all | Which tools to expose, as tool names and/or profiles, comma separated (same as the `--tools=` flag). Profiles: `core` (run, status, failure, fix, flaky, heal guard, list), `triage` (run, status, failure, CI report, flaky, history, test audit, bisect, quarantine, heal guard, list), `inspect` (page, selector, accessibility, performance, visual, login), `author` (list, page, selector, generate, run, login, heal guard). All nineteen tool definitions cost about 16k tokens of context per request; `core` costs about 5k (12k and 2.6k with `PW_MCP_OUTPUT_SCHEMAS=0`) |
|
|
397
510
|
| `PW_MCP_OUTPUT_SCHEMAS` | on | `0` leaves the output schemas out of the tool list to save context. Results still carry `structuredContent` (see [Structured results](docs/tools.md#structured-results)) |
|
|
511
|
+
| `PW_MCP_PROTOCOL` | both | `legacy` stops offering the stateless 2026-07-28 MCP revision, for a client that trips over it. By default 2026 clients get it and 2025 clients get the old handshake |
|
|
512
|
+
| `PW_MCP_NO_UPDATE_CHECK` | off | `1` stops `doctor` from asking npm whether a newer version is out (same as `doctor --offline`) |
|
|
513
|
+
| `PW_MCP_SKILLS` | on | `0` stops serving the bundled agent skill over the MCP Skills extension (`skill://playwright-e2e-mcp/SKILL.md`) |
|
|
398
514
|
| `PW_MCP_STORAGE_STATE` | — | Default `storageState` file (inside the project) for the page tools |
|
|
515
|
+
| `PW_MCP_PYTHON` | project venv, then `python3` | The Python that runs a pytest-playwright suite |
|
|
516
|
+
| `PW_MCP_BLOCK_WRITES` | off | `1` makes the page tools abort POST, PUT, PATCH and DELETE requests that no mock answers (same as `blockWrites: true`), so steps run against a real environment cannot change its data |
|
|
399
517
|
| `PW_MCP_SHUFFLE_SEEDS` | random | Comma-separated seeds for `diagnose-flaky`'s `order` pass, to replay the orders a diagnosis reported |
|
|
518
|
+
| `PW_MCP_LOGIN_ENV` | — | Extra environment variables `save-login` may type through `{{env:NAME}}`, comma separated. Without it only `E2E_*`, `TEST_*`, `PW_*`, `PLAYWRIGHT_*` and `LOGIN_*` are allowed |
|
|
519
|
+
| `PW_MCP_PRO_KEY` / `PW_MCP_PRO_URL` | — | Optional, paid: Pro key and Pro Cloud address. CI runs are uploaded with `playwright-e2e-mcp upload` (or the Action's `pro-key` / `pro-url` inputs) and `analyze-history` merges them with local runs. Unset (the default), nothing is ever sent anywhere |
|
|
400
520
|
| `PW_MCP_HISTORY` | on | `0` stops recording runs to `.playwright-e2e-mcp/history.jsonl` |
|
|
401
521
|
| `PW_MCP_ALLOWED_ROOTS` | — | Extra directories a caller may pass as `projectRoot` (`:`-separated, `;` on Windows). Anything outside these and the default root is rejected |
|
|
402
522
|
| `PW_MCP_HTTP_TOKEN` | — | HTTP bridge only: bearer token that unlocks all tools: 16+ characters, 32+ recommended (see [Hosted endpoint](docs/hosted-endpoint.md)) |
|
|
@@ -429,16 +549,21 @@ on a storefront page and fixes it two ways: with this server (`run-test` → `su
|
|
|
429
549
|
apply) and with Playwright MCP plus a shell (`playwright test`, `browser_navigate` +
|
|
430
550
|
`browser_snapshot`, edit, re-run). Latest result ([full output](bench/RESULTS.md)):
|
|
431
551
|
|
|
432
|
-
| Step | playwright-e2e-mcp | Playwright MCP + shell |
|
|
433
|
-
| --- | ---: | ---: |
|
|
434
|
-
| Tool definitions (sent with every request) | 4,
|
|
435
|
-
| Run the failing test |
|
|
436
|
-
| Find the element / propose the fix |
|
|
437
|
-
| Apply + verify (re-run) |
|
|
438
|
-
| **Total for one fix** | 5,
|
|
439
|
-
|
|
440
|
-
Tokens are characters ÷ 4. The
|
|
441
|
-
|
|
552
|
+
| Step | playwright-e2e-mcp (`core` tools) | playwright-e2e-mcp (all tools) | Playwright MCP + shell |
|
|
553
|
+
| --- | ---: | ---: | ---: |
|
|
554
|
+
| Tool definitions (sent with every request) | 4,826 | 16,121 | 5,225 |
|
|
555
|
+
| Run the failing test | 244 | 244 | 323 |
|
|
556
|
+
| Find the element / propose the fix | 232 | 232 | 2,286 |
|
|
557
|
+
| Apply + verify (re-run) | 230 | 230 | 34 |
|
|
558
|
+
| **Total for one fix** | 5,532 | 16,827 | 7,868 |
|
|
559
|
+
|
|
560
|
+
Tokens are characters ÷ 4. The work itself (run, diagnose, fix, verify) takes about 700 tokens
|
|
561
|
+
here versus about 2,600 with Playwright MCP, but tool definitions are sent with every request:
|
|
562
|
+
with all 19 tools loaded they outweigh that saving, so set `PW_MCP_TOOLS=core` (or another
|
|
563
|
+
profile) when you only fix failing tests. The Playwright MCP route is a lower bound: it assumes
|
|
564
|
+
the agent picks the right locator from the snapshot on the first try, which the server does for
|
|
565
|
+
it here. Run 2026-10-28 with 0.7.0 and Playwright 1.64.1; re-run with
|
|
566
|
+
`npm run build && node bench/token-benchmark.mjs`.
|
|
442
567
|
|
|
443
568
|
## Demo
|
|
444
569
|
|
|
@@ -449,9 +574,9 @@ A real `run-test` call served over stdio by `npx -y playwright-e2e-mcp` against
|
|
|
449
574
|
|
|
450
575
|
## Free and open source
|
|
451
576
|
|
|
452
|
-
- **MIT licensed.** Use it, change it, ship it in commercial work; no fees, no
|
|
577
|
+
- **MIT licensed.** Use it, change it, ship it in commercial work; no fees, no feature held back. The optional Pro plan adds a hosted service (CI run history across machines), not tools; nothing here needs it.
|
|
453
578
|
- **No account, no API key, no sign-up.** `npx -y playwright-e2e-mcp init` is the whole setup.
|
|
454
|
-
- **No telemetry.** It never phones home; your tests, traces and run history stay on your machine.
|
|
579
|
+
- **No telemetry.** It never phones home; your tests, traces and run history stay on your machine unless you set a Pro key and upload them. The only other request is `doctor` asking npm for the latest version number when you run it (`--offline` or `PW_MCP_NO_UPDATE_CHECK=1` skips it).
|
|
455
580
|
- **Free dependencies only:** the MCP SDK (Apache-2.0), zod (MIT), axe-core (MPL-2.0) and the Playwright your project already has (Apache-2.0).
|
|
456
581
|
- **Free to host yourself**, too: the HTTP bridge deploys to a free Vercel account (see [Hosted endpoint](docs/hosted-endpoint.md)).
|
|
457
582
|
|
|
@@ -463,6 +588,7 @@ browsing and this server for running, diagnosing and fixing the suite. They work
|
|
|
463
588
|
|
|
464
589
|
- [Tool reference](docs/tools.md): every argument, example outputs, edge cases handled
|
|
465
590
|
- [Hosted endpoint](docs/hosted-endpoint.md): the HTTP bridge for ChatGPT and claude.ai connectors
|
|
591
|
+
- [Architecture](ARCHITECTURE.md): how the server is built and the design decisions behind it
|
|
466
592
|
- [Security](SECURITY.md): the security model and how to report a vulnerability
|
|
467
593
|
- [Development](docs/development.md): building, tests, Docker, signing and releasing
|
|
468
594
|
- [Contributing](CONTRIBUTING.md) · [Code of conduct](CODE_OF_CONDUCT.md)
|
package/dist/cli/ci.js
CHANGED
|
@@ -148,6 +148,9 @@ export async function runCi(argv) {
|
|
|
148
148
|
const result = ctx.store.lastRun?.result;
|
|
149
149
|
const failures = result?.failures ?? [];
|
|
150
150
|
let code = result === undefined || run.isError ? 2 : result.ok ? 0 : failures.length > 0 ? 1 : 2;
|
|
151
|
+
// Every failure is quarantined (and none expired): report them, pass the build.
|
|
152
|
+
if (code === 1 && (structured(run)?.run?.quarantined ?? 0) > 0 && structured(run)?.ok === true)
|
|
153
|
+
code = 0;
|
|
151
154
|
const fixes = [];
|
|
152
155
|
const suggest = options.review || options.suggestions ? Math.max(options.suggest, 1) : options.suggest;
|
|
153
156
|
if (code === 1 && suggest > 0 && ctx.store.lastRun) {
|
package/dist/cli/ci.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci.js","sourceRoot":"","sources":["../../src/cli/ci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,sDAAsD;IACtD,EAAE;IACF,8EAA8E;IAC9E,uFAAuF;IACvF,EAAE;IACF,kFAAkF;IAClF,kEAAkE;IAClE,sDAAsD;IACtD,yDAAyD;IACzD,6CAA6C;IAC7C,wEAAwE;IACxE,0DAA0D;IAC1D,kFAAkF;IAClF,mFAAmF;IACnF,gFAAgF;IAChF,2FAA2F;IAC3F,wFAAwF;IACxF,wFAAwF;IACxF,qFAAqF;IACrF,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAmBb,SAAS,SAAS,CAAC,KAAyB,EAAE,IAAY,EAAE,GAAW,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AAC,CAAC;IACtD,CAAC;IAED,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,mGAAmG,CAAC;IAClJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,IAAI,CAAC;QACH,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACpE,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB;YAAE,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzG,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAAgC,GAAa,CAAC,OAAO,IAAI,CAAC,CAAC;QAChF,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cli/doctor.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* Exit codes: 0 nothing failed (warnings allowed), 1 a check failed,
|
|
10
10
|
* 2 bad arguments.
|
|
11
11
|
*/
|
|
12
|
+
import { type UpdateCheckOptions } from '../utils/update-check.js';
|
|
12
13
|
export declare const DOCTOR_USAGE: string;
|
|
13
14
|
/** Oldest Node major the server supports. */
|
|
14
15
|
export declare const MIN_NODE_MAJOR = 22;
|
|
@@ -26,6 +27,16 @@ export interface DoctorReport {
|
|
|
26
27
|
checks: DoctorCheck[];
|
|
27
28
|
ok: boolean;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The running version against the latest on npm. A newer release is a
|
|
32
|
+
* warning with the upgrade commands; an unreachable registry is not a
|
|
33
|
+
* problem with the setup, so it stays `ok` and says it could not check.
|
|
34
|
+
*/
|
|
35
|
+
export declare function versionCheck(options?: UpdateCheckOptions): Promise<DoctorCheck>;
|
|
36
|
+
export interface DoctorOptions {
|
|
37
|
+
/** Options for the npm version check; `{ offline: true }` skips it. */
|
|
38
|
+
update?: UpdateCheckOptions;
|
|
39
|
+
}
|
|
40
|
+
export declare function runDoctorChecks(projectRoot: string, home?: string, options?: DoctorOptions): Promise<DoctorReport>;
|
|
30
41
|
export declare function renderDoctorReport(report: DoctorReport): string;
|
|
31
42
|
export declare function runDoctor(argv: string[], out?: (text: string) => void): Promise<number>;
|
package/dist/cli/doctor.js
CHANGED
|
@@ -17,6 +17,7 @@ import { parseArgs } from 'node:util';
|
|
|
17
17
|
import { detectProject, findTestFiles } from '../utils/project-detector.js';
|
|
18
18
|
import { SERVER_VERSION } from '../server.js';
|
|
19
19
|
import { SERVER_NAME, SKILL_NAME } from './init.js';
|
|
20
|
+
import { checkForUpdate, UPGRADE_HINT } from '../utils/update-check.js';
|
|
20
21
|
export const DOCTOR_USAGE = [
|
|
21
22
|
'Usage: playwright-e2e-mcp doctor [options]',
|
|
22
23
|
'',
|
|
@@ -25,8 +26,11 @@ export const DOCTOR_USAGE = [
|
|
|
25
26
|
'',
|
|
26
27
|
' --project-root <dir> project directory (default: cwd)',
|
|
27
28
|
' --json print the checks as JSON',
|
|
29
|
+
' --offline skip asking npm whether a newer version exists',
|
|
30
|
+
' (also PW_MCP_NO_UPDATE_CHECK=1)',
|
|
28
31
|
'',
|
|
29
32
|
].join('\n');
|
|
33
|
+
const REPO_URL = 'https://github.com/xsignon-secure/E2E';
|
|
30
34
|
/** Oldest Node major the server supports. */
|
|
31
35
|
export const MIN_NODE_MAJOR = 22;
|
|
32
36
|
/** Where each client keeps its project-scoped MCP config (see init). */
|
|
@@ -100,8 +104,31 @@ function browserChecks(root, playwrightPackage) {
|
|
|
100
104
|
}
|
|
101
105
|
return [{ name: 'Browsers', status: 'ok', detail: `installed: ${installed.join(', ')}${missing.length ? ` (not installed: ${missing.join(', ')})` : ''}` }];
|
|
102
106
|
}
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
/**
|
|
108
|
+
* The running version against the latest on npm. A newer release is a
|
|
109
|
+
* warning with the upgrade commands; an unreachable registry is not a
|
|
110
|
+
* problem with the setup, so it stays `ok` and says it could not check.
|
|
111
|
+
*/
|
|
112
|
+
export async function versionCheck(options = {}) {
|
|
113
|
+
const status = await checkForUpdate(SERVER_VERSION, options);
|
|
114
|
+
switch (status.state) {
|
|
115
|
+
case 'outdated':
|
|
116
|
+
return {
|
|
117
|
+
name: 'Version',
|
|
118
|
+
status: 'warn',
|
|
119
|
+
detail: `${status.current} is running; ${status.latest} is out (release notes: ${REPO_URL}/releases/tag/v${status.latest})`,
|
|
120
|
+
fix: UPGRADE_HINT,
|
|
121
|
+
};
|
|
122
|
+
case 'current':
|
|
123
|
+
return { name: 'Version', status: 'ok', detail: `${status.current} (latest)` };
|
|
124
|
+
case 'ahead':
|
|
125
|
+
return { name: 'Version', status: 'ok', detail: `${status.current} (newer than npm's ${status.latest})` };
|
|
126
|
+
default:
|
|
127
|
+
return { name: 'Version', status: 'ok', detail: `${status.current} (did not check for updates: ${status.reason})` };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export async function runDoctorChecks(projectRoot, home = os.homedir(), options = {}) {
|
|
131
|
+
const checks = [nodeCheck(), await versionCheck(options.update)];
|
|
105
132
|
const detection = await detectProject(projectRoot);
|
|
106
133
|
const root = detection.root;
|
|
107
134
|
if (!detection.configPath) {
|
|
@@ -178,6 +205,9 @@ export function renderDoctorReport(report) {
|
|
|
178
205
|
: warned
|
|
179
206
|
? `Ready, with ${warned} suggestion${warned === 1 ? '' : 's'} above.`
|
|
180
207
|
: 'Everything is ready.');
|
|
208
|
+
// Only on a working setup: asking for a star while the tools can't run is no help to anyone.
|
|
209
|
+
if (!failed)
|
|
210
|
+
lines.push('', `Like it? A star helps other Playwright users find it: ${REPO_URL}`);
|
|
181
211
|
return `${lines.join('\n')}\n`;
|
|
182
212
|
}
|
|
183
213
|
export async function runDoctor(argv, out = (t) => process.stdout.write(t)) {
|
|
@@ -186,14 +216,14 @@ export async function runDoctor(argv, out = (t) => process.stdout.write(t)) {
|
|
|
186
216
|
({ values } = parseArgs({
|
|
187
217
|
args: argv,
|
|
188
218
|
strict: true,
|
|
189
|
-
options: { 'project-root': { type: 'string' }, json: { type: 'boolean' } },
|
|
219
|
+
options: { 'project-root': { type: 'string' }, json: { type: 'boolean' }, offline: { type: 'boolean' } },
|
|
190
220
|
}));
|
|
191
221
|
}
|
|
192
222
|
catch (err) {
|
|
193
223
|
out(`doctor: ${err.message}\n\n${DOCTOR_USAGE}`);
|
|
194
224
|
return 2;
|
|
195
225
|
}
|
|
196
|
-
const report = await runDoctorChecks(path.resolve(values['project-root'] ?? '.'));
|
|
226
|
+
const report = await runDoctorChecks(path.resolve(values['project-root'] ?? '.'), os.homedir(), { update: { offline: values.offline } });
|
|
197
227
|
out(values.json ? `${JSON.stringify(report, null, 2)}\n` : renderDoctorReport(report));
|
|
198
228
|
return report.ok ? 0 : 1;
|
|
199
229
|
}
|
package/dist/cli/doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAA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AM,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `playwright-e2e-mcp guard`: the heal guard as a CI step. Compares the
|
|
3
|
+
* changed spec files with a base ref and fails the job when a change made
|
|
4
|
+
* tests pass by checking less (deleted assertions, skipped or removed
|
|
5
|
+
* tests, `.only`). Warnings are printed but do not fail unless --strict.
|
|
6
|
+
*
|
|
7
|
+
* Exit codes: 0 OK (or only warnings), 1 BLOCK (or WARN with --strict),
|
|
8
|
+
* 2 bad arguments or not a git checkout.
|
|
9
|
+
*/
|
|
10
|
+
export declare const GUARD_USAGE: string;
|
|
11
|
+
export declare function runGuard(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `playwright-e2e-mcp guard`: the heal guard as a CI step. Compares the
|
|
3
|
+
* changed spec files with a base ref and fails the job when a change made
|
|
4
|
+
* tests pass by checking less (deleted assertions, skipped or removed
|
|
5
|
+
* tests, `.only`). Warnings are printed but do not fail unless --strict.
|
|
6
|
+
*
|
|
7
|
+
* Exit codes: 0 OK (or only warnings), 1 BLOCK (or WARN with --strict),
|
|
8
|
+
* 2 bad arguments or not a git checkout.
|
|
9
|
+
*/
|
|
10
|
+
import { appendFileSync } from 'node:fs';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import { parseArgs } from 'node:util';
|
|
13
|
+
import { assertGitRef, guardAgainstRef } from '../tools/check-test-change.js';
|
|
14
|
+
import { guardVerdict, renderGuardReport } from '../utils/test-change-guard.js';
|
|
15
|
+
export const GUARD_USAGE = [
|
|
16
|
+
'Usage: playwright-e2e-mcp guard [options]',
|
|
17
|
+
'',
|
|
18
|
+
'Checks that changed tests were not made to pass by checking less: blocks deleted',
|
|
19
|
+
'assertions, skipped or removed tests and .only; warns on weaker matchers, hard',
|
|
20
|
+
'waits, force: true, swallowed errors and raised timeouts or retries.',
|
|
21
|
+
'',
|
|
22
|
+
' --base <ref> git ref to compare with (default: HEAD; in a PR use origin/main)',
|
|
23
|
+
' --project-root <dir> project directory (default: cwd)',
|
|
24
|
+
' --strict warnings fail the check too',
|
|
25
|
+
' --json print the result as JSON',
|
|
26
|
+
'',
|
|
27
|
+
'Exit codes: 0 OK, 1 blocked, 2 bad arguments.',
|
|
28
|
+
'',
|
|
29
|
+
].join('\n');
|
|
30
|
+
export async function runGuard(argv) {
|
|
31
|
+
let values;
|
|
32
|
+
try {
|
|
33
|
+
({ values } = parseArgs({
|
|
34
|
+
args: argv,
|
|
35
|
+
options: {
|
|
36
|
+
base: { type: 'string' },
|
|
37
|
+
'project-root': { type: 'string' },
|
|
38
|
+
strict: { type: 'boolean' },
|
|
39
|
+
json: { type: 'boolean' },
|
|
40
|
+
},
|
|
41
|
+
strict: true,
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
process.stderr.write(`${error.message}\n\n${GUARD_USAGE}`);
|
|
46
|
+
return 2;
|
|
47
|
+
}
|
|
48
|
+
const root = path.resolve(values['project-root'] ?? process.cwd());
|
|
49
|
+
try {
|
|
50
|
+
const base = assertGitRef(values.base ?? 'HEAD');
|
|
51
|
+
const results = await guardAgainstRef(root.replace(/\\/g, '/'), base);
|
|
52
|
+
const verdict = guardVerdict(results);
|
|
53
|
+
const failed = verdict === 'BLOCK' || (values.strict === true && verdict === 'WARN');
|
|
54
|
+
if (values.json) {
|
|
55
|
+
process.stdout.write(`${JSON.stringify({ verdict, ok: !failed, files: results }, null, 2)}\n`);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const report = results.length === 0
|
|
59
|
+
? '## ✅ OK — no changed spec files\n\nNothing to compare: no spec file or playwright config differs from the base.\n'
|
|
60
|
+
: `${renderGuardReport(results, base === 'HEAD' ? 'last commit → working tree' : `\`${base}\` → working tree`)}\n`;
|
|
61
|
+
process.stdout.write(report);
|
|
62
|
+
const summary = process.env.GITHUB_STEP_SUMMARY;
|
|
63
|
+
if (summary) {
|
|
64
|
+
try {
|
|
65
|
+
appendFileSync(summary, `${report}\n`);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// The job summary is a nicety; the exit code is what matters.
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return failed ? 1 : 0;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
const err = error;
|
|
76
|
+
process.stderr.write(`guard: ${err.message}${err.hint ? `\n${err.hint}` : ''}\n`);
|
|
77
|
+
return 2;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../../src/cli/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;A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,CAAC,EAAE,IAAI,CAAC,CAAC;QAClF,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `playwright-e2e-mcp upload`: send the project's recorded runs to Pro
|
|
3
|
+
* Cloud (PW_MCP_PRO_KEY + PW_MCP_PRO_URL), so CI runs from every machine
|
|
4
|
+
* end up in one history that analyze-history and the dashboard read.
|
|
5
|
+
*
|
|
6
|
+
* Only runs newer than the last upload are sent (remembered in
|
|
7
|
+
* .playwright-e2e-mcp/pro-upload.json); the service also ignores
|
|
8
|
+
* duplicates, so a repeated upload is harmless.
|
|
9
|
+
*
|
|
10
|
+
* Exit codes: 0 uploaded (or nothing new), 1 the upload failed,
|
|
11
|
+
* 2 bad arguments or Pro not configured.
|
|
12
|
+
*/
|
|
13
|
+
export declare const UPLOAD_USAGE: string;
|
|
14
|
+
export declare function runUpload(argv: string[]): Promise<number>;
|