Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 23 additions & 47 deletions .github/workflows/blog-auditor.lock.yml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions .github/workflows/blog-auditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ network:
tools:
cli-proxy: true
playwright:
mode: cli

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Good addition of mode: cli to the playwright config. This switches from the Docker-based MCP server to the lightweight CLI approach, reducing container overhead.

bash:
- "date *"
- "echo *"
Expand Down Expand Up @@ -54,8 +55,8 @@ Verify that the GitHub Next Agentic Workflows blog page is available, accessible

Use Playwright to navigate to the target URL and capture the accessibility snapshot:

1. **Navigate to URL**: Use `browser_navigate` to load https://githubnext.com/projects/agentic-workflows/
2. **Capture Accessibility Snapshot**: Use `browser_snapshot` to get the accessibility tree representation of the page
1. **Navigate to URL**: Run `playwright-cli browser_navigate --url https://githubnext.com/projects/agentic-workflows/` to load the page

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use playwright-cli browser_navigate --url <url> instead of browser_navigate. This aligns with the new CLI mode usage pattern. Looks correct!

2. **Capture Accessibility Snapshot**: Run `playwright-cli browser_snapshot` to get the accessibility tree representation of the page
- This provides a text-only version of the page as screen readers would see it
- Captures the semantic structure and content without styling
3. **Extract Metrics**: From the navigation and snapshot, capture:
Expand Down Expand Up @@ -95,7 +96,7 @@ Perform the following validations:

Extract code snippets from the blog page and validate them against the latest agentic workflow schema:

1. **Extract Code Snippets**: Use Playwright's `browser_evaluate` to extract all code blocks from the page
1. **Extract Code Snippets**: Use `playwright-cli browser_evaluate` to extract all code blocks from the page
- Look for `<code>` elements with language hints for YAML or markdown
- Extract the text content of each code block
- Filter to only workflow-related snippets (those containing frontmatter with `---` markers AND at least one of these workflow fields: `on:`, `engine:`, `tools:`, `permissions:`, `safe-outputs:`)
Expand Down
71 changes: 24 additions & 47 deletions .github/workflows/cloclo.lock.yml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions .github/workflows/cloclo.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tools:
agentic-workflows:
edit:
playwright:
mode: cli
bash: true
cache-memory:
key: cloclo-memory-${{ github.workflow }}
Expand Down Expand Up @@ -99,7 +100,7 @@ ${{ steps.sanitized.outputs.text }}
You have access to:
1. **Serena MCP**: Static analysis and code intelligence capabilities
2. **gh-aw MCP**: GitHub Agentic Workflows introspection and management
3. **Playwright**: Browser automation for web interaction
3. **Playwright**: Browser automation via CLI (`playwright-cli <command>` in bash)
4. **JQ Schema**: JSON structure discovery tool at `/tmp/gh-aw/jqschema.sh`
5. **Cache Memory**: Persistent memory storage at `/tmp/gh-aw/cache-memory/` for multi-step reasoning
6. **Edit Tool**: For file creation and modification
Expand All @@ -117,7 +118,7 @@ Analyze the comment content above and determine what action the user is requesti
5. **ALWAYS add a glamorous comment** on the original conversation thread with a summary of changes made (using the `add-comment` safe output)

### If Web Automation Is Needed:
1. Use **Playwright** to interact with web pages
1. Use **Playwright CLI** (`playwright-cli` in bash) to interact with web pages
2. Gather required information
3. **ALWAYS add a comment** with your findings and summary

Expand Down
70 changes: 23 additions & 47 deletions .github/workflows/daily-multi-device-docs-tester.lock.yml

Large diffs are not rendered by default.

48 changes: 17 additions & 31 deletions .github/workflows/daily-multi-device-docs-tester.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tools:
cli-proxy: true
timeout: 120 # Playwright navigation on Astro dev server can take >60s; increase to 120s
playwright:
mode: cli
version: "v1.56.1"
bash:
- "npm install*"
Expand Down Expand Up @@ -79,7 +80,7 @@ You are a documentation testing specialist. Your task is to comprehensively test
2. The docs folder is at: `${{ github.workspace }}/docs`
3. Use absolute paths or change directory explicitly
4. Keep token usage low by being efficient with your code and minimizing iterations
5. **Playwright is available via MCP tools only** - do NOT try to `require('playwright')` or install it via npm
5. **Playwright is available as `playwright-cli` commands in bash** — use `playwright-cli <command>` to automate the browser

