playwright-test-agent 0.2.4 → 0.2.5
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/package.json
CHANGED
|
@@ -5,7 +5,7 @@ description: Use first when a user asks to investigate or test a website, browse
|
|
|
5
5
|
|
|
6
6
|
# Playwright Test Agent
|
|
7
7
|
|
|
8
|
-
Use Planner -> Generator -> execute -> Healer (only on failure) for durable tests. Follow the platform routing defined by the project's `AGENTS.md` or `CLAUDE.md`.
|
|
8
|
+
Use Planner -> Generator -> execute -> Healer (only on failure) for durable tests. Follow the platform routing defined by the project's `AGENTS.md` or `CLAUDE.md`. Planner, Generator, and Healer must run as their configured role agents; the orchestrating agent performs only the documented preparation, handoffs, user confirmation, and required test-suite execution.
|
|
9
9
|
|
|
10
10
|
## Required phase handoff
|
|
11
11
|
|
|
@@ -61,4 +61,4 @@ Run from the target project:
|
|
|
61
61
|
npx playwright-test-agent init
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
The command globally installs `@playwright/cli`, installs the Playwright CLI skills and browser, initializes Playwright Test agents, and reinjects CLI-first instructions into all generated role definitions. Run it again after Playwright updates regenerate those definitions. Restart the host agent after initialization so global skills and changed definitions are reloaded.
|
|
64
|
+
The command globally installs `@playwright/cli`, installs the Playwright CLI skills and browser, initializes Playwright Test agents, configures Codex and Claude Code to dispatch the three generated role agents, and reinjects CLI-first instructions into all generated role definitions. Run it again after Playwright updates regenerate those definitions. Restart the host agent after initialization so global skills and changed definitions are reloaded.
|
|
@@ -26,14 +26,14 @@ const CODEX_INSTRUCTIONS = `${BLOCK_START}
|
|
|
26
26
|
Codex routing is mandatory for website, browser workflow, HTTP API, or application-feature testing:
|
|
27
27
|
|
|
28
28
|
1. Load \`.agents/skills/playwright-test-agent/SKILL.md\`.
|
|
29
|
-
2. Before Planner, the main agent may read relevant local project information and ask for information that materially affects the test, such as the deployed URL, account or role, expected behavior, environment, and authorization boundary. Do not perform a seed/config/generated-file audit or open the website during preparation.
|
|
30
|
-
3.
|
|
31
|
-
4. Planner
|
|
32
|
-
5.
|
|
33
|
-
6. After
|
|
34
|
-
7. If every generated test passes, report the result. If any generated test fails,
|
|
29
|
+
2. Before starting Planner, the main agent may read relevant local project information and ask for information that materially affects the test, such as the deployed URL, account or role, expected behavior, environment, and authorization boundary. Do not perform a seed/config/generated-file audit or open the website during preparation.
|
|
30
|
+
3. Once the required context is available, directly start a subagent with \`agent_type: "playwright_test_planner"\`, passing the objective, deployed URL, supplied access information, relevant project context, and constraints. The main agent must not perform Planner work, open or inspect the website, or call \`playwright-cli\`, browser MCP tools, Chrome DevTools, or another browser integration.
|
|
31
|
+
4. Planner opens and investigates the website with \`playwright-cli\`, converts its findings into a complete Markdown test plan under \`specs/\`, and returns the saved plan path. After Planner returns, show that plan to the user and wait for explicit confirmation; investigation alone is not completion.
|
|
32
|
+
5. Only after confirmation, directly start a subagent with \`agent_type: "playwright_test_generator"\`, passing the confirmed plan. Generator validates the confirmed scenarios with \`playwright-cli\`, writes executable Playwright test files, and returns their paths.
|
|
33
|
+
6. After Generator returns, the main agent must execute the generated tests with \`npx playwright test\`. Generating test files alone never completes the workflow.
|
|
34
|
+
7. If every generated test passes, report the result. If any generated test fails, directly start a subagent with \`agent_type: "playwright_test_healer"\`, passing the failed test names, failure output, confirmed plan, and generated file paths. Healer diagnoses and patches justified test defects and reruns the affected tests until they pass or it identifies a genuine application/environment/product blocker. Never report generated-but-unexecuted tests as passing.
|
|
35
35
|
|
|
36
|
-
Ask only for information that is necessary or could materially change scope, assertions, access, or safety. Do not guess
|
|
36
|
+
Start each role as its configured subagent and never make the main agent perform that role. Do not create a nested or same-role intermediary. Do not locate a seed file or make setup-file discovery a prerequisite to Planner. If exploration finds missing, incorrect, or contradictory required information, let Planner pause and return the precise question; after the user answers, resume the same Planner subagent when possible, or restart it with that answer and the blocking observation. Ask only for information that is necessary or could materially change scope, assertions, access, or safety. Do not guess.
|
|
37
37
|
|
|
38
38
|
${BLOCK_END}`;
|
|
39
39
|
|