From 821fbe8e9b01e627ac6cd66f870be55b5bda2f52 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Tue, 10 Nov 2026 13:30:30 -0600 Subject: [PATCH] test(webui): wait for the bus run button after open (#1873) open() waits only for the editor title; the setup step enables the bus run button after its async /setup read. Under load the assert ran first and failed (A1 final gate, 2 of 4 runs). Wait for the enabled button instead. --- packages/webui/tests/org-archive-browser.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webui/tests/org-archive-browser.test.mjs b/packages/webui/tests/org-archive-browser.test.mjs index e2db1ab1d..9f4960d10 100644 --- a/packages/webui/tests/org-archive-browser.test.mjs +++ b/packages/webui/tests/org-archive-browser.test.mjs @@ -131,7 +131,7 @@ test('owner can start a down bus after setup recorded done and sees recovery gui const f = await fixture(t); await f.b.evaluate(`(()=>{const old=window.fetch;window.fetch=async (input,init={})=>{const u=String(input);if(u.endsWith('/setup') && (!init.method || init.method==='GET'))return new Response(JSON.stringify({notifications:{state:'done'},queue:{state:'done'},projects:[],bus:{state:'done',verb:'mosaic bus start alpha'}}),{status:200});if(u.endsWith('/setup/bus') && init.method==='POST')return new Response(JSON.stringify({error:'stale-lock',message:'stale bus host lock'}),{status:409});return old(input,init)}})()`); await f.open('alpha'); - assert.equal(await f.b.evaluate(`!!document.querySelector('[data-step="bus"] [data-run="bus"]:not(:disabled)')`), true); + await f.wait(`!!document.querySelector('[data-step="bus"] [data-run="bus"]:not(:disabled)')`); await f.b.evaluate(`document.querySelector('[data-step="bus"] [data-run="bus"]').click()`); await f.wait(`document.querySelector('[data-step="bus"]').innerText.includes('stale bus host lock')`); assert.match(await f.b.evaluate(`document.querySelector('[data-step="bus"]').innerText`), /mosaic bus recover alpha/);