test(app): verify deployed chat and stage debugging on both hosts

This commit is contained in:
2026-10-24 02:13:23 +01:00
parent d915f69226
commit 20337f5f6f
2 changed files with 35 additions and 8 deletions
+10 -4
View File
@@ -46,6 +46,12 @@ try {
const port = await waitForPort(join(profile, 'DevToolsActivePort'));
connection = await connect((await waitForPage(port)).webSocketDebuggerUrl);
await connection.send('Page.enable');
if (process.env.PROBE_PLATFORM === 'material') {
await connection.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36',
platform: 'Win32',
});
}
await connection.send('Emulation.setDeviceMetricsOverride', {
width: 390, height: 844, deviceScaleFactor: 1, mobile: true,
});
@@ -74,6 +80,7 @@ try {
// Flutter web paints SelectableText reasoning/raw documents on its canvas;
// those bodies are not consistently present in Chrome's accessibility tree.
const assertPainted = async (text, label, name) => {
await sleep(300);
await capture(connection, output, log, name);
const { stdout } = await promisify(execFile)('tesseract', [
log.captures.at(-1), 'stdout',
@@ -83,14 +90,14 @@ try {
log.checks.push(label);
};
await visit('/chat/ses_probechat');
await assertName(connection, 'Stored probe answer.', 'stored chat loaded', log);
await assertPainted('Stored probe answer.', 'stored chat loaded', 'chat-stored');
await event({ kind: 'step', step: { status: 'running', turn_id: 'stream-turn' } });
await event({ kind: 'reasoning', message_id: 'live-answer',
part: { id: 'reasoning-0', type: 'reasoning' }, delta: 'Checking the recorded evidence.' });
await event({ kind: 'text', message_id: 'live-answer',
part: { id: 'text-0', type: 'text' }, delta: 'The answer is arriving.' });
await assertPainted('Checking the recorded evidence.', 'reasoning visible while text streams', 'chat-live-reasoning');
await assertName(connection, 'The answer is arriving.', 'streamed answer visible', log);
await assertPainted('The answer is arriving.', 'streamed answer visible', 'chat-live-answer');
const field = (await axNodes(connection)).find(node => node.role?.value === 'textbox');
assert.ok(field, 'composer text field');
const { model } = await connection.send('DOM.getBoxModel', { backendNodeId: field.backendDOMNodeId });
@@ -110,8 +117,7 @@ try {
assert.equal(state.chatInterrupts, 0);
assert.equal(state.chatRunning, true);
log.checks.push('follow-up sent while running, without interrupting');
await assertName(connection, 'Queued', 'server queue acknowledgement visible', log);
await capture(connection, output, log, 'chat-queued-follow-up');
await assertPainted('Queued', 'server queue acknowledgement visible', 'chat-queued-follow-up');
await event({ kind: 'reasoning', message_id: 'live-answer',
part: { id: 'reasoning-0', type: 'reasoning' }, delta: ' The reasoning continues live.' });
await assertPainted('The reasoning continues live.', 'reasoning keeps updating after follow-up', 'chat-reasoning-updated');