Files
openobserve/tests/ui-testing/playwright-tests/Correlation
Shrinath Rao 3886dff356 refactor(sentinel): dedup page-object methods + testLogger convention (follow-up to #13735) (#13746)
## Summary

Post-POM-sweep cleanup (follow-up to #13727 / #13735): removes
duplication and dead code introduced/surfaced during the sweep, and
closes the `testLogger` convention gap. No production code — page
objects + specs only. Net **−101 lines**.

## A) Duplicate method names — removed 22 shadowed dead methods

7 page objects each had **two class methods with the same name**. In JS
the later definition wins, so the earlier copy was **unreachable dead
code** (callers always ran the later one; tests pass with it). Removed
the earlier/shadowed copy of each — behavior-preserving.

`alertsPage` (5), `logsPage` (11), `pipelinesPage` (2), `metricsPage`
(1), `streamsPage` (1), `cipherKeysFormValidationPage` (1),
`correlationSettingsPage` (1).

## B) Duplicate implementations — consolidated

- **crossLinkPage**: removed `crossLinkItemEditBtnLocatorByIdx` /
`crossLinkItemDeleteBtnLocatorByIdx` — **0 callers anywhere** (incl.
commented code); dead duplicates of the live
`getCrossLinkEditBtnLocator` / `getCrossLinkDeleteBtnLocator`.
- **alertsPage**: unified 3 identical-body pairs **via delegation** to a
single impl — `getTemplateRowByText→getAlertRowByText`,
`getDestinationsSelect→getAlertDestinationsSelectLocator`,
`getAddAlertSubmitButton→getAlertSubmitButtonLocator`. Both names kept
(zero spec edits), duplicated logic removed.

## C) Broad dead-code sweep — intentionally NOT in this PR

The wider "defined-but-never-called" backlog (~890 candidates, mostly
pre-existing) is a **risky, separate pass** and was deliberately
excluded.

## D) testLogger — added to 22 specs missing it

Added a `testLogger` import + `testLogger.testStart(testInfo.title,
testInfo.file)` in `beforeEach` (or `testLogger.info` in the first test
where there's no async `beforeEach`) to the 22 specs that didn't use it:
8 Correlation (5 api + 3 ui), 13 Dashboards, and `Login/auth`.
Convention-only.

## Verification

- **0 duplicate-name methods** remain across all page objects (was 22).
- **Method-resolution scan** (every `pm.<obj>.<method>()` in all 264
specs must resolve): 4 unresolved, **all 4 pre-existing on `main`**, **0
introduced by this PR**. (This is the runtime-existence check that `node
--check` can't do — the gap that caused the crossLinkPage regression on
#13735.)
- All changed `.js` pass `node --check`; all 22 specs have real
(non-comment) `testLogger` usage.
- CI-gated for browser execution.

## Stats
30 files changed (+82 / −183).
2026-08-11 07:42:28 +00:00
..