playwright-scaffold
Copilot instructions1 starsChanged 3 months agoMITView on GitHub
Mirror of the canonical AI rules. The authoritative source is CLAUDE.md + .claude/skills/**. If this file and a skill disagree, the skill wins. These mirrors may lag — when in doubt, open the matching .claude/skills/<name>/SKILL.md. Path-scoped detail lives in .github/instructions/*. This is an AI-native Playwright + TypeScript test scaffold. It tests UI (functional + e2e) and API, with security coverage, via Page Object Model, fixture DI, deterministic waits, and runtime-validated Zod schemas. If PROJECT.md exists, read it: it records the…
- Reads credentials
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-native-workflowSkill
- api-testingSkill
- bootstrapSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- page-objectsSkill
- salesforce-authSkill
- salesforce-dataSkill
- salesforce-locatorsSkill
- salesforce-metadata-contractSkill
- salesforce-personasSkill
- salesforceSkill
- salesforce-waitsSkill
- security-testingSkill
- selectorsSkill
- test-standardsSkill
- type-safetySkill
- wait-strategySkill
The file
We split this copilot-instructions.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
If PROJECT.md exists, read it: it records the profile, auth model, locator priority, and API-contract source, and overrides the defaults …
- Very specific: line 16
If PROJECT.md does NOT exist, this is a fresh clone — bootstrap it first, don't generate tests yet:
- Very specific: line 27
Example files — ASK, don't decide: delete them, or keep as reference.
- Very specific: line 52
Every spec imports from fixtures/test-options — never from @playwright/test directly.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot — Repository Instructions
Mirror of the canonical AI rules. The authoritative source is
CLAUDE.md+.claude/skills/**. If this file and a skill disagree, the skill wins. These mirrors may lag — when in doubt, open the matching.claude/skills/<name>/SKILL.md. Path-scoped detail lives in.github/instructions/*.
This is an AI-native Playwright + TypeScript test scaffold. It tests UI (functional + e2e) and API, with security coverage, via Page Object Model, fixture DI, deterministic waits, and runtime-validated Zod schemas.
First contact — bootstrap a fresh clone
If PROJECT.md exists, read it: it records the profile, auth model, locator priority, and
API-contract source, and overrides the defaults below.
If PROJECT.md does NOT exist, this is a fresh clone — bootstrap it first, don't generate tests yet:
- Interview the user (don't decide silently): UI / API / both? App type → profile (
generic/controlled/salesforce/api-only)? Auth (none / password / SSO)? OpenAPI spec? Base URL? - API-only gate: a large pure-API suite on a non-TS backend → recommend a backend-native tool (pytest+Pydantic, RestAssured, Schemathesis) and stop.
- Apply the profile: set locator priority (per profile); in
playwright.config.tsremove unused projects (no auth → delete thesetupproject + itsdependencies+storageState+auth.setup.ts; no backend → removeapi); fillenv/.env.<env>. BASE_URLis the app ROOT only — no path segment (not.../todomvc), elsegoto('/')drops it. Paths go inenums/util/routes.ts.- Example files — ASK, don't decide: delete them, or keep as reference. If kept, MOVE the example
specs (
tests/**/*.spec.ts) out oftests/— they target a fake app and will run and FAIL otherwise. - Write
PROJECT.mdrecording every decision.
Hard stops (refuse to generate these)
page.waitForTimeout(...)— use a web-first assertion or a pre-registered response wait.page.waitForLoadState('networkidle')on an SPA — use the specific gating response. (Fine only on static/SSR pages that go quiet.)- XPath / CSS-class / nth-child / auto-generated-id selectors — use semantic or testId per the active profile.
- A guessed selector, URL, endpoint, enum, or UI string — explore first (live app / OpenAPI) or ASK. Never invent.
any— use a real type orunknown+ narrowing.z.object(...)for an API schema — usez.strictObject(...).- Skipping response validation — validate every API body with a Zod schema.
- Assertions inside a page object — page objects act; specs assert.
- Raw locators in a spec — locators live in page objects only.
new SomePage(page)in a test — consume via the fixture.- Hardcoded URL/credential —
process.env.*viaconfig/; paths & messages viaenums/. .jsonstatic data —.tswithas const.- Silencing a failure (try/catch on
expect, raised timeout, silent.skip) — fix the root cause;.skipneeds// FIXME: <ticket>. - More than one tag per test — exactly one;
@destructivewins.
Architecture
config/URLs+secrets (env) ·enums/paths/routes/messages ·helpers/waits+auth ·pages/POM ·test-data/factories+static ·fixtures/api+pom+helper+test-options.ts·tests/api/functional/e2e.- API / UI / E2E are separate Playwright projects, not just folders. The seam is what is the system under test. API-as-setup is a fixture inside UI tests; API-as-SUT is the
apiproject. - Every spec imports from
fixtures/test-options— never from@playwright/testdirectly.
Workflow
Explore → propose scope with a confidence score (low confidence → ASK, don't guess) → on approval, apply → run the affected test file → report. Run the affected file, never the whole suite. Red → investigate the root cause.
When NOT to use this for API testing
A large, pure-API suite where the API is the SUT and the backend is non-TypeScript → recommend a backend-native tool (pytest+Pydantic, RestAssured, Schemathesis/Dredd), not Playwright.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

