pom-conventions

Enforces Page Object Model conventions for Playwright tests against the Didaxis UI.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/tetianna/ai-assisted-qa-automation-2 --skill pom-conventions-tetianna
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pom-conventions
Source: https://github.com/tetianna/ai-assisted-qa-automation-2/tree/main/.cursor/skills/pom-conventions
Command: npx skills add https://github.com/tetianna/ai-assisted-qa-automation-2 --skill pom-conventions-tetianna

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Playwright test suites degrade when tests embed inline locators, brittle CSS selectors, and assertions scattered across page code. This Skill standardizes how Page Objects are written so tests stay readable and maintainable as the Didaxis UI evolves. ## Core Features & Use Cases - Locator priority enforcement: Mandates getByRole → getByLabel/getByPlaceholder → getByText → getByTestId, banning CSS selectors and XPath. - Strict POM structure: One class per page or component, readonly locator properties, action-only methods, and no assertions or waitForTimeout inside Page Objects. - Use Case: When generating a new spec for a Didaxis feature, the Skill produces a ProgramsPage class composing a NewProgramModal, with all expect(...) calls kept in the test file using web-first assertions. ## Quick Start Generate a Playwright spec for the login flow following this project's Page Object Model conventions.

Frequently Asked Questions about pom-conventions

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

FAQPage Schema
How do I structure Playwright tests with the Page Object Model?▼

Create one Page Object class per page or component with readonly locators in the constructor and action methods like goto, clickX, and fillY. Tests import these classes, instantiate them with new XxxPage(page), and keep all assertions in the spec file.

What locator strategy should Playwright tests use?▼

Use getByRole first, then getByLabel or getByPlaceholder, then getByText, with getByTestId only as a commented escape hatch. Avoid CSS selectors and XPath, and disambiguate multiple matches with .filter({ hasText }) instead of .first().

Should Page Objects contain assertions in Playwright?▼

No. Page Object methods perform actions only; all expect() calls belong in test files. Use auto-retrying web-first assertions like toBeVisible() or toHaveText() rather than expect(await locator.isVisible()).toBe(true).

Why is waitForTimeout discouraged in Playwright Page Objects?▼

waitForTimeout introduces fixed delays that make tests slow and flaky. Callers should instead wait with web-first expects such as toBeVisible() or toBeEnabled(), which auto-retry until the condition holds or the timeout expires.

How do I handle pages with multiple components in Playwright POM?▼

Compose Page Objects by having a parent page class hold instances of component classes, such as ProgramsPage containing a NewProgramModal. Each component manages its own locators and actions independently.