ci: nightly browser suite; fix stale session-id extraction in browser tests

WIP: the suite still has failures on a clean master that are not fixed here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Devvyn
2026-10-06 09:20:55 +08:00
co-authored by Claude Sonnet 5.5
parent ac94f339ac
commit ab7e89873f
4 changed files with 75 additions and 6 deletions
+10 -5
View File
@@ -123,7 +123,8 @@ describe('OpenCode session initial resize', () => {
body: JSON.stringify({ workingDir: '/tmp', name: 'oc-resize-test' }),
});
const data = await res.json();
return data.id ?? data.session?.id;
// POST /api/sessions answers in the { success, data: { session } } envelope.
return data.data?.session?.id ?? data.id ?? data.session?.id;
});
expect(sessionId).toBeTruthy();
@@ -168,7 +169,8 @@ describe('OpenCode session initial resize', () => {
body: JSON.stringify({ workingDir: '/tmp', name: 'oc-earlyret-test' }),
});
const data = await res.json();
return data.id ?? data.session?.id;
// POST /api/sessions answers in the { success, data: { session } } envelope.
return data.data?.session?.id ?? data.id ?? data.session?.id;
});
expect(sessionId).toBeTruthy();
@@ -219,7 +221,8 @@ describe('OpenCode session initial resize', () => {
body: JSON.stringify({ workingDir: '/tmp', name: 'oc-refresh-test' }),
});
const data = await res.json();
return data.id ?? data.session?.id;
// POST /api/sessions answers in the { success, data: { session } } envelope.
return data.data?.session?.id ?? data.id ?? data.session?.id;
});
expect(sessionId).toBeTruthy();
@@ -287,7 +290,8 @@ describe('OpenCode close modal text', () => {
body: JSON.stringify({ workingDir: '/tmp', name: 'oc-close-test', mode: 'opencode' }),
});
const data = await res.json();
return data.id ?? data.session?.id;
// POST /api/sessions answers in the { success, data: { session } } envelope.
return data.data?.session?.id ?? data.id ?? data.session?.id;
});
expect(sessionId).toBeTruthy();
@@ -329,7 +333,8 @@ describe('OpenCode close modal text', () => {
body: JSON.stringify({ workingDir: '/tmp', name: 'cc-close-test' }),
});
const data = await res.json();
return data.id ?? data.session?.id;
// POST /api/sessions answers in the { success, data: { session } } envelope.
return data.data?.session?.id ?? data.id ?? data.session?.id;
});
expect(sessionId).toBeTruthy();
+2 -1
View File
@@ -69,7 +69,8 @@ async function createSession(page: Page, name: string): Promise<string> {
body: JSON.stringify({ workingDir: '/tmp', name: n }),
});
const data = await res.json();
return data.id ?? data.session?.id;
// POST /api/sessions answers in the { success, data: { session } } envelope.
return data.data?.session?.id ?? data.id ?? data.session?.id;
}, name);
return result as string;
}