2024-08-22 20:56:34 +08:00
|
|
|
import path from 'node:path';
|
|
|
|
import { expect } from 'playwright/test';
|
2024-09-06 17:19:35 +08:00
|
|
|
import { test } from '../playwright/fixture';
|
|
|
|
import { getLastModifiedReportHTMLFile } from '../playwright/util';
|
2024-08-22 20:56:34 +08:00
|
|
|
|
|
|
|
test('ai report', async ({ page, ai, aiAssert }, testInfo) => {
|
|
|
|
testInfo.snapshotSuffix = '';
|
|
|
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
|
|
const htmlFile = getLastModifiedReportHTMLFile(
|
2024-09-06 17:19:35 +08:00
|
|
|
path.join(__dirname, '../../../../midscene_run/report'),
|
2024-08-22 20:56:34 +08:00
|
|
|
);
|
|
|
|
console.log('report html path:', htmlFile);
|
2024-09-29 17:16:07 +08:00
|
|
|
await page.setViewportSize({ width: 1920, height: 1080 });
|
2024-08-22 20:56:34 +08:00
|
|
|
await page.goto(`file:${htmlFile}`);
|
|
|
|
await ai(
|
2024-08-23 10:57:08 +08:00
|
|
|
'Move your mouse over the top task list (next to the logo) and click ai todo from the drop-down list',
|
2024-08-22 20:56:34 +08:00
|
|
|
);
|
|
|
|
const actionsList = await ai(
|
2024-08-23 10:57:08 +08:00
|
|
|
'Array<{title: string(task name,include action、wait), actions: Array<string(task action name,Excluding time)>}>',
|
2024-08-22 20:56:34 +08:00
|
|
|
{
|
|
|
|
type: 'query',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
await aiAssert(
|
|
|
|
'On the left taskbar, check whether the specific execution content of the right task is normal',
|
|
|
|
);
|
|
|
|
});
|