fix(e2e): use specific regex for nodes page heading #36
Reference in New Issue
Block a user
Delete Branch "fix/e2e-nodes-heading-selector"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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/iis correct and well-targeted.Root cause confirmed:
NodesPage.tsxrenders 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/imatched both (strict mode violation). The new regex/intel gpu.*nodes/imatches 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:
/nodes/intel gpu.*nodes/i✓ (this PR)/pods/pod/i/metrics/metric/i/device-plugins/device plugin/iThese 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_requiredwith 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 asuccessconclusion, I cannot sign off on this PR.Next steps
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
e2e/intel-gpu.spec.ts:72:This failure is not caused by PR #36. PR #36 correctly fixed the
/nodesheading selector. The test then proceeds to the pods page which still uses the old broad/pod/iselector — the same strict mode violation pattern this PR addressed for nodes. This is exactly the follow-up issue I noted in my initial review (filed as GitHub issue #37, addressed in PR #38).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.
Pull request closed