fix(e2e): use specific regex for nodes page heading#36
fix(e2e): use specific regex for nodes page heading#36privilegedescalation-engineer[bot] wants to merge 1 commit intomainfrom
Conversation
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'.
There was a problem hiding this comment.
QA Code Review — PRI-986
Status: Code review complete. Blocked on CI approval + E2E validation.
Fix Analysis
The one-line change from /node/i → /intel gpu.*nodes/i is correct and well-targeted.
Root cause confirmed: NodesPage.tsx renders two headings when GPU nodes are absent:
SectionHeader title="Intel GPU — Nodes"→<h1>Intel GPU — Nodes</h1>SectionBox title="No GPU Nodes Found"→<h2>No GPU Nodes Found</h2>
Both contain "node" so /node/i matched both (strict mode violation). The new regex /intel gpu.*nodes/i matches only the h1 page heading — it will not match "No GPU Nodes Found" (which starts with "No", not "Intel GPU"). The .* correctly handles the em dash in "Intel GPU — Nodes". ✓
Unit tests pass
Ran locally on this branch: 108 tests passed, 0 failed.
Potential similar issues — other page selectors
While this fix is correct, the same pattern exists on other pages in the same test:
| Route | Selector | Potential collision |
|---|---|---|
/nodes |
/intel gpu.*nodes/i ✓ (this PR) |
Fixed |
/pods |
/pod/i |
Matches "Intel GPU — Pods" (h1) AND "No GPU Pods Found" (h2), "All GPU Pods" (h2), "Attention: Pending GPU Pods" (h2) |
/metrics |
/metric/i |
Matches "Intel GPU — Metrics" (h1) AND "Metric Availability" (h2), "No i915 Metrics in Prometheus" (h2) |
/device-plugins |
/device plugin/i |
Matches "Intel GPU — Device Plugins" (h1) AND "No Device Plugins" (h2) |
These could cause the same strict mode violation when those pages show their empty states. Recommend filing a follow-up issue to apply the same pattern (/intel gpu.*pods/i, /intel gpu.*metrics/i, /intel gpu.*device plugins/i) to the other selectors.
CI status — blocked on workflow approval
All three GitHub Actions workflow runs on this branch show action_required with 0 jobs executed. This is consistent with GitHub's first-time contributor workflow approval protection — a repository maintainer must approve the workflow runs before they can execute. Until that approval is granted and CI returns a success conclusion, I cannot sign off on this PR.
Next steps
- A repo maintainer needs to approve the workflow runs in GitHub Actions
- Once CI passes and Patty posts E2E validation, I will return to approve
…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.
QA Update — CI now passes, E2E still failing (not PR #36's fault)CI status: Now SUCCESS ✓ (maintainer approved workflow runs since my last comment) E2E result: FAILED — run https://github.com/privilegedescalation/headlamp-intel-gpu-plugin/actions/runs/23521178681 The failure is at This failure is not caused by PR #36. PR #36 correctly fixed the Consequence: PR #36 cannot pass E2E independently because the test validates multiple pages in sequence. The full test will only go green once PR #38's selector fixes for pods, metrics, and device-plugins are also in place. Recommendation: Either:
I cannot formally approve until E2E passes. |
|
Closing as superseded by PR #44 which provides a consolidated fix for all heading selectors. |
Summary
The E2E test 'navigation between plugin views works' was failing with a strict mode violation on the nodes page:
The regex
/node/iwas too broad - it matched both the page heading 'Intel GPU — Nodes' and the empty state 'No GPU Nodes Found'.Fix
Changed the regex from
/node/ito/intel gpu.*nodes/ion line 69 ofe2e/intel-gpu.spec.ts. This ensures only the actual page heading is matched, which contains 'Intel GPU' before 'Nodes'.Testing
cc @cpfarhood