akumatus
2025-04-24 14:32:54 +00:00
parent 807cba03ee
commit 3d2f0e7b5b
10 changed files with 235 additions and 115 deletions

View File

@@ -0,0 +1,30 @@
import { test } from '../base/base-test';
test.describe('AIChatWith/Reasoning', () => {
test.beforeEach(async ({ loggedInPage: page, utils }) => {
await utils.testUtils.setupTestEnvironment(page);
await utils.chatPanel.openChatPanel(page);
});
test('should support chat with reasoning', async ({
loggedInPage: page,
utils,
}) => {
await utils.chatPanel.enableReasoning(page);
await utils.chatPanel.makeChat(
page,
'How do you measure exactly 4 liters of water using a jug that only holds 3 and 5 liters?'
);
await utils.chatPanel.waitForHistory(page, [
{
role: 'user',
content:
'How do you measure exactly 4 liters of water using a jug that only holds 3 and 5 liters?',
},
{
role: 'assistant',
status: 'success',
},
]);
});
});

View File

@@ -305,6 +305,20 @@ export class ChatPanelUtils {
}
}
public static async enableReasoning(page: Page) {
const reasoning = page.getByTestId('chat-reasoning');
if ((await reasoning.getAttribute('data-active')) === 'false') {
await reasoning.click();
}
}
public static async disableReasoning(page: Page) {
const reasoning = page.getByTestId('chat-reasoning');
if ((await reasoning.getAttribute('data-active')) === 'true') {
await reasoning.click();
}
}
public static async isNetworkSearchEnabled(page: Page) {
const networkSearch = await page.getByTestId('chat-network-search');
return (await networkSearch.getAttribute('aria-disabled')) === 'false';