## Your Mission

Expand Down Expand Up @@ -108,47 +109,32 @@ Test these device types based on input `${{ inputs.devices }}`:

## Step 3: Run Playwright Tests

**IMPORTANT: Using Playwright in gh-aw Workflows**
**Using Playwright in gh-aw Workflows (CLI mode)**

Playwright is provided through an MCP server interface, **NOT** as an npm package. You must use the MCP Playwright tools:
Playwright is pre-installed as `@playwright/cli`. Use `playwright-cli <command>` in bash — no MCP tools or Docker container is involved:

- ✅ **Correct**: Use `mcp__playwright__browser_run_code` with `page.goto(..., { waitUntil: 'domcontentloaded' })`
- ✅ **Correct**: `playwright-cli browser_navigate --url "http://localhost:4321/gh-aw/"`
- ✅ **Correct**: Use `playwright-cli browser_run_code --code "async (page) => { ... }"` for custom Playwright code
- ❌ **Incorrect**: Do NOT try to `require('playwright')` or create standalone Node.js scripts
- ❌ **Incorrect**: Do NOT install playwright via npm - it's already available through MCP
- ❌ **Incorrect**: Do NOT use `mcp__playwright__*` tool names — those are the deprecated MCP mode

**⚠️ CRITICAL: Navigation Timeout Prevention**

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**: `page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 })`
- ❌ **Never use**: `page.waitForLoadState('networkidle')` — causes guaranteed timeouts
- ❌ **Never use**: `mcp__playwright__browser_navigate` for first load — it uses default 'load' wait which times out

**Example Usage:**
The Astro development server uses Vite, which loads many JavaScript modules per page. Using the default `waitUntil: 'load'` will cause 60s timeouts because the browser waits for all modules to finish. **Use `waitUntil: 'domcontentloaded'`** for navigation:

```bash
# First, get the container's bridge IP (needed for Playwright - see shared lifecycle instructions)
SERVER_IP=$(ip -4 route get 1.1.1.1 2>/dev/null | awk '{print $7; exit}')
if [ -z "$SERVER_IP" ]; then SERVER_IP=$(hostname -I | awk '{print $1}'); fi
echo "Playwright server URL: http://${SERVER_IP}:4321/gh-aw/"
playwright-cli browser_run_code --code "async (page) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto('http://localhost:4321/gh-aw/', { waitUntil: 'domcontentloaded', timeout: 30000 });
return { url: page.url(), title: await page.title() };
}"
```

```javascript
// Use browser_run_code to execute Playwright commands.
// IMPORTANT: Replace 172.30.0.20 below with the actual SERVER_IP from the bash command above.
// Do NOT use "localhost" — Playwright runs with --network host so its localhost differs.
// ALWAYS use waitUntil: 'domcontentloaded' to prevent timeout on the Vite dev server.
mcp__playwright__browser_run_code({
code: `async (page) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto('http://172.30.0.20:4321/gh-aw/', { waitUntil: 'domcontentloaded', timeout: 30000 }); // substitute actual SERVER_IP
return { url: page.url(), title: await page.title() };
}`
})
```
- ✅ **Use `localhost` directly** — playwright-cli runs on the runner, so `localhost` reaches the dev server
- ❌ **Do NOT use bridge IP detection** — that is only needed in the deprecated MCP mode

For each device viewport, use Playwright MCP tools to:
- Set viewport size and navigate to `http://${SERVER_IP}:4321/gh-aw/` (substitute the bridge IP you obtained above, NOT localhost)
For each device viewport, use playwright-cli to:
- Set viewport size and navigate to `http://localhost:4321/gh-aw/`
- Take screenshots and run accessibility audits
- Test interactions (navigation, search, buttons)
- Check for layout issues (overflow, truncation, broken layouts)
Expand Down
Loading
Loading