Playwright
Configure Playwright for browser automation and testing in your agentic workflows. Playwright enables headless browser control for accessibility testing, visual regression detection, end-to-end testing, and web scraping.
Configuration Options
Section titled “Configuration Options”Version
Section titled “Version”Pin to a specific version or use the latest:
tools: playwright: version: "1.56.1" # Pin to specific version (default) playwright: version: "latest" # Use latest available versionDefault: 1.56.1 (when version is not specified)
Network Access Configuration
Section titled “Network Access Configuration”Domain access for Playwright is controlled by the top-level network: field. By default, Playwright can only access localhost and 127.0.0.1.
Using Ecosystem Identifiers
Section titled “Using Ecosystem Identifiers”network: allowed: - defaults - playwright # Enables browser downloads - github # For testing GitHub pages - node # For testing Node.js appsCustom Domains
Section titled “Custom Domains”Add specific domains for the sites you want to test:
network: allowed: - defaults - playwright - "example.com" # Matches example.com and subdomains - "*.staging.example.com" # Wildcard for staging environmentsAutomatic subdomain matching: When you allow example.com, all subdomains like api.example.com, www.example.com, and staging.example.com are automatically allowed.
GitHub Actions Compatibility
Section titled “GitHub Actions Compatibility”Playwright runs in a Docker container on GitHub Actions runners. gh-aw automatically applies --security-opt seccomp=unconfined and --ipc=host (required for Chromium) starting with version 0.41.0. No manual configuration is needed.
Browser Support
Section titled “Browser Support”Playwright includes three browser engines: Chromium (Chrome/Edge, most commonly used), Firefox, and WebKit (Safari). All three are available in the Playwright Docker container.
Common Use Cases
Section titled “Common Use Cases”Accessibility Testing
Section titled “Accessibility Testing”---on: schedule: - cron: "0 9 * * *" # Daily at 9 AM
tools: playwright:
network: allowed: - defaults - playwright - "docs.example.com"
permissions: contents: read
safe-outputs: create-issue: title-prefix: "[a11y] " labels: [accessibility, automated] max: 3---
# Accessibility Audit
Use Playwright to check docs.example.com for WCAG 2.1 Level AA compliance.
Run automated accessibility checks using axe-core and report:- Missing alt text on images- Insufficient color contrast- Missing ARIA labels- Keyboard navigation issues
Create an issue for each category of problems found.Visual Regression Testing
Section titled “Visual Regression Testing”---on: pull_request: types: [opened, synchronize]
tools: playwright:
network: allowed: - defaults - playwright - github
permissions: contents: read
safe-outputs: add-comment: max: 1---
# Visual Regression Check
Compare screenshots of the documentation site before and after this PR.
Test on multiple viewports (mobile, tablet, desktop) and report any visual differences.End-to-End Testing
Section titled “End-to-End Testing”---on: workflow_dispatch:
tools: playwright: bash: [":*"]
network: allowed: - defaults - playwright - "localhost"
permissions: contents: read---
# E2E Testing
Start the development server locally and run end-to-end tests with Playwright.
1. Start the dev server on localhost:30002. Test the complete user journey3. Report any failures with screenshotsRelated Documentation
Section titled “Related Documentation”- Tools Reference - All tool configurations
- Network Permissions - Network access control
- Network Configuration Guide - Common network patterns
- Safe Outputs Reference - Configure output creation
- Frontmatter - All frontmatter configuration options