Locators

Playwright + TypeScript locator conventions — strict priority ladder (getByTestId first, then role/label, then chained, then class/id, then text, CSS/XPath as last resort), data-testid naming convention, parameterized locators, filter/narrow patterns, and anti-patterns. Use when writing or reviewing locators in page objects, when choosing how to target an element, when fixing brittle CSS/XPath selectors, when a test has 'resolved to N elements' errors, or when reviewing test code.

antongulin 52859fe 2 files · 9.5 KB Updated

File contents

antongulin/pw-kit/tree/main/skills/locators commit 52859fe4d3

Frequently asked questions

npx skillmds@latest add antongulin/locators