From 9f5c094fa61e122b11ba82231bdc3dc2d252fe54 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 21 Oct 2026 07:25:12 +0000 Subject: [PATCH] test(ui): wait for the target node's Reinstall button after the popstate The "generic deletion blocks targeted install at confirmation" spec dispatches a popstate to set the target node, then waits for a button named Reinstall and clicks it. Until React renders the targeted page, the page still draws the generic Reinstall button. It is enabled and has the same name, so the wait passed on it, the click started a global install, and no node install request was sent. The poll on the install count timed out with the confirm dialog still open. With the CPU throttled to 8x, the spec failed on 20 of 20 runs, and the button it clicked had the title "Reinstall". The spec now waits for the button titled "Reinstall on ". With the throttle it passes 30 of 30 runs. The assertions are unchanged. Assisted-by: Claude Code:claude-sonnet-5-5 playwright Signed-off-by: Ettore Di Giacinto --- .../e2e/backends-installed-node-removal.spec.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/http/react-ui/e2e/backends-installed-node-removal.spec.js b/core/http/react-ui/e2e/backends-installed-node-removal.spec.js index c059a6d52..00eb3b2ef 100644 --- a/core/http/react-ui/e2e/backends-installed-node-removal.spec.js +++ b/core/http/react-ui/e2e/backends-installed-node-removal.spec.js @@ -414,11 +414,13 @@ for (const beforeConfirm of [false, true]) test(`generic deletion blocks targete history.pushState({}, '', url); dispatchEvent(new PopStateEvent('popstate')) }, ids[0]) } - // The popstate renders the targeted page in a later commit. A click that - // lands before it reaches a button that is missing or still disabled and - // sends nothing. - await expect(reinstall(page)).toBeEnabled() - await reinstall(page).evaluate(el => el.click()) + // The popstate renders the targeted page in a later commit. Until then the + // page still draws the generic Reinstall button, which is enabled and has + // the same name, so the wait must be for the button of the target node. A + // click on the generic one sends no node request. + const onTarget = reinstall(page).and(page.getByTitle(`Reinstall on ${ids[0]}`)) + await expect(onTarget).toBeEnabled() + await onTarget.evaluate(el => el.click()) await expect.poll(() => s.installs.length).toBe(1) if (beforeConfirm) { await confirm(page).click()