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()