playwright-test-agent 0.2.2 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-test-agent",
3
- "version": "0.2.2",
3
+ "version": "0.2.5",
4
4
  "description": "Initialize Playwright Test agents with a Playwright CLI-first browser workflow.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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 -> Healer for durable tests. `AGENTS.md` or `CLAUDE.md` defines the platform-specific role routing. The role that owns the current phase uses `playwright-cli`; the parent does not perform another role's browser work.
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
 
@@ -17,7 +17,7 @@ Use Planner -> Generator -> Healer for durable tests. `AGENTS.md` or `CLAUDE.md`
17
17
 
18
18
  Every phase is required in that order. Planner exploration without a saved plan is incomplete. Generator output without test files is incomplete. Generated test files that have not been executed are not a successful test result. Healer must never start before a real generated-test failure exists.
19
19
 
20
- On Claude Code, the parent must start `playwright-test-planner`; only that Planner may open the website. The parent must not call `playwright-cli`, Chrome DevTools, browser MCP tools, or another browser integration. On Codex, the main agent does not spawn a Playwright subagent; it explicitly assumes one phase at a time, and may call CLI only while acting in that phase. Preserve the official Playwright Test MCP configuration and role tools; CLI is the preferred live-browser path and prevents missing MCP tools from blocking the workflow.
20
+ Preserve the official Playwright Test MCP configuration and role tools. Use `playwright-cli` as the preferred live-browser path when the role instructions select it; missing optional MCP tools must not block a role when the CLI can perform the same work.
21
21
 
22
22
  Before Planner, the parent may read relevant local project information to understand routes, requirements, fixtures, and constraints. It may ask for information that is necessary or could materially change the test purpose, scope, assertions, access, or safety, such as the deployed URL, account or role, expected behavior, target environment, allowed data mutations, and authorization boundary. Keep this preparation focused: do not locate a seed file or turn config, test-directory, agent-definition, fixture, or generated-file discovery into a prerequisite.
23
23
 
@@ -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 its Codex/Claude skills and browser, initializes Playwright Test agents, and reinjects CLI-first instructions into all six generated role definitions. Run it again after Playwright updates regenerate those definitions. Restart Codex or Claude Code 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. Do not start Playwright subagents. Once the required context is available, the main agent explicitly assumes the Planner role in this session.
31
- 4. Planner's first live browser action is \`playwright-cli open <url>\`. Prefer CLI while preserving the generated Playwright Test MCP configuration and tools. Do not call Chrome DevTools or an unrelated browser integration.
32
- 5. Planner must convert its investigation into a complete Markdown test plan under \`specs/\`. Show that saved plan to the user and wait for explicit confirmation; investigation alone is not completion.
33
- 6. After confirmation, assume Generator and generate executable Playwright test code for the confirmed plan. When generation finishes, execute the generated tests with \`npx playwright test\`; generating files alone is not completion.
34
- 7. If every generated test passes, report the result. If any generated test fails, assume Healer with the failed test names and output; diagnose, patch, and rerun until the tests pass or a genuine application/environment/product blocker is identified. Never skip execution and never report generated-but-unexecuted tests as passing.
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 or create nested agents.
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