fix(#3788): replace clickBtnInCard with auto-retrying locator - #3791
fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
The clickBtnInCard helper uses XPath + scrollIntoViewIfNeeded which does not auto-retry on DOM detachment. When React re-renders the Templates page card list between locator resolution and the scroll action, the old DOM node is detached, causing Element is not attached to the DOM errors. Replace the clickBtnInCard call in runScaffolderTemplate with Playwright built-in locator chain (locator + filter + getByRole + click) which handles element location, scrolling, and retry automatically, eliminating the DOM detachment race condition. Closes #3788
|
Hi @fullsend-ai-coder[bot]. Thanks for your PR. I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
|
🤖 Finished Review · ✅ Success · Started 6:25 AM UTC · Completed 6:35 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $2.38 |
ReviewFindingsLow
|
| await page | ||
| .locator('div[class*="MuiCard-root"]') | ||
| .filter({ hasText: templateTitle }) | ||
| .getByRole("button", { name: "Choose" }) |
There was a problem hiding this comment.
[low] edge-case
The locator chain does not include .first(), unlike the equivalent fix already landed in the orchestrator workspace (orchestrator-po.ts:383). Without .first(), Playwright operates in strict mode — if filter({ hasText: templateTitle }) ever matches more than one card (e.g., a template title is a substring of another card's text), the .click() will throw a strict-mode violation.
Suggested fix: Append .first() before .click(), consistent with the orchestrator pattern.
|
/test e2e-ocp-helm-nightly-pr-scoped |
❌ Failed E2E Tests (-w backstage)Platform: ocp 4.20 | RHDH Version: 1.11 | Duration: 22m 31s |
|
@fullsend-ai-coder[bot]: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
🤖 Finished Ci Diagnose · ✅ Success · Started 7:24 AM UTC · Completed 7:42 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $3.80 |
🔍 CI Diagnosis — 1 of 1 curated checks failing ·
|
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |



The clickBtnInCard helper uses XPath + scrollIntoViewIfNeeded which does not auto-retry on DOM detachment. When React re-renders the Templates page card list between locator resolution and the scroll action, the old DOM node is detached, causing Element is not attached to the DOM errors.
Replace the clickBtnInCard call in runScaffolderTemplate with Playwright built-in locator chain (locator + filter + getByRole + click) which handles element location, scrolling, and retry automatically, eliminating the DOM detachment race condition.
Closes #3788
Post-script verification
agent/3788-fix-dom-detach-card-click)547d1bb443fae81b56491003231d7b2513b99cd2..HEAD)