Skip to content

Commit 78aecc8

Browse files
committed
test: add more test
1 parent 6b942fe commit 78aecc8

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

packages/web-integration/tests/ai/appium/android.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,29 @@ const ANDROID_DEFAULT_OPTIONS = {
1919

2020
describe(
2121
'appium integration',
22-
() => {
23-
it('Android settings page demo', async () => {
22+
async () => {
23+
await it('Android settings page demo for input', async () => {
2424
const page = await launchPage(ANDROID_DEFAULT_OPTIONS);
2525
const mid = new AppiumAgent(page);
2626

2727
await mid.aiAction('输入框中输入“123”');
2828
await mid.aiAction('输入框中输入“456”');
2929
await mid.aiAction('输入框中输入“789”');
3030
});
31+
await it('Android settings page demo for scroll', async () => {
32+
const page = await launchPage(ANDROID_DEFAULT_OPTIONS);
33+
const mid = new AppiumAgent(page);
34+
35+
await mid.aiAction('滑动列表到底部');
36+
await mid.aiAction('打开"更多设置"');
37+
await mid.aiAction('滑动列表到底部');
38+
await mid.aiAction('滑动列表到顶部');
39+
await mid.aiAction('向下滑动一屏');
40+
await mid.aiAction('向上滑动一屏');
41+
});
3142
},
3243
{
3344
timeout: 360 * 1000,
3445
},
3546
);
47+

packages/web-integration/tests/ai/appium/ios.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,26 @@ const IOS_DEFAULT_OPTIONS = {
2020

2121
describe(
2222
'appium integration',
23-
() => {
24-
it('iOS settings page demo', async () => {
23+
async () => {
24+
await it('iOS settings page demo for input', async () => {
2525
const page = await launchPage(IOS_DEFAULT_OPTIONS);
2626
const mid = new AppiumAgent(page);
2727

2828
await mid.aiAction('输入框中输入“123”');
2929
await mid.aiAction('输入框中输入“456”');
3030
await mid.aiAction('输入框中输入“789”');
3131
});
32+
await it('iOS settings page demo for scroll', async () => {
33+
const page = await launchPage(IOS_DEFAULT_OPTIONS);
34+
const mid = new AppiumAgent(page);
35+
36+
await mid.aiAction('滑动列表到底部');
37+
await mid.aiAction('打开"开发者"');
38+
await mid.aiAction('滑动列表到底部');
39+
await mid.aiAction('滑动列表到顶部');
40+
await mid.aiAction('向下滑动一屏');
41+
await mid.aiAction('向上滑动一屏');
42+
});
3243
},
3344
{
3445
timeout: 360 * 1000,

packages/web-integration/tests/ai/playright/generate-test-data.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { generateExtractData, generateTestDataPath } from '@/debug';
22
import { test } from '@playwright/test';
3-
import { PlaywrightPage } from '../../../src/playwright';
3+
import { PlaywrightPage } from '@/playwright';
44

55
function sleep(time: number) {
66
return new Promise((resolve) => {

packages/web-integration/tests/ai/playright/tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'node:path';
33
import type { WebPage } from '@/common/page';
44
import { resizeImg, saveBase64Image } from '@midscene/core/image';
55
import { processImageElementInfo } from '@midscene/shared/img';
6-
import { getElementInfos } from '../../../src/debug';
6+
import { getElementInfos } from '@/debug';
77

88
export async function generateExtractData(
99
page: WebPage,

packages/web-integration/tests/unit-test/client-extractor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
22
import { join } from 'node:path';
33
import { describe, expect, it } from 'vitest';
44

5-
import { AppiumPage } from '../../src/appium';
5+
import { AppiumPage } from '@/appium';
66

77
const iosXmlPath = join(
88
__dirname,

0 commit comments

Comments
 (0)