playwright-generate-test

Generates Playwright tests by driving scenarios live with playwright-cli.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/balajirags/aifsd-kit --skill playwright-generate-test-balajirags
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-generate-test
Source: https://github.com/balajirags/aifsd-kit/tree/main/docs/skills/playwright-generate-test
Command: npx skills add https://github.com/balajirags/aifsd-kit --skill playwright-generate-test-balajirags

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test.

What problem does it solve? Writing Playwright tests by hand requires manually inspecting page structure, guessing selectors, and debugging flaky locators. This Skill removes that guesswork by driving the scenario live in a real browser first, then generating a test grounded in what actually happened. ## Core Features & Use Cases - Live scenario execution: Runs each step of your scenario one by one using playwright-cli commands (open, goto, snapshot, click, fill, type) against a real browser session. - Grounded test generation: Emits a Playwright TypeScript test using @playwright/test based on the actual interaction history, not assumptions about the page. - Self-verifying output: Saves the generated test to the tests directory, executes it, and iterates until the test passes. - Use Case: You need an end-to-end test for a checkout flow. Describe the scenario, watch the agent click through it live, and receive a passing Playwright test file without writing selectors yourself. ## Quick Start Ask the agent to generate a Playwright test for your scenario, for example: generate a Playwright test for logging in with valid credentials and verifying the dashboard loads.

Frequently Asked Questions about playwright-generate-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Playwright test from a scenario?

Provide a natural-language scenario and the agent drives it live using playwright-cli commands like open, snapshot, click, and fill. After all steps complete, it emits a TypeScript test using @playwright/test based on the recorded interaction history.

How to create Playwright tests without writing selectors manually?

This Skill drives the scenario in a real browser session first, capturing actual page state through snapshots. The generated test reflects real interactions rather than guessed selectors, reducing manual locator work.

Does the generated Playwright test get verified automatically?

Yes. The generated test file is saved into the tests directory, executed, and iterated on until it passes. The Skill does not stop at code generation; it confirms the test runs successfully.

What happens if I don't provide a test scenario?

The Skill will ask you to provide one. It does not generate test code prematurely or based on assumptions, since every step must be executed live before the test is written.

What are the limitations of generating tests from live browser sessions?

The generated test only covers the exact scenario executed during the session, so edge cases and alternate paths require separate scenarios. It also depends on the target application being reachable and behaving consistently during execution.