Skip to content

Commit 9017e66

Browse files
test: refactor to modules and accessible locators. (#36)
1 parent 919d0df commit 9017e66

13 files changed

Lines changed: 2140 additions & 1976 deletions

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"nursery": "off"
1010
},
1111
"rules": {
12+
"eqeqeq": "error",
1213
"no-console": "error",
1314
"no-unused-vars": "error",
1415
"no-shadow": "error",

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Repository structure:
4545
- Do not introduce bundler-only assumptions into src/ runtime code.
4646
- Prefer async/await over promise chains.
4747
- Do not use IIFE, find another pattern instead.
48+
- In Playwright tests, prefer accessible selectors first: `getByRole`, `getByLabel`, `getByText`, and explicit accessible names.
49+
- Avoid `locator()` for interactive controls when a semantic selector is available.
50+
- Use `locator()` only as a fallback for cases without reliable semantics (for example: document root `html`, structural class assertions, or implementation-only hooks).
51+
- When testability needs improvement, prefer adding accessibility semantics (`role`, `aria-label`, `aria-labelledby`) over introducing new id-only selectors.
4852

4953
## CDN and runtime expectations
5054

0 commit comments

Comments
 (0)