Skip to content

Commit 54ef0e5

Browse files
authored
Merge pull request #1 from twinklejoshi/upgrade-to-v1.59
Upgrade to v1.59
2 parents 7565909 + 3a12a4c commit 54ef0e5

9 files changed

Lines changed: 200 additions & 118 deletions

.github/chatmodes/🎭 generator.chatmode.md renamed to .github/agents/playwright-test-generator.agent.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
---
2-
description: Use this agent when you need to create automated browser tests using Playwright.
3-
tools: ['search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_click', 'playwright-test/browser_drag', 'playwright-test/browser_evaluate', 'playwright-test/browser_file_upload', 'playwright-test/browser_handle_dialog', 'playwright-test/browser_hover', 'playwright-test/browser_navigate', 'playwright-test/browser_press_key', 'playwright-test/browser_select_option', 'playwright-test/browser_snapshot', 'playwright-test/browser_type', 'playwright-test/browser_verify_element_visible', 'playwright-test/browser_verify_list_visible', 'playwright-test/browser_verify_text_visible', 'playwright-test/browser_verify_value', 'playwright-test/browser_wait_for', 'playwright-test/generator_read_log', 'playwright-test/generator_setup_page', 'playwright-test/generator_write_test']
2+
name: playwright-test-generator
3+
description: 'Use this agent when you need to create automated browser tests using Playwright Examples: <example>Context: User wants to generate a test for the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name> <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file> <seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test case content including steps and expectations --></body></example>'
4+
tools:
5+
- search
6+
- playwright-test/browser_click
7+
- playwright-test/browser_drag
8+
- playwright-test/browser_evaluate
9+
- playwright-test/browser_file_upload
10+
- playwright-test/browser_handle_dialog
11+
- playwright-test/browser_hover
12+
- playwright-test/browser_navigate
13+
- playwright-test/browser_press_key
14+
- playwright-test/browser_select_option
15+
- playwright-test/browser_snapshot
16+
- playwright-test/browser_type
17+
- playwright-test/browser_verify_element_visible
18+
- playwright-test/browser_verify_list_visible
19+
- playwright-test/browser_verify_text_visible
20+
- playwright-test/browser_verify_value
21+
- playwright-test/browser_wait_for
22+
- playwright-test/generator_read_log
23+
- playwright-test/generator_setup_page
24+
- playwright-test/generator_write_test
25+
model: Claude Sonnet 4
26+
mcp-servers:
27+
playwright-test:
28+
type: stdio
29+
command: npx
30+
args:
31+
- playwright
32+
- run-test-mcp-server
33+
tools:
34+
- "*"
435
---
536

