Add playwright/no-raw-locators eslint rule for e2e tests

Forbid page.locator() in favor of semantic locators like getByRole,
getByLabel, getByText.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
silverwindandClaude Opus 4.6 committed 2026-02-18 03:03:15 +01:00
1 parent cbe336f466
commit 3dd69ecfc0
1 file changed
+1
+1
View File
@@ -913,6 +913,7 @@ export default defineConfig([
files: ['tests/e2e/*.test.ts'],
rules: {
...playwright.configs['flat/recommended'].rules,
'playwright/no-raw-locators': [2],
},
},
{