mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-07-23 17:02:10 +00:00

* feat(cache): The cache is generalized to support Puppeteers and mobile terminals * chore: update cache test * chore: update cache test * chore: update cache test * docs: update cache doc * chore: update ai test command * chore: update ai test command * chore: update ai test command * chore: optimize cache logic * chore: update get dir path logic * chore: update get dir path logic
29 lines
1.1 KiB
TypeScript
29 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.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);
|
|
expect(parseList).toMatchSnapshot();
|
|
await aiAssert(
|
|
'On the left taskbar, check whether the specific execution content of the right task is normal',
|
|
);
|
|
});
|