playwright-validator

Generate and run Playwright tests from OpenSpec WHEN/THEN scenarios.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/jankneumann/agentic-assistant --skill playwright-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-validator
Source: https://github.com/jankneumann/agentic-assistant/tree/main/.agents/skills/playwright-validator
Command: npx skills add https://github.com/jankneumann/agentic-assistant --skill playwright-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jsonschema, pyyaml, and includes scripts (resource) components.

What problem does it solve?

It turns OpenSpec scenario requirements into executable Playwright checks so you can quickly verify that real frontend behavior matches expected click-and-assert flows.

Core Features & Use Cases

  • Generates Playwright tests from OpenSpec: Reads openspec/changes/<id>/specs/**/*.md scenario blocks and translates WHEN/THEN bullets into deterministic Playwright actions and assertions.
  • Runs against a real frontend descriptor: Uses evaluation/gen_eval/descriptors/<id>.yaml for selector aliases, auth-flow steps, browser matrix, viewport, and base URL.
  • Emits behavioral_failure findings: Produces openspec/changes/<id>/findings-playwright.json that trace failures back to the originating OpenSpec spec.md and line ranges.
  • Safe, fail-fast execution: Validates auth-flow required environment variables before launching any browser, and enforces localhost bind invariants for startup commands.

Quick Start

Run the validator for your change-id and descriptor so it generates and executes Playwright tests, then writes findings-playwright.json.

Frequently Asked Questions about playwright-validator

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

FAQPage Schema
How do I generate Playwright tests from OpenSpec scenarios?

Playwright tests are generated from OpenSpec scenarios by reading WHEN/THEN bullet blocks in spec.md files and translating them into deterministic browser actions and assertions. It requires a compatible frontend descriptor YAML defining selectors and auth-flow steps.

How does behavioral testing validate frontend changes against OpenSpec?

Behavioral testing validates frontend changes by running generated Playwright tests against a deployed frontend using a descriptor YAML. It checks real UI behavior against expected click-and-assert flows and emits a findings JSON file tracing failures back to originating spec line ranges.

Do I need a frontend descriptor YAML to run Playwright validation?

Yes, you need a frontend descriptor YAML to run Playwright validation. The descriptor provides essential configuration including selector aliases, auth-flow steps, browser matrix, viewport dimensions, and the base URL required to execute the behavioral checks.

What format does the Playwright validator output for test findings?

The Playwright validator outputs findings in a JSON file named findings-playwright.json. This file conforms to the openspec review-findings schema and traces behavioral failures directly back to the originating OpenSpec spec.md file and line ranges.

Why does Playwright test generation fail fast on missing environment variables?

Playwright test generation fails fast on missing environment variables to ensure safe execution before launching any browser. It validates required auth-flow environment variables upfront and enforces localhost bind invariants for startup commands to prevent unauthorized or invalid connections.