@midscene/cli 1.8.7 → 1.8.8-beta-20260601092817.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/framework/index.mjs +3880 -0
- package/dist/es/framework/index.mjs.map +1 -0
- package/dist/es/index.mjs +368 -1155
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/framework/index.js +3989 -0
- package/dist/lib/framework/index.js.map +1 -0
- package/dist/lib/index.js +400 -1153
- package/dist/lib/index.js.map +1 -1
- package/dist/types/framework/index.d.ts +152 -0
- package/package.json +8 -7
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { MidsceneYamlConfigResult } from '@midscene/core';
|
|
2
|
+
import type { MidsceneYamlScript } from '@midscene/core';
|
|
3
|
+
import type { MidsceneYamlScriptAndroidEnv } from '@midscene/core';
|
|
4
|
+
import type { MidsceneYamlScriptEnv } from '@midscene/core';
|
|
5
|
+
import type { MidsceneYamlScriptIOSEnv } from '@midscene/core';
|
|
6
|
+
import type { MidsceneYamlScriptWebEnv } from '@midscene/core';
|
|
7
|
+
import { ScriptPlayer } from '@midscene/core/yaml';
|
|
8
|
+
|
|
9
|
+
declare interface BatchRunnerConfig {
|
|
10
|
+
files: string[];
|
|
11
|
+
concurrent: number;
|
|
12
|
+
continueOnError: boolean;
|
|
13
|
+
summary: string;
|
|
14
|
+
shareBrowserContext: boolean;
|
|
15
|
+
globalConfig?: {
|
|
16
|
+
web?: Partial<MidsceneYamlScriptWebEnv>;
|
|
17
|
+
android?: Partial<MidsceneYamlScriptAndroidEnv>;
|
|
18
|
+
ios?: Partial<MidsceneYamlScriptIOSEnv>;
|
|
19
|
+
target?: Partial<MidsceneYamlScriptWebEnv>;
|
|
20
|
+
};
|
|
21
|
+
headed: boolean;
|
|
22
|
+
keepWindow: boolean;
|
|
23
|
+
dotenvOverride: boolean;
|
|
24
|
+
dotenvDebug: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare function createRstestYamlProject(options: CreateRstestYamlProjectOptions): GeneratedRstestYamlProject;
|
|
28
|
+
|
|
29
|
+
export declare interface CreateRstestYamlProjectOptions {
|
|
30
|
+
files: string[];
|
|
31
|
+
projectDir?: string;
|
|
32
|
+
outputDir?: string;
|
|
33
|
+
resultDir?: string;
|
|
34
|
+
frameworkImport?: string;
|
|
35
|
+
caseOptions?: Record<string, RstestYamlCaseOptions>;
|
|
36
|
+
webRuntimeOptions?: Record<string, WebYamlRuntimeOptions>;
|
|
37
|
+
maxConcurrency?: number;
|
|
38
|
+
testTimeout?: number;
|
|
39
|
+
bail?: number;
|
|
40
|
+
batchConfig?: BatchRunnerConfig;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare const createYamlCaseFailure: (result: MidsceneYamlConfigResult) => Error;
|
|
44
|
+
|
|
45
|
+
export declare const createYamlCaseResult: (file: string, player: ScriptPlayer<MidsceneYamlScriptEnv>, duration: number) => MidsceneYamlConfigResult;
|
|
46
|
+
|
|
47
|
+
export declare function defineYamlBatchTest(options: DefineYamlBatchTestOptions): void;
|
|
48
|
+
|
|
49
|
+
export declare interface DefineYamlBatchTestOptions {
|
|
50
|
+
testName: string;
|
|
51
|
+
config: BatchRunnerConfig;
|
|
52
|
+
resultFiles: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare function defineYamlCaseTest(options: DefineYamlCaseTestOptions): void;
|
|
56
|
+
|
|
57
|
+
export declare interface DefineYamlCaseTestOptions {
|
|
58
|
+
testName: string;
|
|
59
|
+
yamlFile: string;
|
|
60
|
+
resultFile: string;
|
|
61
|
+
caseOptions?: Omit<RunYamlCaseOptions, 'file' | 'headed' | 'keepWindow'>;
|
|
62
|
+
webRuntimeOptions?: Pick<RunYamlCaseOptions, 'headed' | 'keepWindow'>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export declare interface FrameworkTestCommandOptions extends WebRuntimeOptions {
|
|
66
|
+
projectDir?: string;
|
|
67
|
+
files?: string[];
|
|
68
|
+
concurrent?: number;
|
|
69
|
+
outputDir?: string;
|
|
70
|
+
frameworkImport?: string;
|
|
71
|
+
stdio?: 'inherit' | 'pipe';
|
|
72
|
+
rstestRunner?: typeof runRstestYamlProject;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export declare interface GeneratedRstestYamlProject {
|
|
76
|
+
projectDir: string;
|
|
77
|
+
outputDir: string;
|
|
78
|
+
resultDir: string;
|
|
79
|
+
include: string[];
|
|
80
|
+
virtualModules: Record<string, string>;
|
|
81
|
+
cases: GeneratedYamlTestCase[];
|
|
82
|
+
maxConcurrency?: number;
|
|
83
|
+
testTimeout: number;
|
|
84
|
+
bail?: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare interface GeneratedYamlTestCase {
|
|
88
|
+
yamlFile: string;
|
|
89
|
+
testModule: string;
|
|
90
|
+
resultFile: string;
|
|
91
|
+
testName: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare const getYamlPlayerFailure: (player: ScriptPlayer<MidsceneYamlScriptEnv>) => Error | undefined;
|
|
95
|
+
|
|
96
|
+
export declare function resolveRstestCoreImportPath(): string;
|
|
97
|
+
|
|
98
|
+
export declare const resolveTestName: (projectDir: string, yamlFile: string) => string;
|
|
99
|
+
|
|
100
|
+
export declare type RstestYamlCaseOptions = Omit<RunYamlCaseOptions, 'file' | 'headed' | 'keepWindow'>;
|
|
101
|
+
|
|
102
|
+
export declare function runFrameworkTestConfig(config: BatchRunnerConfig, commandOptions?: FrameworkTestCommandOptions): Promise<number>;
|
|
103
|
+
|
|
104
|
+
export declare function runRstestYamlProject(options: RunRstestYamlProjectOptions): Promise<number>;
|
|
105
|
+
|
|
106
|
+
export declare interface RunRstestYamlProjectOptions {
|
|
107
|
+
project: GeneratedRstestYamlProject;
|
|
108
|
+
cwd?: string;
|
|
109
|
+
stdio?: 'inherit' | 'pipe';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare function runYamlBatchInRstest(options: RunYamlBatchInRstestOptions): Promise<MidsceneYamlConfigResult[]>;
|
|
113
|
+
|
|
114
|
+
export declare interface RunYamlBatchInRstestOptions {
|
|
115
|
+
config: BatchRunnerConfig;
|
|
116
|
+
resultFiles: Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export declare function runYamlCase(options: RunYamlCaseOptions): Promise<RunYamlCaseResult>;
|
|
120
|
+
|
|
121
|
+
declare interface RunYamlCaseGlobalConfig {
|
|
122
|
+
web?: Partial<MidsceneYamlScriptWebEnv>;
|
|
123
|
+
android?: Partial<MidsceneYamlScriptAndroidEnv>;
|
|
124
|
+
ios?: Partial<MidsceneYamlScriptIOSEnv>;
|
|
125
|
+
target?: Partial<MidsceneYamlScriptWebEnv>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export declare interface RunYamlCaseOptions {
|
|
129
|
+
file: string;
|
|
130
|
+
executionConfig?: MidsceneYamlScript;
|
|
131
|
+
globalConfig?: RunYamlCaseGlobalConfig;
|
|
132
|
+
headed?: boolean;
|
|
133
|
+
keepWindow?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export declare interface RunYamlCaseResult {
|
|
137
|
+
file: string;
|
|
138
|
+
output?: string;
|
|
139
|
+
report?: string | null;
|
|
140
|
+
duration: number;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export declare function runYamlCaseResult(options: RunYamlCaseOptions): Promise<MidsceneYamlConfigResult>;
|
|
144
|
+
|
|
145
|
+
declare interface WebRuntimeOptions {
|
|
146
|
+
headed?: boolean;
|
|
147
|
+
keepWindow?: boolean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export declare type WebYamlRuntimeOptions = Pick<RunYamlCaseOptions, 'headed' | 'keepWindow'>;
|
|
151
|
+
|
|
152
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/cli",
|
|
3
3
|
"description": "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.8-beta-20260601092817.0",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
"bin"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@rstest/core": "0.10.3",
|
|
18
19
|
"http-server": "14.1.1",
|
|
19
20
|
"lodash.merge": "4.6.2",
|
|
20
21
|
"puppeteer": "24.6.0",
|
|
21
|
-
"@midscene/android": "1.8.
|
|
22
|
-
"@midscene/
|
|
23
|
-
"@midscene/
|
|
24
|
-
"@midscene/
|
|
25
|
-
"@midscene/shared": "1.8.
|
|
26
|
-
"@midscene/
|
|
22
|
+
"@midscene/android": "1.8.8-beta-20260601092817.0",
|
|
23
|
+
"@midscene/core": "1.8.8-beta-20260601092817.0",
|
|
24
|
+
"@midscene/computer": "1.8.8-beta-20260601092817.0",
|
|
25
|
+
"@midscene/web": "1.8.8-beta-20260601092817.0",
|
|
26
|
+
"@midscene/shared": "1.8.8-beta-20260601092817.0",
|
|
27
|
+
"@midscene/ios": "1.8.8-beta-20260601092817.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@rslib/core": "^0.18.3",
|