For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

How to Run Playwright Tests With Agent Skills on TestMu AI


If you use an AI coding assistant, you can skip the manual Playwright project setup and let Agent Skills generate the test automation for you. Agent Skills give the assistant the project structure, dependency versions, and cloud execution patterns it needs to write working Playwright tests on the first pass. You install the skill into your tool's skills directory, set your credentials, then describe the tests you want in natural language.

The Playwright Agent Skill is part of the TestMu AI Agent Skills collection, a set of structured packages that teach AI coding assistants how to write test automation code.

About 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​


Make sure you have an account, your credentials, and a supported assistant before installing the skill.

Installing the Playwright Agent Skill​


Clone the Agent Skills repository, then copy the Playwright skill into your AI tool's skills directory.

Verified
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/
tip

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 so the skill can connect to the grid.

Verified
export LT_USERNAME="YOUR_LAMBDATEST_USERNAME"
export LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"

Running Your First Test Using Agent Skills​


Once the skill is installed, describe the tests you want in natural language and let the assistant generate and run them. Any of the prompts below is enough to get started.

Verified
"Write Playwright tests for the login page and run them on TestMu AI cloud using Chrome and Firefox"
Verified
"Set up a Playwright TypeScript project with Page Object Model and run tests on TestMu AI"
Verified
"Run Playwright tests on real mobile devices on TestMu AI cloud"

The Agent Skill automatically handles:

  1. Project setup - Creates the right folder structure, dependencies, and config files
  2. Language detection - Maps your request to the correct language (TypeScript, JavaScript, Python, Java, or C#)
  3. Execution target - Configures local or TestMu AI cloud execution via CDP WebSocket
  4. Best practices - Uses web-first assertions, accessible locators (getByRole, getByLabel), and Page Object Model

What's Included in the Playwright Skill​


The skill ships as a small set of Markdown files that the assistant reads to build your project. The tree below shows the layout, and the table maps each area of coverage.

Verified
playwright-skill/
├── SKILL.md
└── reference/
├── playbook.md
└── advanced-patterns.md
SectionDetails
Project SetupDependencies, versions, configuration files, project structure
Core PatternsComplete, runnable code examples with web-first assertions
Cloud IntegrationTestMu AI CDP WebSocket connection and capabilities configuration
CI/CD IntegrationGitHub Actions workflows with reporting and parallel execution
Debugging GuideCommon issues mapped to solutions
Best PracticesActionable recommendations for production code

Supported Languages and Frameworks​


The Playwright Agent Skill supports five languages. Several framework docs also reference their own dedicated Agent Skills, listed in the second table below.

Languages​


Pick your language to see which skill applies and where its dedicated doc lives.

LanguageAgent SkillDocumentation
TypeScript (default)playwright-skillTypeScript with Playwright
JavaScriptplaywright-skillJavaScript with Playwright
Javaplaywright-skillJava with Playwright
Pythonplaywright-skillPython with Playwright
C#playwright-skillC# with Playwright

Frameworks With Dedicated Agent Skills​


These test runners ship their own Agent Skills that build on the Playwright skill.

FrameworkAgent SkillDocumentation
Jestjest-skillJest with Playwright
JUnit 5junit-5-skillJUnit with Playwright
CucumberJScucumber-skillCucumberJS with Playwright

Supported AI Tools​


The skill installs into any of the AI coding tools below. Copy it into the installation path that matches your tool.

ToolTypeInstallation Path
Claude CodeCLI.claude/skills/
GitHub CopilotExtension.github/skills/
CursorIDE.cursor/skills/
Gemini CLICLI.gemini/skills/
Codex CLICLI.codex/skills/
OpenCodeCLI.opencode/skills/
Claude.aiWebSettings > Features > Skills

Continue with the guides below to run, scale, and configure Playwright tests on TestMu AI.

Terminal First Testing With Kane CLI

Natural language browser & mobile app tests right from terminal.

×
Schedule Your Personal Demo
Kane CLI terminal

Help and Support

Related Articles