Skip to content

Self-hosted workflows for coding-agent delivery. Orchestrate CodeBuddy, Codex and Claude Code with scripts and human approval gates. Includes Local workflows for coding assistants.

test(e2e): wait for committed replies and ignore stalled first loads (#95)

Robert0622887d95e8e669
diff --git a/e2e/public/composer.spec.mjs b/e2e/public/composer.spec.mjs
index 38af9434..412d939a 100644
--- a/e2e/public/composer.spec.mjs
+++ b/e2e/public/composer.spec.mjs
@@ -69,6 +69,11 @@ test('the configured home composer sends a real model reply and reloads its save
await expect.poll(sessionId).not.toBe('');
await page.reload();
await expect(chat(page).locator('.message.assistant').last()).toContainText(marker,{timeout:30_000});
+ // The streamed reply is visible before the background generation commits it.
+ await expect.poll(async()=>{
+ const generation=await page.request.get(`/api/assistant/sessions/${sessionId()}/generation`);
+ return generation.ok()?(await generation.json()).status:'';
+ },{timeout:30_000}).toBe('completed');
const saved=await page.request.get(`/api/assistant/sessions/${sessionId()}`);
expect(saved.ok()).toBe(true);
expect((await saved.json()).messages.some(m=>m.role==='assistant'&&m.content.includes(marker))).toBe(true);
diff --git a/e2e/public/executors.spec.mjs b/e2e/public/executors.spec.mjs
index e0e017ea..a4af341f 100644
--- a/e2e/public/executors.spec.mjs
+++ b/e2e/public/executors.spec.mjs
@@ -6,6 +6,8 @@ test.use({trace:'off',screenshot:'off'});
for(const viewport of [{width:1280,height:400},{width:390,height:600}]){
test(`the executor and model menus stay usable at ${viewport.width}x${viewport.height}`,async({page})=>{
const errors=[];page.on('pageerror',e=>errors.push(e.message));
+ // appReady may reload a stalled first load; only the document under test counts.
+ page.on('request',r=>{if(r.isNavigationRequest()&&r.frame()===page.mainFrame())errors.length=0});
await page.setViewportSize(viewport);
await signInUnconfigured(page);
await openHome(page);