Commit Graph
4 Commits
Author SHA1 Message Date
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
ktx-mihirandAbhay Padamani 75b824f29a fix: cipherkeys module form migration with zod (#12971)
- form migration with zod schema for cipher keys module

---------

Co-authored-by: Abhay Padamani <141122205+ktx-abhay@users.noreply.github.com>
2026-07-15 15:04:32 +00:00
Shrinath RaoandClaude Opus 4.8 62a8f3f30b ci: gate Playwright + API tests behind an 'e2e' label + auto-bypass non-code changes (#13014)
## What

Gate the full **Playwright (UI)** and **API** test suites on PRs behind
a single **`e2e` label**, and **auto-bypass** PRs that only touch files
which can't affect those suites. Covers `playwright.yml` and
`api-testing.yml`.

## Behaviour (both suites)

| Situation | build/test jobs | summary check (`playwright_summary` /
`api_tests_summary`) | Mergeable? |
|---|---|---|---|
| PR with `e2e` label | full suite runs | green if tests pass | ✅ if
green |
| PR, no label, relevant code changed | skipped | **fails** ("add `e2e`
label") | ❌ blocked |
| PR, no label, docs/meta only | skipped | **passes** (auto-bypass) | ✅
|
| Remove the `e2e` label | skipped (fresh run) | **fails** again | ❌
until re-added |
| push to `main` / merge queue / dispatch | full suite runs | green if
tests pass | n/a |

One `e2e` label runs **both** UI + API. `push`, `merge_group`, and
`workflow_dispatch` are never label-gated.

## Why the gate lives in the summary job

A job that `if:`-skips reports `skipped`, which branch protection treats
as **pass**. So a no-label PR can't be blocked by merely skipping jobs —
the summary job **actively fails** when the change is relevant and the
`e2e` label is absent.

## Auto-bypass (`check_changes`)

No label needed for: `*.md/.mdx/.markdown/.rst/.adoc`, `docs/`,
images/media, `LICENSE/NOTICE/AUTHORS/CONTRIBUTORS/CHANGELOG/.mailmap`,
`CODEOWNERS`, GitHub issue/PR/funding templates,
`dependabot`/`renovate`,
`.gitignore/.gitattributes/.editorconfig/.gitkeep/.husky/.vscode/.idea`.
The **API** workflow additionally bypasses `web/` + UI-test dirs
(frontend changes don't affect API tests).

**Not** bypassed (still trigger): `.github/workflows/**` (incl. these
workflow files), source, `package*.json`/lockfiles, configs, `*.txt`.

## Rollout prerequisites

- Create the **`e2e`** label in this repo.
- Required status checks = **`playwright_summary`** and
**`api_tests_summary`** — the individual shard jobs must NOT be required
(they legitimately skip and would auto-pass).

Sibling PR on the other repo uses the same branch `ci/e2e-label-gate`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 08:41:01 +00:00
ktx-vaidehi f1913e6d97 test: form e2e (#12632) 2026-06-17 11:52:13 +00:00