fix: ci testing (#529)

* fix: ci

* fix: ci
This commit is contained in:
yuyutaotao 2025-04-03 10:51:50 +08:00 committed by GitHub
parent bc645c3d0c
commit 0171b5e2de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 8 deletions

View File

@ -1,11 +1,12 @@
import { AiLocateElement } from '@/ai-model';
import { AiLocateSection } from '@/ai-model/inspect';
import { vlLocateMode } from '@/env';
import { saveBase64Image } from '@/image';
import { getTmpFile } from '@/utils';
import { getContextFromFixture } from 'tests/evaluation';
import { expect, test } from 'vitest';
test(
test.skipIf(!vlLocateMode())(
'locate section',
async () => {
const { context } = await getContextFromFixture('antd-tooltip');
@ -21,7 +22,6 @@ test(
base64Data: imageBase64!,
outputPath: tmpFile!,
});
console.log('tmpFile', tmpFile);
},
{
timeout: 60 * 1000,

View File

@ -7,6 +7,7 @@ import type {
plan,
} from '@midscene/core';
import type { AiLocateSection } from '@midscene/core/ai-model';
import { vlLocateMode } from '@midscene/core/env';
import type { TestCase } from '../tests/util';
type ActualResult =
@ -229,7 +230,7 @@ ${errorMsg ? `Error: ${errorMsg}` : ''}
}
// compare coordinates
if (testCase.response_rect) {
if (testCase.response_rect && vlLocateMode()) {
const resultRect = (result as LocateResult).rect;
if (!resultRect) {
throw new Error(

View File

@ -3,7 +3,7 @@ import { expect } from 'playwright/test';
import { test } from '../playwright/fixture';
import { getLastModifiedReportHTMLFile } from '../playwright/util';
test('ai report', async ({ page, ai, aiAssert }, testInfo) => {
test('ai report', async ({ page, ai, aiAssert, aiQuery }, testInfo) => {
testInfo.snapshotSuffix = '';
await new Promise((resolve) => setTimeout(resolve, 3000));
const htmlFile = getLastModifiedReportHTMLFile(
@ -17,11 +17,8 @@ test('ai report', async ({ page, ai, aiAssert }, testInfo) => {
await ai(
'Move your mouse over the task file path (on the right of the logo, with a check or cross icon) and click ai todo from the drop-down list',
);
const actionsList = await ai(
const actionsList = await aiQuery(
'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);