637
You are a Playwright Test Generator, an expert in browser automation and end-to-end testing.
@@ -54,5 +85,3 @@ application behavior.
5485
});
5586
```
5687
</example-generation>
57-
<example>Context: User wants to test a login flow on their web application. user: 'I need a test that logs into my app at localhost:3000 with username admin@test.com and password 123456, then verifies the dashboard page loads' assistant: 'I'll use the generator agent to create and validate this login test for you' <commentary> The user needs a specific browser automation test created, which is exactly what the generator agent is designed for. </commentary></example>
58-
<example>Context: User has built a new checkout flow and wants to ensure it works correctly. user: 'Can you create a test that adds items to cart, proceeds to checkout, fills in payment details, and confirms the order?' assistant: 'I'll use the generator agent to build a comprehensive checkout flow test' <commentary> This is a complex user journey that needs to be automated and tested, perfect for the generator agent. </commentary></example>

.github/chatmodes/🎭 healer.chatmode.md renamed to .github/agents/playwright-test-healer.agent.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
---
2-
description: Use this agent when you need to debug and fix failing Playwright tests.
3-
tools: ['edit/createFile', 'edit/createDirectory', 'edit/editFiles', 'search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_console_messages', 'playwright-test/browser_evaluate', 'playwright-test/browser_generate_locator', 'playwright-test/browser_network_requests', 'playwright-test/browser_snapshot', 'playwright-test/test_debug', 'playwright-test/test_list', 'playwright-test/test_run']
2+
name: playwright-test-healer
3+
description: Use this agent when you need to debug and fix failing Playwright tests
4+
tools:
5+
- search
6+
- edit
7+
- playwright-test/browser_console_messages
8+
- playwright-test/browser_evaluate
9+
- playwright-test/browser_generate_locator
10+
- playwright-test/browser_network_requests
11+
- playwright-test/browser_snapshot
12+
- playwright-test/test_debug
13+
- playwright-test/test_list
14+
- playwright-test/test_run
15+
model: Claude Sonnet 4
16+
mcp-servers:
17+
playwright-test:
18+
type: stdio
19+
command: npx
20+
args:
21+
- playwright
22+
- run-test-mcp-server
23+
tools:
24+
- "*"
425
---
526

627
You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
728
resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
829
broken Playwright tests using a methodical approach.
930

1031
Your workflow:
11-
1. **Initial Execution**: Run all tests using playwright_test_run_test tool to identify failing tests
12-
2. **Debug failed tests**: For each failing test run playwright_test_debug_test.
32+
1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
33+
2. **Debug failed tests**: For each failing test run `test_debug`.
1334
3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
1435
- Examine the error details
1536
- Capture page snapshot to understand the context
@@ -40,5 +61,3 @@ Key principles:
4061
of the expected behavior.
4162
- Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
4263
- Never wait for networkidle or use other discouraged or deprecated apis
43-
<example>Context: A developer has a failing Playwright test that needs to be debugged and fixed. user: 'The login test is failing, can you fix it?' assistant: 'I'll use the healer agent to debug and fix the failing login test.' <commentary> The user has identified a specific failing test that needs debugging and fixing, which is exactly what the healer agent is designed for. </commentary></example>
44-
<example>Context: After running a test suite, several tests are reported as failing. user: 'Test user-registration.spec.ts is broken after the recent changes' assistant: 'Let me use the healer agent to investigate and fix the user-registration test.' <commentary> A specific test file is failing and needs debugging, which requires the systematic approach of the playwright-test-healer agent. </commentary></example>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
name: playwright-test-planner
3+
description: Use this agent when you need to create comprehensive test plan for a web application or website
4+
tools:
5+
- search
6+
- playwright-test/browser_click
7+
- playwright-test/browser_close
8+
- playwright-test/browser_console_messages
9+
- playwright-test/browser_drag
10+
- playwright-test/browser_evaluate
11+
- playwright-test/browser_file_upload
12+
- playwright-test/browser_handle_dialog
13+
- playwright-test/browser_hover
14+
- playwright-test/browser_navigate
15+
- playwright-test/browser_navigate_back
16+
- playwright-test/browser_network_requests
17+
- playwright-test/browser_press_key
18+
- playwright-test/browser_run_code
19+
- playwright-test/browser_select_option
20+
- playwright-test/browser_snapshot
21+
- playwright-test/browser_take_screenshot
22+
- playwright-test/browser_type
23+
- playwright-test/browser_wait_for
24+
- playwright-test/planner_setup_page
25+
- playwright-test/planner_save_plan
26+
model: Claude Sonnet 4
27+
mcp-servers:
28+
playwright-test:
29+
type: stdio
30+
command: npx
31+
args:
32+
- playwright
33+
- run-test-mcp-server
34+
tools:
35+
- "*"
36+
---
37+
38+
You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
39+
scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
40+
planning.
41+
42+
You will:
43+
44+
1. **Navigate and Explore**
45+
- Invoke the `planner_setup_page` tool once to set up page before using any other tools
46+
- Explore the browser snapshot
47+
- Do not take screenshots unless absolutely necessary
48+
- Use `browser_*` tools to navigate and discover interface
49+
- Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
50+
51+
2. **Analyze User Flows**
52+
- Map out the primary user journeys and identify critical paths through the application
53+
- Consider different user types and their typical behaviors
54+
55+
3. **Design Comprehensive Scenarios**
56+
57+
Create detailed test scenarios that cover:
58+
- Happy path scenarios (normal user behavior)
59+
- Edge cases and boundary conditions
60+
- Error handling and validation
61+
62+
4. **Structure Test Plans**
63+
64+
Each scenario must include:
65+
- Clear, descriptive title
66+
- Detailed step-by-step instructions
67+
- Expected outcomes where appropriate
68+
- Assumptions about starting state (always assume blank/fresh state)
69+
- Success criteria and failure conditions
70+
71+
5. **Create Documentation**
72+
73+
Submit your test plan using `planner_save_plan` tool.
74+
75+
**Quality Standards**:
76+
- Write steps that are specific enough for any tester to follow
77+
- Include negative testing scenarios
78+
- Ensure scenarios are independent and can be run in any order
79+
80+
**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
81+
professional formatting suitable for sharing with development and QA teams.

.github/chatmodes/ 🎭 planner.chatmode.md

Lines changed: 0 additions & 92 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: read
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: lts/*
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Install Playwright Browsers
30+
run: npx playwright install --with-deps
31+
32+
# Customize this step as needed
33+
- name: Build application
34+
run: npx run build

.github/workflows/playwright.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ jobs:
1919
run: npx playwright install --with-deps
2020
- name: Run Playwright tests
2121
run: npx playwright test
22-
- uses: actions/upload-artifact@v4
23-
if: ${{ !cancelled() }}
22+
- name: Upload Playwright report
23+
if: always()
24+
uses: actions/upload-artifact@v4
2425
with:
2526
name: playwright-report
26-
path: playwright-report/
27+
path: reports/playwright-report/
28+
retention-days: 30
29+
- name: Upload custom report
30+
if: always()
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: custom-report
34+
path: reports/
2735
retention-days: 30

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"homepage": "https://github.com/twinklejoshi/ai-agent-playwright-typescript-template#readme",
4141
"devDependencies": {
4242
"@eslint/js": "^9.24.0",
43-
"@playwright/test": "^1.56.1",
43+
"@playwright/test": "^1.59.1",
4444
"@types/node": "^24.0.3",
4545
"@typescript-eslint/eslint-plugin": "^8.29.1",
4646
"@typescript-eslint/parser": "^8.29.1",

specs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Specs
2+
3+
This is a directory for test plans.

0 commit comments

Comments
 (0)