playwright-page-objects_skill

This skill guides organizing Playwright tests with the Page Object Model, fixtures, and data factories to improve maintainability and test reuse.

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill jovermier/cc-stack-marketplace --skill playwright-page-objects

  • SKILL.md4.9 KB

Overview

This skill provides a Playwright Page Object Model scaffold that includes page classes, fixtures, helpers, and recommended test organization. It helps you structure end-to-end tests so page structure, setup, and test logic remain separate and maintainable. Use it to make Playwright suites resilient to UI changes and easier to read.

How this skill works

The skill defines page objects as classes that contain Locators and interaction methods, keeping selectors and page operations in one place. Fixtures extend the Playwright test context to provide authenticated pages, seeded databases, and clean setup/teardown flows. Helpers and test-data factories offer reusable navigation, assertions, and synthetic data generation so tests focus on behavior rather than plumbing.

When to use it

  • You need consistent page abstractions for complex UI flows
  • Tests require authenticated state or database seeding across specs
  • You want to reduce duplication of selectors and interaction code
  • You need deterministic test data using factories or generators
  • You want test files to read like documentation for features

Best practices

  • Keep Locators and basic actions in page classes; keep assertions in tests or helpers
  • Extend test context with fixtures for auth, DB, and shared utilities
  • Create small, focused helpers for navigation and custom assertions
  • Use factories or generators for test data instead of hardcoded values
  • Organize files by purpose: pages/, fixtures/, helpers/, e2e/ for specs

Example use cases

  • Author a LoginPage class with goto() and login() methods to reuse across auth tests
  • Create an auth fixture that signs in a test user and yields an authenticated Page
  • Seed test data with factories before a suite and clean up in fixture teardown
  • Extract common navigation flows (e.g., openDashboard) into helpers used by multiple specs
  • Structure an e2e folder so tests read as feature scenarios using page objects

FAQ

Keep assertions primarily in tests or helper functions; page objects should expose actions and state, not test expectations.

How do fixtures handle cleanup?

Use fixture teardown (after use) to delete created test users or undo seeds so each test starts from a clean state.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
playwright-page-objects skill by jovermier/cc-stack-marketplace | VeilStrat