Add teacher microphone and per-question model selection
This commit is contained in:
1 parent
cd1ba41e21
commit
78cfde6734
20 files changed
+517
-37
No files matched your search
@@ -189,3 +189,20 @@ for (const width of [319, 508]) for (const kind of ['ordinary', 'ideas', 'struct
|
||||
expect(errors).toEqual([]);
|
||||
});
|
||||
}
|
||||
|
||||
for (const width of [319, 508]) test(`teacher model selector and microphone fit the composer at ${width}px`, async ({ page }) => {
|
||||
await page.goto(`${url}?kind=rich-text&width=${width}`);
|
||||
const panel = page.getByTestId('teacher-chat-panel');
|
||||
const input = page.getByRole('textbox', { name: '向智能体提问' });
|
||||
await input.fill('语音和选模测试草稿');
|
||||
await panel.getByRole('button', { name: /老师模型/ }).click();
|
||||
await page.getByRole('menuitemradio', { name: 'test-second-model' }).click();
|
||||
await expect(input).toHaveValue('语音和选模测试草稿');
|
||||
await expect(panel.getByRole('button', { name: '语音输入' })).toBeVisible();
|
||||
expect(await panel.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true);
|
||||
const controls = panel.getByTestId('teacher-composer-runtime-controls');
|
||||
expect(await controls.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true);
|
||||
await panel.screenshot({ path: test.info().outputPath(`teacher-composer-${width}.png`) });
|
||||
await panel.getByRole('button', { name: '提问', exact: true }).click();
|
||||
expect(await page.evaluate(() => (window as unknown as { __teacherReplyInputs: Array<{modelId?: string}> }).__teacherReplyInputs.at(-1)?.modelId)).toBe('test-second-model');
|
||||
});
|
||||
Reference in new issue
Block a user