bdd-playwright-pom

Creates and refactors tests using Vitest, Supertest, Cucumber, and Playwright with Page Object Models.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/kainos-academy-2026/team4-frontend --skill bdd-playwright-pom-kainos-academy-2026
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bdd-playwright-pom
Source: https://github.com/kainos-academy-2026/team4-frontend/tree/main/.github/skills/bdd-playwright-pom
Command: npx skills add https://github.com/kainos-academy-2026/team4-frontend --skill bdd-playwright-pom-kainos-academy-2026

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and refactoring tests often leads to inconsistent frameworks, duplicated locator logic, and directory sprawl. This Skill enforces the repository's existing test conventions while guiding the creation of unit, integration, and browser BDD tests. ## Core Features & Use Cases - Framework-aware test authoring: Selects Vitest, Supertest, or Cucumber plus Playwright based on the repo's existing stack and the behavior under test. - Page Object Model discipline: Reuses or extends existing POMs, keeps locator logic out of step definitions, and asks before creating new POM files. - Convention-preserving refactoring: Reworks existing tests while preserving behavior, naming, and directory layout. - Use Case: When asked to add browser coverage for a registration flow, it inspects the repo, writes the Cucumber feature first, then step definitions, then extends the relevant POM, and runs the narrow validation command. ## Quick Start Create a Cucumber and Playwright BDD test for the registration flow using the existing Page Object Models in this repository.

Frequently Asked Questions about bdd-playwright-pom

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

FAQPage Schema
How do I write Cucumber and Playwright BDD tests with Page Object Models?

Write the feature file first in business-readable Given/When/Then language, then create matching step definitions, then add or extend POM methods the steps call. Step files should call POM methods instead of raw page locators whenever a suitable POM exists.

How do I convert raw Playwright locator tests to Page Object Models?

Move duplicated locator logic into POM methods on the existing page class, then update the tests or steps to call those methods. If no relevant POM exists for the page, the Skill pauses and asks for permission before creating a new POM file.

When should I use Vitest or Supertest instead of Playwright for testing?

Use Vitest for unit tests and view, controller, or service coverage, and Supertest for Express HTTP route and app integration behavior. Reserve Cucumber plus Playwright for browser-driven end-to-end flows that genuinely benefit from BDD.

What locator strategies should Playwright tests use?

Prefer getByRole first, then getByLabel, then getByTestId, and avoid XPath unless no robust semantic locator exists. Use row-scoped or container-scoped assertions to prevent strict mode collisions and strict URL expectations to avoid false positives.

When should I not use browser BDD tests?

Avoid browser automation for pure API tests with no page interaction, non-testing infrastructure work, and scenarios that can be covered cleanly without a browser. Do not introduce a second test framework when the repo already has a clear local convention.