Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/FortiumPartners/ensemblenpx agentmods add skills/fortiumpartners/ensemble/writing-playwright-testsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/fortiumpartners/ensemble/writing-playwright-tests)<a href="https://agentmods.dev/skills/fortiumpartners/ensemble/writing-playwright-tests"><img src="https://agentmods.dev/badge/skills/fortiumpartners/ensemble/writing-playwright-tests/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fortiumpartners/ensemble/writing-playwright-tests"><img src="https://agentmods.dev/badge/skills/fortiumpartners/ensemble/writing-playwright-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00038 | $0.02717 |
| Opus 5 | $0.00019 | $0.01358 |
| Sonnet 5 | $0.00008 | $0.00543 |
| Haiku 4.5 | $0.00004 | $0.00272 |
Grade A, and why
writing-playwright-tests 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 457 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Playwright E2E Testing Skill
1. Selector Strategy Hierarchy
Use selectors in this priority order for maximum resilience:
// BEST: Explicit test identifiers
page.getByTestId('submit-button')
// GOOD: Semantic role-based (accessible)
page.getByRole('button', { name: 'Submit' })
page.getByRole('heading', { level: 1 })
page.getByRole('textbox', { name: 'Email' })
// GOOD: User-visible text
page.getByText('Welcome back')
page.getByLabel('Email address')
page.getByPlaceholder('Enter your email')
// ACCEPTABLE: When above options unavailable
page.locator('[data-cy="element"]') // Cypress migration
page.locator('#unique-id') // Stable IDs only
// AVOID: Brittle structural selectors
page.locator('.btn-primary') // Classes change
page.locator('div > span:nth-child(2)') // Structure changes
page.locator('//div[@class="foo"]') // XPath fragile
Adding Test IDs to Legacy Apps
When retrofitting, add data-testid attributes incrementally:
<!-- Before: Relies on brittle class selector -->
<button class="btn btn-primary submit-form">Submit</button>
<!-- After: Resilient test identifier -->
<button class="btn btn-primary submit-form" data-testid="contact-form-submit">Submit</button>
Naming convention for test IDs:
{component}-{element}-{qualifier}
contact-form-submit
user-list-row-{id}
modal-confirm-button
nav-menu-toggle
2. Page Object Model
Basic Page Object
// pages/login.page.ts
import { Page, Locator } from '@playwright/test';
export class LoginPage {
readonly page: Page;
readonly emailInput: Locator;
readonly passwordInput: Locator;
readonly submitButton: Locator;
readonly errorMessage: Locator;
constructor(page: Page) {
this.page = page;
this.emailInput = page.getByLabel('Email');
this.passwordInput = page.getByLabel('Password');
this.submitButton = page.getByRole('button', { name: 'Sign in' });
this.errorMessage = page.getByRole('alert');
}
async goto() {
await this.page.goto('/login');
}
async login(email: string, password: string) {
await this.emailInput.fill(email);
await this.passwordInput.fill(password);
await this.submitButton.click();
}
async expectError(message: string) {
await expect(this.errorMessage).toContainText(message);
}
}
What ships with it
16 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.
- examples/authentication-flow.example.ts 12 KB runs code
- examples/data-table-crud.example.ts 12 KB runs code
- examples/form-validation.example.ts 11 KB runs code
- examples/legacy-app-conversion.example.ts 11 KB runs code
- examples/visual-regression.example.ts 12 KB runs code
- README.md 1.9 KB
- REFERENCE.md 19 KB
- templates/api-mock.template.ts 5.1 KB runs code
- templates/auth-setup.template.ts 2.7 KB runs code
- templates/component.template.ts 5.9 KB runs code
- templates/config.template.ts 3.8 KB runs code
- templates/fixtures.template.ts 2.7 KB runs code
- templates/legacy-selectors.template.ts 6.4 KB runs code
- templates/page-object.template.ts 2.1 KB runs code
- templates/test-spec.template.ts 2.1 KB runs code
- VALIDATION.md 8.7 KB
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.
- 6d ago First seen · 457 lines · 38 tokens per session scan A a5cf9d7a3c78
writing-playwright-tests is a skill published in the GitHub repository FortiumPartners/ensemble (12 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 2,717 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-09-03.
Other skills, from other repositories
webapp-testing
Start/reuse a local app, wait for readiness, inspect rendered state/console/network, act from observed selectors, and verify with evidence.
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.
agent-browser
Use the host-side agent-browser CLI for local browser smoke tests, screenshots, snapshots, and simple UI validation against forwarded localhost URLs.
BrowserBash Browser Automation
BrowserBash is a vendor-independent, natural-language browser automation CLI. Drive a real browser from plain-English objectives or committable Markdown tests, run on local Chrome, CDP/Playwright MCP, Browserbase, LambdaTest, or BrowserStack, and stream NDJSON results with CI exit codes — using free local Ollama…
e2e
Generate and run Playwright E2E tests traced to spec.md acceptance criteria, with an optional accessibility audit. Use when saying "e2e tests" or "a11y audit".
test-app
Verify a running Mendix app in a browser with Playwright, with OQL for data assertions. Use when asked to test or validate the app end to end, or to confirm that generated pages actually render.