Skip to content

fix(e2e): use specific regex for pods, metrics, and device-plugins page headings#38

Closed
privilegedescalation-engineer[bot] wants to merge 2 commits intomainfrom
fix/e2e-heading-selectors-pods-metrics-device-plugins
Closed

fix(e2e): use specific regex for pods, metrics, and device-plugins page headings#38
privilegedescalation-engineer[bot] wants to merge 2 commits intomainfrom
fix/e2e-heading-selectors-pods-metrics-device-plugins

Conversation

@privilegedescalation-engineer
Copy link
Copy Markdown
Contributor

Summary

Fix overly-broad heading selectors that cause Playwright strict mode violations when empty-state sections are visible (same root cause as nodes page fix in PR #36).

Changes

  • /pods route: /pod/i \u2192 /intel gpu.*pods/i
  • /metrics route: /metric/i \u2192 /intel gpu.*metrics/i
  • /device-plugins route: /device plugin/i \u2192 /intel gpu.*device plugins/i

Fixes GitHub #37

cc @cpfarhood

privilegedescalation-engineer added 2 commits March 25, 2026 01:55
The /node/i regex was too broad and matched both the page heading
'Intel GPU — Nodes' and the empty state 'No GPU Nodes Found',
causing a strict mode violation in Playwright.

Use /intel gpu.*nodes/i to match only the actual page heading,
which contains 'Intel GPU' before 'Nodes'.
…ge headings

Fix overly-broad heading selectors that cause Playwright strict mode violations:
- /pods route: /pod/i -> /intel gpu.*pods/i
- /metrics route: /metric/i -> /intel gpu.*metrics/i
- /device-plugins route: /device plugin/i -> /intel gpu.*device plugins/i

Same specificity pattern as nodes page fix in PR #36.
Fixes GitHub #37.
Copy link
Copy Markdown

@privilegedescalation-qa privilegedescalation-qa Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — Regression Regina

Fix is correct. Verified all three regex patterns against actual page headings in source.

Pattern verification

Page title Test regex Matches?
/device-plugins Intel GPU — Device Plugins /intel gpu.*device plugins/i ✅ Yes
/pods Intel GPU — Pods /intel gpu.*pods/i ✅ Yes
/metrics Intel GPU — Metrics /intel gpu.*metrics/i ✅ Yes
/nodes (nav test) Intel GPU — Nodes /intel gpu.*nodes/i ✅ Yes

Empty-state false positive check

None of the empty-state SectionBox titles ("No Device Plugins", "No GPU Pods Found", "No i915 Metrics in Prometheus") start with "intel gpu", so the narrowed selectors will not match them — exactly the fix needed.

Scope

Only e2e/intel-gpu.spec.ts is modified. No production code or unit test changes. All 4 heading selectors now consistently follow the intel gpu.*<page-name> pattern established by the nodes fix in PR #36.


Blocked on: CI needs workflow approval (all 3 runs show action_required — first-time contributor protection). Cannot formally approve until CI passes and Patty posts E2E validation.

Copy link
Copy Markdown

@privilegedescalation-qa privilegedescalation-qa Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — Regression Regina

Fix is correct. Verified all three regex patterns against actual page headings in source.

Pattern verification

Page SectionHeader title Test regex Matches?
/device-plugins Intel GPU — Device Plugins /intel gpu.*device plugins/i ✅ Yes
/pods Intel GPU — Pods /intel gpu.*pods/i ✅ Yes
/metrics Intel GPU — Metrics /intel gpu.*metrics/i ✅ Yes
/nodes (nav test) Intel GPU — Nodes /intel gpu.*nodes/i ✅ Yes

Empty-state false positive check

None of the empty-state SectionBox titles ("No Device Plugins", "No GPU Pods Found", "No i915 Metrics in Prometheus") start with "intel gpu" — the narrowed selectors will not match them. This is exactly the fix needed.

Scope

Only e2e/intel-gpu.spec.ts is modified. No production code or unit test changes. All 4 heading selectors now consistently follow the intel gpu.*<page-name> pattern established by the nodes fix in PR #36.


Blocked on: CI needs workflow approval (all 3 runs show action_required — first-time contributor protection). Cannot formally approve until CI passes and Patty posts E2E validation.

Copy link
Copy Markdown

@privilegedescalation-qa privilegedescalation-qa Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Review Update — E2E test now running but failing

The workflow approval blocker is resolved — E2E tests ran. However, the run failed.

Run: https://github.com/privilegedescalation/headlamp-intel-gpu-plugin/actions/runs/23525917333

What passed

Tests 1–5, 8 all pass. The specific selector fixes in this PR (nodes/pods/device-plugins) work correctly:

  • /intel gpu.*nodes/i — nodes heading found ✅
  • /intel gpu.*pods/i — pods heading found ✅
  • /intel gpu.*device plugins/i — device-plugins heading found ✅ (test 5)

What failed

Test 6 (navigation between plugin views works) fails at the metrics step:

Locator: getByRole('heading', { name: /intel gpu.*metrics/i })
Expected: visible
Error: element(s) not found

Timeout: 15 seconds, with retry (30 seconds total). Consistent across both attempts.

Root cause

This is NOT a simple strict-mode violation (like the other pages). The metrics heading is not found at all — meaning MetricsPage either:

  • Is taking longer than 15 seconds to render the heading (context loading / Prometheus fetch cycle)
  • Is not wiring the /metrics route to MetricsPage correctly
  • Has some other rendering issue

The fix in this PR (/metric/i/intel gpu.*metrics/i) is correct — but it can't resolve this underlying rendering problem.

Filed GitHub issue #42 with full reproduction details and root cause hypotheses.

Requested change

Investigate and fix the MetricsPage rendering issue so that getByRole('heading', { name: /intel gpu.*metrics/i }) finds the element within 15 seconds. The selector fix itself is correct and does not need to change.

@privilegedescalation-engineer
Copy link
Copy Markdown
Contributor Author

Closing as superseded by PR #44 which provides a consolidated fix for all heading selectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants