Run Your Playwright Tests Using Agent Skills
Instead of manually setting up your Playwright project, you can use Agent Skills to let your AI coding assistant generate production-ready Playwright test automation for you.
The playwright-skill is part of TestMu AI Agent Skills - structured packages that teach AI coding assistants how to write production-grade test automation code.
What Are Agent Skills?
Agent Skills are self-contained packages of instructions, code patterns, debugging guides, and CI/CD configurations for specific testing frameworks. Once installed, your AI assistant works like a Senior QA automation architect with knowledge of:
- Proper project structure for each framework
- Correct dependency versions and configurations
- Both local and TestMu AI cloud execution patterns
- Common pitfalls and debugging approaches
- CI/CD integration with GitHub Actions
Prerequisites
- A TestMu AI account. If you don't have one, sign up for free.
- Your TestMu AI Username and Access Key from the Automation Dashboard.
- An AI coding assistant: Claude Code, GitHub Copilot, Cursor, Gemini CLI, or any compatible tool.
Installing the Playwright Agent Skill
Clone the repository and copy the Playwright skill into your AI tool's skills directory:
git clone https://github.com/LambdaTest/agent-skills.git
# For Claude Code
cp -r agent-skills/playwright-skill .claude/skills/
# For Cursor
cp -r agent-skills/playwright-skill .cursor/skills/
# For GitHub Copilot
cp -r agent-skills/playwright-skill .github/skills/
# For Gemini CLI
cp -r agent-skills/playwright-skill .gemini/skills/
If you prefer installing all available framework skills, clone the repository directly into your tool's skills directory (e.g., .claude/skills/, .cursor/skills/).
Set Up Your Authentication
Configure your TestMu AI credentials as environment variables:
export LT_USERNAME="YOUR_LAMBDATEST_USERNAME"
export LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"
Running Your First Test Using Agent Skills
Once installed, simply ask your AI assistant to write tests in natural language:
"Write Playwright tests for the login page and run them on TestMu AI cloud using Chrome and Firefox"
"Set up a Playwright TypeScript project with Page Object Model and run tests on TestMu AI"
"Run Playwright tests on real mobile devices on TestMu AI cloud"
The Agent Skill automatically handles:
- Project setup - Creates the right folder structure, dependencies, and config files
- Language detection - Maps your request to the correct language (TypeScript, JavaScript, Python, Java, or C#)
- Execution target - Configures local or TestMu AI cloud execution via CDP WebSocket
- Best practices - Uses web-first assertions, accessible selectors (
getByRole,getByLabel), and Page Object Model
What's Included in the Playwright Skill
playwright-skill/
├── SKILL.md
└── reference/
├── playbook.md
└── advanced-patterns.md
| Section | Details |
|---|---|
| Project Setup | Dependencies, versions, configuration files, project structure |
| Core Patterns | Complete, runnable code examples with web-first assertions |
| Cloud Integration | TestMu AI CDP WebSocket connection and capabilities configuration |
| CI/CD Integration | GitHub Actions workflows with reporting and parallel execution |
| Debugging Guide | Common issues mapped to solutions |
| Best Practices | Actionable recommendations for production code |
Supported Languages and Frameworks
The Playwright Agent Skill supports 5 languages. The following framework docs also reference their own dedicated Agent Skills:
Languages
| Language | Agent Skill | Documentation |
|---|---|---|
| TypeScript (default) | playwright-skill | TypeScript with Playwright |
| JavaScript | playwright-skill | JavaScript with Playwright |
| Java | playwright-skill | Java with Playwright |
| Python | playwright-skill | Python with Playwright |
| C# | playwright-skill | C# with Playwright |
Frameworks with Dedicated Agent Skills
| Framework | Agent Skill | Documentation |
|---|---|---|
| Jest | jest-skill | Jest with Playwright |
| JUnit 5 | junit-5-skill | JUnit with Playwright |
| CucumberJS | cucumber-skill | CucumberJS with Playwright |
Supported AI Tools
| Tool | Type | Installation Path |
|---|---|---|
| Claude Code | CLI | .claude/skills/ |
| GitHub Copilot | Extension | .github/skills/ |
| Cursor | IDE | .cursor/skills/ |
| Gemini CLI | CLI | .gemini/skills/ |
| Codex CLI | CLI | .codex/skills/ |
| OpenCode | CLI | .opencode/skills/ |
| Claude.ai | Web | Settings > Features > Skills |
