yuyutaotao f9dc0f698e
feat(ai-model): merge ai planning and insight call to accelerate the aiAction (#97)
---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>

* feat(ai-model): optimize AI model for element inspection

* feat(ai-model): optimize AI model and add quick answer functionality

---------

Co-authored-by: yuyutaotao <167746126+yuyutaotao@users.noreply.github.com>

* feat(ai-model): implement quick answer functionality for element inspection

---------

Co-authored-by: zhouxiao.shaw <zhouxiao.shaw@bytedance.com>
2024-10-12 12:09:25 +08:00

30 lines
1.1 KiB
TypeScript

import path from 'node:path';
import { expect } from 'playwright/test';
import { test } from '../playwright/fixture';
import { getLastModifiedReportHTMLFile } from '../playwright/util';
test('ai report', async ({ page, ai, aiAssert }, testInfo) => {
testInfo.snapshotSuffix = '';
await new Promise((resolve) => setTimeout(resolve, 3000));
const htmlFile = getLastModifiedReportHTMLFile(
path.join(__dirname, '../../../../midscene_run/report'),
);
console.log('report html path:', htmlFile);
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(`file:${htmlFile}`);
await ai(
'Move your mouse over the top task list (next to the logo) and click ai todo from the drop-down list',
);
const actionsList = await ai(
'Array<{title: string(task name,include action、wait), actions: Array<string(task action name,Excluding time)>}>',
{
type: 'query',
},
);
const parseList = JSON.stringify(actionsList, null, 4);
console.log('parseList:', parseList);
await aiAssert(
'On the left taskbar, check whether the specific execution content of the right task is normal',
);
});