Commit e937891
ci(playwright): lint rules for UI-in-setup and unjustified page.reload
Two new om-playwright rules, both wired at error with the existing
eslint-suppressions.json ratchet — new violations fail lint, existing
ones are grandfathered and can only shrink.
no-ui-in-test-setup
Bans page.click / fill / press / selectOption / check / uncheck /
setInputFiles / hover / dblclick / tap / dragAndDrop / focus / blur
inside test.beforeAll / beforeEach / afterAll / afterEach. page.goto
is intentionally NOT banned — navigating to the URL under test is
legitimate setup; it is the user-input subset that turns setup into a
slow UI journey. Push state via apiContext.<Entity>.create() or a REST
helper, matching the canonical pattern in this codebase (sampled from
ClassificationVersionPage / ServiceEntityVersionPage / MetricVersionPage
and every other healthy suite).
Motivation: PR #32594 measured 21% of API calls wasted, mostly from
UI-driven setup. Every UI click in setup adds ~30 API calls to the
SUT; over ~4200 tests this compounds into the timeouts we then call
flakiness.
Baseline: 15 sites across 10 files (small, easy to work down).
no-page-reload-without-justification
Bans bare page.reload(). Legit reloads (persistence tests, service-
worker upgrades, SSO return flows) pass with a
`// TEST_KEEP_RELOAD: <reason>` comment on the line above or on the
same line as the call. Receiver is Page-scoped by identifier heuristic
(`page`, `p`, any *Page`, `this.page`, `browser.newPage()` result) so
domain objects like `store.reload()` don't trigger.
Motivation: measured appBootsPerUIScenario is 2.3, convergence target
is ≤1. Every reload boots the SPA entry chunk again (index.tsx's
recordPlaywrightAppBoot beacon counts it via a favicon fetch). Bare
reloads used as "refresh to see the update" are the dominant
contributor — a stale UI after mutation is a product bug the test
shouldn't work around.
Baseline: 217 sites across 90 files.
Both rules follow the existing plugin conventions in
playwright/eslint-rules/: pure ESM, no external deps, RuleTester tests
under tests/, wired into index.mjs, gated at error in eslint.config.mjs.
Docs in .claude/rules/frontend-playwright.md list both rules alongside
the existing highest-value constraints.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e09460b commit e937891
8 files changed
Lines changed: 1013 additions & 0 deletions
File tree
- .claude/rules
- openmetadata-ui/src/main/resources/ui
- playwright/eslint-rules
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
37 | 50 | | |
38 | 51 | | |
39 | 52 | | |
| |||
0 commit comments