You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
timeout: 120# Playwright navigation on Astro dev server can take >60s; increase to 120s
23
24
playwright:
24
25
version: "v1.56.1"
25
26
bash:
26
27
- "npm install*"
27
-
- "npm run build*"
28
-
- "npm run preview*"
28
+
- "npm run dev*"
29
+
- "npx astro*"
29
30
- "npx playwright*"
30
31
- "curl*"
31
32
- "kill*"
@@ -70,20 +71,19 @@ You are a documentation testing specialist. Your task is to comprehensively test
70
71
71
72
## Your Mission
72
73
73
-
Build the documentation site locally, serve it, and perform comprehensive multi-device testing. Test layout responsiveness, accessibility, interactive elements, and visual rendering across all device types. Use a single Playwright browser instance for efficiency.
74
+
Start the documentation development server and perform comprehensive multi-device testing. Test layout responsiveness, accessibility, interactive elements, and visual rendering across all device types. Use a single Playwright browser instance for efficiency.
74
75
75
-
## Step 1: Build and Serve
76
+
## Step 1: Install Dependencies and Start Server
76
77
77
-
Navigate to the docs folder and build the site:
78
+
Navigate to the docs folder and install dependencies:
78
79
79
80
```bash
80
81
cd${{ github.workspace }}/docs
81
82
npm install
82
-
npm run build
83
83
```
84
84
85
85
Follow the shared **Documentation Server Lifecycle Management** instructions:
86
-
1. Start the preview server (section "Starting the Documentation Preview Server")
86
+
1. Start the dev server (section "Starting the Documentation Preview Server")
87
87
2. Wait for server readiness (section "Waiting for Server Readiness")
88
88
89
89
## Step 2: Device Configuration
@@ -100,10 +100,18 @@ Test these device types based on input `${{ inputs.devices }}`:
100
100
101
101
Playwright is provided through an MCP server interface, **NOT** as an npm package. You must use the MCP Playwright tools:
102
102
103
-
- ✅ **Correct**: Use MCP tools like `mcp__playwright__browser_navigate`, `mcp__playwright__browser_run_code`, etc.
103
+
- ✅ **Correct**: Use `mcp__playwright__browser_run_code` with `page.goto(..., { waitUntil: 'domcontentloaded' })`
104
104
- ❌ **Incorrect**: Do NOT try to `require('playwright')` or create standalone Node.js scripts
105
105
- ❌ **Incorrect**: Do NOT install playwright via npm - it's already available through MCP
106
106
107
+
**⚠️ CRITICAL: Navigation Timeout Prevention**
108
+
109
+
The Astro development server uses Vite, which loads many JavaScript modules per page. Using the default `waitUntil: 'load'` or `waitForLoadState('networkidle')` will cause 60s timeouts because the browser waits for all modules to finish. **Always use `waitUntil: 'domcontentloaded'`** for navigation:
- ✅ **Correct**: `browser_navigate` to `http://${SERVER_IP}:4321/gh-aw/` (use the bridge IP, NOT localhost)
84
+
- ❌ **Incorrect**: Using `http://localhost:4321/...` — Playwright runs with `--network host` so its localhost is the Docker host, not the agent container
85
+
86
+
**⚠️ CRITICAL: Navigation Timeout Prevention**
87
+
88
+
The Astro development server loads many JavaScript modules per page. Always use `waitUntil: 'domcontentloaded'`:
89
+
90
+
```javascript
91
+
// ALWAYS use domcontentloaded - replace SERVER_IP with the actual IP from Step 1
0 commit comments