mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 16:10:43 +00:00
## Summary Completes the Sentinel **Page Object Model** compliance sweep of the Playwright suite (follow-up to #13727, which covered the non-Dashboards shards). Every raw `page.locator(...)` / `page.getBy*(...)` selector — in **actions and assertions** — is relocated out of the spec files into the relevant page object; specs now call page-object methods/getters only. **Result: 0 raw fixture-`page` selectors across the entire `playwright-tests` suite** (single-line *and* multi-line, verified with a dotall/multiline scanner). Together with #13727, the whole suite is POM-clean. ## What's in this PR **Dashboards shards — ~1,460 selectors** relocated into their page objects (`dashboard-panel-configs/actions/edit/time`, `dashboard-chart`, `dashboard-variables-scoped`, `dashboard-filter`, `dashboard-drilldown`, `crossLinkPage`, `visualise`, `dashboard-share-export`, `dashboard-create`, `dashboard-settings`, `dashboard-variables`): | Shard | selectors | |-------|----------:| | Dashboard-Config-Settings (11 specs) | ~255 | | Dashboards-Variables (12 specs, 4 batches) | ~693 | | Dashboards-Tables (7 specs) | ~127 | | Dashboards-Charts (9 specs) | ~81 | | Dashboards-Core + Visualize (10 specs) | ~144 | | Dashboards-Settings + Panel-DateTime (8 specs) | ~107 | | Dashboard-Regression (1 spec) | ~52 | **Correlation UI specs** (3 new `Correlation/*.ui.spec.js` that arrived via main's merge, after the original audit) — converted into a new `correlationDrawerPage` + an extended `correlationSettingsPage`, with `PageManager` wired into specs that previously used none. **Audit stragglers** the original **single-line** audit grep undercounted — multi-line `page\n.locator(...)` chains in `logstable.spec.js` (→ `logsPage.getTableHeaderByField()`) and `dashboard-streaming.spec.js` (2 add-panel selectors). **AI-review fixes** (DeepSeek, on this PR) — removed 2 dead-code duplicate getters + 1 redundant method alias (merge artifacts from the sequential batch commits). One Node-context `console.log` (`dashboard-general-setting`'s `beforeEach`) → `testLogger.info`. ## Approach Nearly every Dashboards spec shares the same page objects, so the work was done in **sequential batches** (one committed, verified unit at a time) to keep page-object edits conflict-free. 13 commits, mapping 1:1 to those batches. ## Not changed (by design) - **`waitForTimeout`** left as-is — logged in the audit, not rewritten (per direction). - **Browser-context code inside `page.evaluate()` / `waitForFunction()`** (`document.querySelector`, `window.*`) left as-is — it runs in the page's JS engine, not Node, so `testLogger` (a Node module) can't be called there. *No `console.*` remained in dashboards specs*; the Node-context ones were converted to `testLogger`. - **`newPage.locator(...)`** on separate popup `Page` instances left as-is (not the fixture `page`). ## Verification - **0 raw fixture-`page` selectors** across all specs — single- and multi-line, comments stripped. - All changed `.js` files pass `node --check`. - **CI-gated** for browser execution (no local runs), consistent with #13727. The enterprise E2E crosscheck already passed against this PR. ## Stats 82 files changed (+3,355 / −2,211) — 61 specs, 21 page objects. Selectors **moved into page objects, not deleted**.