Skip to content

fix(e2e): scope the pods status chip to its deployment accordion [release-1.9] - #5445

Closed
gustavolira wants to merge 2 commits into
redhat-developer:release-1.9from
gustavolira:fix/kubernetes-rbac-pod-status-locator-1.9
Closed

gustavolira wants to merge 2 commits into
redhat-developer:release-1.9from
gustavolira:fix/kubernetes-rbac-pod-status-locator-1.9

Conversation

@gustavolira

Copy link
Copy Markdown
Member

Description

Fixes the two remaining showcase-rbac failures in the release-1.9 gke-operator nightly (RHDHBUGS-3775):

TimeoutError: locator.scrollIntoViewIfNeeded: Timeout 15000ms exceeded.
waiting for locator('span[aria-label="Status ok"]').nth(4)

Root cause

KubernetesPage.verifyPodLogs picked the deployment's pod-count chip positionally: the 5th Status ok chip on the whole page. The page-wide chip count depends on what the cluster contains and on the user's RBAC visibility. The current Kubernetes tab renders only 4 chips (2 on the my-cluster summary + 2 on the topology-test deployment row — confirmed in the accessibility snapshots of the failed runs), so nth(4) waits forever.

Fix

Locate the chip inside the deployment's own accordion summary (getByRole("button", { name: \${text} Deployment namespace: …` })) and filter by the pod-count text, per the repo's locator rules (no positional nthwithout semantic context). Verified against theerror-context.md` snapshots of both failing scenarios (permitted and restricted user) from this run: the scoped locator resolves in both.

Note: main removed this spec in #4795 (wrapper-plugin test migration), so this fix is release-1.9 only.

Together with #5441, this should turn showcase-rbac on the gke-operator nightly fully green (8 failures → 2 → 0).

🤖 Generated with Claude Code

verifyPodLogs located the deployment's pod-count chip with a page-wide
span[aria-label="Status ok"] nth(4). The page-wide chip count depends on
what the cluster happens to contain and on the user's RBAC visibility;
the current Kubernetes tab renders only 4 chips (2 on the cluster
summary, 2 on the deployment), so nth(4) waits for a fifth chip that no
longer exists and both kubernetes-rbac tests time out (RHDHBUGS-3775).

Locate the chip inside the deployment's own accordion summary button
instead, matched by its accessible name, so the assertion is unaffected
by other resources appearing or disappearing. Verified against the
accessibility snapshots (error-context.md) of the failed
release-1.9-e2e-gke-operator-nightly runs: the scoped locator resolves
in both the permitted and the restricted user scenarios.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… accordion

Review hardening: exact accessible-name matching, and filter the nested
same-named buttons by the chip they must contain instead of taking the
first DOM match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@gustavolira

Copy link
Copy Markdown
Member Author

Folded into #5441 (same branch target, complementary fix) so one gke-operator run can validate showcase-rbac going fully green. The two commits were cherry-picked there verbatim.

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.

1 participant