page-objects
Skill1 starsChanged 3 months agoMITView on GitHub
Use when creating a page object for a new screen, adding locators/actions to an existing one, or extracting a reusable component object. Defines the POM conventions.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- idavidov13/agentic-playwrighttheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- idavidov13/agentic-playwright★ 294same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- ai-native-workflowSkill
- api-testingSkill
- bootstrapSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- 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 skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Locators-on-top: Every locator is a class field.
- Very specific: line 52
After creating a page object, register it in fixtures/pom/page-object-fixture.ts.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Page Objects
The contract: page objects perform actions and expose locators; specs assert. Tests read like user stories; the DOM lives behind the page object.
Anatomy
export class ProductsPage extends BasePage {
// ── Locators on top (single source of truth) ──
readonly heading = this.page.getByRole('heading', { name: 'Products' }); // public: specs assert on it
private readonly addButton = this.page.getByRole('button', { name: 'Add product' });
private readonly nameInput = this.page.getByLabel('Name');
async goto(): Promise<void> {
await this.page.goto(Routes.PRODUCTS);
}
// ── Actions only — no expect() here ──
async addProduct(name: string): Promise<void> {
await this.addButton.click();
await fillAndBlur(this.nameInput, name);
const saved = waitForRest(this.page, ApiEndpoints.PRODUCTS); // pre-register
await this.page.getByRole('button', { name: 'Save' }).click();
await saved;
}
}Rules
- Extends
BasePage. Constructor takespage;pageisprotected— specs use thepagefixture for URL asserts, notsomePage.page. - Locators-on-top. Every locator is a class field.
readonly(public) if a spec asserts on it;private readonlyif internal-only. Never declare locators inline in methods. - No assertions. No
expect, noisVisibleReturningBoolean()wrappers. Expose the locator; let the spec assert. (await expect(page.heading).toBeVisible()lives in the spec.) - Waits are fine (they're not assertions):
locator.waitFor({ state }), thenetwork.tshelpers. - Deterministic waits inside actions — pre-register response waits; never
waitForTimeout/networkidle. - Include feedback locators — success/error/validation elements, so specs can assert outcomes.
Components — extract on the 3rd occurrence
A reusable UI pattern (search box, modal, tab bar) becomes a pages/components/*.component.ts only
when it appears in 3+ page objects. Before that, keep it as page-object methods. A component takes
its scope (Page | Locator) so it works inside modals/panels. See pages/components/search.component.ts.
Register + consume via fixture
After creating a page object, register it in fixtures/pom/page-object-fixture.ts. Tests receive it
by destructuring (async ({ productsPage }) => …) — never new ProductsPage(page) in a test.
Phases
ls pages/— resolve area, avoid duplicates.- Explore the live screen (playwright-cli). 3. Propose locators + actions + feedback elements.
- Build (rules above). 5. Register in the POM fixture. 6. Use via fixture in the spec.
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.

