playwright-page-objects

A set of patterns for organising Playwright end-to-end tests, which check a complete user journey in a browser, with reusable page and component helpers.

In plain words
What is it for?
Use it when creating or refactoring Playwright page objects, test fixtures, workflow-specific pages, or reusable component test helpers.
Why use it?
It keeps repeated selectors and page actions in one place, so UI changes require fewer test edits and tests stay easier to understand.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bartstc/vite-ts-react-template/playwright-page-objects
Any agent
npx skills add bartstc/vite-ts-react-template --skill playwright-page-objects
Clone the repo
git clone --depth 1 https://github.com/bartstc/vite-ts-react-template

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 869 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.00869
Opus 5 $0.00015 $0.00434
Sonnet 5 $0.00006 $0.00174
Haiku 4.5 $0.00003 $0.00087

Measured 2d ago against content hash 2888fa67b552, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

playwright-page-objects scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/playwright-page-objects/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Playwright Page Objects

Modern POM architecture using Playwright's fixtures pattern, composition over inheritance, and role-based locators.

When to Apply

  • Setting up E2E test architecture from scratch
  • Creating new page objects or component helpers
  • Implementing test fixtures for dependency injection
  • Refactoring existing page objects for maintainability
  • Writing reusable component-level test abstractions

Core Principles

  1. Fixtures over PageManager — On-demand instantiation, automatic setup/teardown, native TypeScript inference
  2. Composition over inheritance — Compose from focused components, avoid deep class hierarchies
  3. Role-based selectors firstgetByRole() > getByLabel() > getByText() > getByTestId()
  4. Tests own assertions — Page objects expose state via getters, tests make assertions
  5. Separate pages by workflow — ProductListPage ≠ ProductDetailsPage (different user interactions)
  6. Readonly locators — All page object locator properties should be readonly
  7. Fluent interfaces — Methods return this for chaining; navigation methods return target page object
  8. Private internals — Mark implementation details (spinners, retry logic, helpers) as private
  9. Wait for stability — Use waitForPageLoad(), waitForResponse() before assertions
  10. High-level actions — Create AppActions class for complex multi-page user flows

Quick Reference

Pattern When to Use Reference
Fixtures Always for page object instantiation fixtures-pattern.md
Basic POM All page objects core-patterns.md
Composition Shared UI elements (header, cards, modals) core-patterns.md
Waiting strategies Loading states, API responses core-patterns.md
High-level actions Multi-page flows (checkout, onboarding) core-patterns.md
Form handling Multi-step forms, validation form-handling.md

Read the full file on GitHub · 74 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 74 lines · 30 tokens per session scan A 2888fa67b552

Subscribe to this mod's changes

playwright-page-objects is a skill published in the GitHub repository bartstc/vite-ts-react-template (121 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 869 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

playwright-cli

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

weapp-vite/weapp-vite · 52 tokens

use-agent-browser-for-airi

Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts. Use when uploading and verifying contributor-supplied Live2D ZIP, VRM, or MMD ZIP/PMX/PMD files through AIRI's model selector, including onboarding bypass, format-specific import…

moeru-ai/airi · 87 tokens

e2e-deployment-skill

Use this deployment skill to verify shared skills load during Playwright startup.

danny-avila/LibreChat · 22 tokens

launch

Launch Code OSS (VS Code from sources) into an isolated throwaway profile with unique debug ports so you can drive it with @playwright/cli AND attach a Node debugger via dap-cli in the same session. Use when working on VS Code itself and you want to interact with the running workbench, automate chat or UI flows, test…

microsoft/vscode · 96 tokens

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

anthropics/skills · 35 tokens

web-preview

Flutter Web版をビルド → サーバー起動 → Playwright でアクセス確認 → URLをユーザーに案内する。.

K9i-0/ccpocket · 32 tokens