@midscene/test 1.12.10-beta-20260920031616.0 → 1.13.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/{1~891.mjs → 1~214.mjs} +6 -6
- package/dist/es/{1~891.mjs.map → 1~214.mjs.map} +1 -1
- package/dist/es/cli/index.mjs +534 -1700
- package/dist/es/cli/index.mjs.map +1 -1
- package/dist/es/index.mjs +57 -1525
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/midscene/index.mjs +93 -168
- package/dist/es/midscene/index.mjs.map +1 -1
- package/dist/es/runtime/index.mjs +317 -0
- package/dist/es/runtime/index.mjs.map +1 -0
- package/dist/es/test-cli.mjs +666 -1780
- package/dist/es/test-cli.mjs.map +1 -1
- package/dist/lib/{0~458.js → 0~160.js} +5 -5
- package/dist/lib/{0~458.js.map → 0~160.js.map} +1 -1
- package/dist/lib/cli/index.js +545 -1711
- package/dist/lib/cli/index.js.map +1 -1
- package/dist/lib/index.js +92 -1557
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/midscene/index.js +130 -172
- package/dist/lib/midscene/index.js.map +1 -1
- package/dist/lib/runtime/index.js +372 -0
- package/dist/lib/runtime/index.js.map +1 -0
- package/dist/lib/test-cli.js +670 -1784
- package/dist/lib/test-cli.js.map +1 -1
- package/dist/types/cli/index.d.ts +62 -233
- package/dist/types/index.d.ts +186 -492
- package/dist/types/midscene/index.d.ts +82 -96
- package/dist/types/runtime/index.d.ts +52 -0
- package/package.json +51 -8
package/dist/types/index.d.ts
CHANGED
|
@@ -1,115 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import { Awaitable } from '@midscene/core/internal/test-runner';
|
|
2
|
+
import { buildTestRunReportDump } from '@midscene/core/internal/test-runner';
|
|
3
|
+
import { CaseDefinition } from '@midscene/core/internal/test-runner';
|
|
4
|
+
import { CaseExecutionContext } from '@midscene/core/internal/test-runner';
|
|
5
|
+
import { CaseExecutionError } from '@midscene/core/internal/test-runner';
|
|
6
|
+
import { CaseInput } from '@midscene/core/internal/test-runner';
|
|
7
|
+
import { CaseNodePhase } from '@midscene/core/internal/test-runner';
|
|
8
|
+
import { CaseRunner as CaseRunner_2 } from '@midscene/core/internal/test-runner';
|
|
9
|
+
import { CaseRunStatus } from '@midscene/core/internal/test-runner';
|
|
10
|
+
import { collectTestRunReportSources } from '@midscene/core/internal/test-runner';
|
|
11
|
+
import type * as Core from '@midscene/core/internal/test-runner';
|
|
12
|
+
import { createProjectRuntime } from '@midscene/core/internal/test-runner';
|
|
13
|
+
import { DocumentNodePhase } from '@midscene/core/internal/test-runner';
|
|
14
|
+
import { DuplicateNodeError } from '@midscene/core/internal/test-runner';
|
|
15
|
+
import { DurationInput } from '@midscene/core/internal/test-runner';
|
|
16
|
+
import { FatalDeviceError } from '@midscene/core/internal/test-runner';
|
|
17
|
+
import { isFatalDeviceError } from '@midscene/core/internal/test-runner';
|
|
18
|
+
import { JsonValue } from '@midscene/core/internal/test-runner';
|
|
19
|
+
import { NodeCaseContext } from '@midscene/core/internal/test-runner';
|
|
20
|
+
import { NodeDefinitionError } from '@midscene/core/internal/test-runner';
|
|
21
|
+
import { NodeDocumentContext } from '@midscene/core/internal/test-runner';
|
|
22
|
+
import { NodeExecutionError } from '@midscene/core/internal/test-runner';
|
|
23
|
+
import { NodeExecutionPhase } from '@midscene/core/internal/test-runner';
|
|
24
|
+
import { NodeExecutionReturn } from '@midscene/core/internal/test-runner';
|
|
25
|
+
import { NodeInputSchema } from '@midscene/core/internal/test-runner';
|
|
26
|
+
import { NodeInputValidationError } from '@midscene/core/internal/test-runner';
|
|
27
|
+
import { NodeNotFoundError } from '@midscene/core/internal/test-runner';
|
|
28
|
+
import { NodeRegistry as NodeRegistry_2 } from '@midscene/core/internal/test-runner';
|
|
29
|
+
import { NodeReportCollector } from '@midscene/core/internal/test-runner';
|
|
30
|
+
import { NodeReportTrace } from '@midscene/core/internal/test-runner';
|
|
31
|
+
import { NodeResult } from '@midscene/core/internal/test-runner';
|
|
32
|
+
import { NodeScopeTeardownError } from '@midscene/core/internal/test-runner';
|
|
33
|
+
import { normalizeNodeExecutionError } from '@midscene/core/internal/test-runner';
|
|
34
|
+
import { ProjectRuntime } from '@midscene/core/internal/test-runner';
|
|
35
|
+
import { ProjectRuntimeOptions } from '@midscene/core/internal/test-runner';
|
|
36
|
+
import { ProjectRuntimeResult } from '@midscene/core/internal/test-runner';
|
|
37
|
+
import { ProjectSetupError } from '@midscene/core/internal/test-runner';
|
|
38
|
+
import { ProjectTeardownError } from '@midscene/core/internal/test-runner';
|
|
39
|
+
import { ResolveNodeForNormalization } from '@midscene/core/internal/test-runner';
|
|
40
|
+
import { sanitizeReportError } from '@midscene/core/internal/test-runner';
|
|
41
|
+
import { sanitizeReportText } from '@midscene/core/internal/test-runner';
|
|
42
|
+
import { sanitizeReportValue } from '@midscene/core/internal/test-runner';
|
|
43
|
+
import { StepExecutionInfo } from '@midscene/core/internal/test-runner';
|
|
44
|
+
import { StepInput } from '@midscene/core/internal/test-runner';
|
|
45
|
+
import { StepMetaInput } from '@midscene/core/internal/test-runner';
|
|
46
|
+
import { StepStartHandler } from '@midscene/core/internal/test-runner';
|
|
47
|
+
import { StepTimeoutError } from '@midscene/core/internal/test-runner';
|
|
48
|
+
import { StepValue } from '@midscene/core/internal/test-runner';
|
|
49
|
+
import { WorkflowDocumentDefinition } from '@midscene/core/internal/test-runner';
|
|
50
|
+
import { WorkflowDocumentExecutionError } from '@midscene/core/internal/test-runner';
|
|
51
|
+
import { WorkflowError } from '@midscene/core/internal/test-runner';
|
|
52
|
+
import { WorkflowErrorOptions } from '@midscene/core/internal/test-runner';
|
|
53
|
+
import { WorkflowLifecycleError } from '@midscene/core/internal/test-runner';
|
|
54
|
+
import { WorkflowParseError } from '@midscene/core/internal/test-runner';
|
|
8
55
|
import { z } from 'zod/v4';
|
|
9
56
|
|
|
10
|
-
export
|
|
57
|
+
export { Awaitable }
|
|
11
58
|
|
|
12
|
-
export
|
|
59
|
+
export { buildTestRunReportDump }
|
|
13
60
|
|
|
14
|
-
export
|
|
15
|
-
name: string;
|
|
16
|
-
tags?: readonly string[];
|
|
17
|
-
steps: readonly TStep[];
|
|
18
|
-
}
|
|
61
|
+
export { CaseDefinition }
|
|
19
62
|
|
|
20
|
-
export
|
|
21
|
-
readonly caseId: string;
|
|
22
|
-
readonly runId: string;
|
|
23
|
-
readonly projectName: string;
|
|
24
|
-
readonly attemptIndex: number;
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly sourcePath: string;
|
|
27
|
-
readonly caseIndex: number;
|
|
28
|
-
}
|
|
63
|
+
export { CaseExecutionContext }
|
|
29
64
|
|
|
30
|
-
export
|
|
31
|
-
readonly result: CaseRunResult_2;
|
|
32
|
-
constructor(result: CaseRunResult_2);
|
|
33
|
-
}
|
|
65
|
+
export { CaseExecutionError }
|
|
34
66
|
|
|
35
|
-
export
|
|
36
|
-
name?: string;
|
|
37
|
-
tags?: readonly string[];
|
|
38
|
-
steps: readonly StepInput[];
|
|
39
|
-
}
|
|
67
|
+
export { CaseInput }
|
|
40
68
|
|
|
41
|
-
export
|
|
69
|
+
export { CaseNodePhase }
|
|
42
70
|
|
|
43
|
-
export declare
|
|
71
|
+
export declare type CaseRunner<TContext = undefined> = Omit<CaseRunner_2<TContext>, 'run' | 'register' | 'registry'> & {
|
|
44
72
|
readonly registry: NodeRegistry;
|
|
45
|
-
|
|
46
|
-
constructor(options?: CaseRunnerOptions<TContext>);
|
|
47
|
-
register<TInput, TData>(node: NodeDefinition<TInput, TData, TContext>): this;
|
|
73
|
+
register<TInput, TData>(node: NodeDefinition<TInput, TData, TContext>): CaseRunner<TContext>;
|
|
48
74
|
run(input: CaseInput): Promise<CaseRunResult>;
|
|
49
|
-
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export declare const CaseRunner: {
|
|
78
|
+
new <TContext = undefined>(options?: CaseRunnerOptions<TContext>): CaseRunner<TContext>;
|
|
79
|
+
};
|
|
50
80
|
|
|
51
|
-
export declare
|
|
81
|
+
export declare type CaseRunnerOptions<TContext = undefined> = Omit<Core.CaseRunnerOptions<TContext>, 'nodes'> & {
|
|
52
82
|
nodes?: readonly NodeDefinition<any, any, TContext>[];
|
|
53
|
-
|
|
54
|
-
}
|
|
83
|
+
};
|
|
55
84
|
|
|
56
|
-
export declare
|
|
57
|
-
caseId: string;
|
|
58
|
-
projectName: string;
|
|
59
|
-
name: string;
|
|
60
|
-
sourcePath: string;
|
|
61
|
-
caseIndex: number;
|
|
62
|
-
status: CaseRunStatus;
|
|
85
|
+
export declare type CaseRunOutcome = Omit<Core.CaseRunOutcome, 'onFailure' | 'run' | 'attempts'> & {
|
|
63
86
|
run?: CaseRunResult;
|
|
64
87
|
attempts?: readonly CaseRunResult[];
|
|
65
|
-
|
|
66
|
-
}
|
|
88
|
+
};
|
|
67
89
|
|
|
68
|
-
export declare
|
|
69
|
-
caseId: string;
|
|
70
|
-
runId: string;
|
|
71
|
-
projectName: string;
|
|
72
|
-
attemptIndex: number;
|
|
73
|
-
name: string;
|
|
74
|
-
sourcePath: string;
|
|
75
|
-
caseIndex: number;
|
|
76
|
-
status: 'success' | 'failed';
|
|
90
|
+
export declare type CaseRunResult = Omit<Core.CaseRunResult, 'beforeEach' | 'steps' | 'afterEach' | 'reportSources' | 'reportScopeId'> & {
|
|
77
91
|
beforeEach: StepRunResult[];
|
|
78
92
|
steps: StepRunResult[];
|
|
79
93
|
afterEach: StepRunResult[];
|
|
80
|
-
|
|
81
|
-
reportPaths?: string[];
|
|
82
|
-
startedAt: string;
|
|
83
|
-
endedAt: string;
|
|
84
|
-
durationMs: number;
|
|
85
|
-
}
|
|
94
|
+
};
|
|
86
95
|
|
|
87
|
-
export
|
|
96
|
+
export { CaseRunStatus }
|
|
88
97
|
|
|
89
|
-
export declare
|
|
90
|
-
caseId: string;
|
|
91
|
-
projectId: string;
|
|
92
|
-
sourcePath: string;
|
|
93
|
-
caseIndex: number;
|
|
98
|
+
export declare type CollectedCase = Omit<Core.CollectedCase, 'definition'> & {
|
|
94
99
|
definition: NormalizedCaseDefinition;
|
|
95
|
-
}
|
|
100
|
+
};
|
|
96
101
|
|
|
97
|
-
export declare
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
afterEach: readonly NormalizedStep[];
|
|
101
|
-
afterAll: readonly NormalizedStep[];
|
|
102
|
-
}
|
|
102
|
+
export declare type CollectedDocumentLifecycle = {
|
|
103
|
+
[K in keyof Core.CollectedDocumentLifecycle]: readonly NormalizedStep[];
|
|
104
|
+
};
|
|
103
105
|
|
|
104
|
-
export declare
|
|
105
|
-
documentId: string;
|
|
106
|
-
projectId: string;
|
|
107
|
-
sourcePath: string;
|
|
108
|
-
lifecycle: CollectedDocumentLifecycle;
|
|
106
|
+
export declare type CollectedWorkflowDocument = Omit<Core.CollectedWorkflowDocument, 'cases' | 'lifecycle'> & {
|
|
109
107
|
cases: readonly CollectedCase[];
|
|
110
|
-
|
|
108
|
+
lifecycle: CollectedDocumentLifecycle;
|
|
109
|
+
};
|
|
111
110
|
|
|
112
|
-
export
|
|
111
|
+
export { collectTestRunReportSources }
|
|
113
112
|
|
|
114
113
|
export declare function collectWorkflowDocument(source: WorkflowDocumentSource, options: CollectWorkflowDocumentOptions): CollectedWorkflowDocument;
|
|
115
114
|
|
|
@@ -121,275 +120,131 @@ export declare interface CollectWorkflowDocumentOptions {
|
|
|
121
120
|
|
|
122
121
|
export declare const createCaseId: (projectId: string, sourcePath: string, caseIndex: number) => string;
|
|
123
122
|
|
|
124
|
-
export declare
|
|
123
|
+
export declare const createCaseRunner: <TContext = undefined>(options?: CaseRunnerOptions<TContext>) => CaseRunner<TContext>;
|
|
125
124
|
|
|
126
|
-
export declare
|
|
125
|
+
export declare const createDocumentRuntime: <TContext = undefined>(document: CollectedWorkflowDocument, options: CreateDocumentRuntimeOptions<TContext>) => WorkflowDocumentRuntime<TContext>;
|
|
127
126
|
|
|
128
|
-
export declare
|
|
127
|
+
export declare type CreateDocumentRuntimeOptions<TContext = undefined> = Omit<Core.CreateDocumentRuntimeOptions<TContext>, 'documentSetup' | 'documentAttemptIndex' | 'resolveNode' | 'onStepResult' | 'onResult'> & {
|
|
129
128
|
resolveNode(name: string): NodeDefinition<any, any, TContext>;
|
|
130
|
-
project?: ResolvedExecutionProject<TContext>;
|
|
131
|
-
projectContext?: TContext;
|
|
132
|
-
signal?: AbortSignal;
|
|
133
|
-
defaultTimeoutMs?: number;
|
|
134
|
-
onStepStart?: StepStartHandler;
|
|
135
129
|
onStepResult?: StepResultHandler;
|
|
136
|
-
onResult?(result: WorkflowDocumentRunResult): Awaitable<unknown>;
|
|
137
|
-
|
|
138
|
-
}
|
|
130
|
+
onResult?(result: WorkflowDocumentRunResult): Core.Awaitable<unknown>;
|
|
131
|
+
};
|
|
139
132
|
|
|
140
|
-
export
|
|
133
|
+
export { createProjectRuntime }
|
|
141
134
|
|
|
142
135
|
export declare const createWorkflowDocumentId: (projectId: string, sourcePath: string) => string;
|
|
143
136
|
|
|
144
|
-
|
|
137
|
+
declare interface DefineNativeNode {
|
|
138
|
+
<TSchema extends NodeInputSchema, TData = unknown, TContext = unknown>(options: DefineNodeWithSchemaOptions<TSchema, TData, TContext>): NodeDefinitionWithSchema<TSchema, TData, TContext>;
|
|
139
|
+
<TInput = unknown, TData = unknown, TContext = unknown>(options: DefineNodeOptions<TInput, TData, TContext>): NodeDefinition<TInput, TData, TContext>;
|
|
140
|
+
}
|
|
145
141
|
|
|
146
|
-
export declare
|
|
142
|
+
export declare const defineNode: DefineNativeNode;
|
|
147
143
|
|
|
148
|
-
export declare
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
description?: string;
|
|
152
|
-
/** Object field populated by string shorthand. Omit or set false to disable it. */
|
|
153
|
-
stringInputKey?: string | false;
|
|
154
|
-
inputSchema?: NodeInputSchema;
|
|
155
|
-
execute(execution: NodeExecutionContext<TInput, TContext>): NodeExecutionReturn<TData>;
|
|
156
|
-
}
|
|
144
|
+
export declare type DefineNodeOptions<TInput = unknown, TData = unknown, TContext = unknown> = Omit<Core.DefineNodeOptions<TInput, TData, TContext>, 'execute'> & {
|
|
145
|
+
execute(ctx: NodeExecutionContext<TInput, TContext>): Core.NodeExecutionReturn<TData>;
|
|
146
|
+
};
|
|
157
147
|
|
|
158
|
-
export declare type DefineNodeWithSchemaOptions<TSchema extends NodeInputSchema, TData = unknown, TContext = unknown> = Omit<DefineNodeOptions<z.output<TSchema>, TData, TContext>, 'inputSchema'> & {
|
|
148
|
+
export declare type DefineNodeWithSchemaOptions<TSchema extends Core.NodeInputSchema, TData = unknown, TContext = unknown> = Omit<DefineNodeOptions<z.output<TSchema>, TData, TContext>, 'inputSchema'> & {
|
|
159
149
|
inputSchema: TSchema;
|
|
160
150
|
};
|
|
161
151
|
|
|
162
|
-
export
|
|
152
|
+
export { DocumentNodePhase }
|
|
163
153
|
|
|
164
|
-
export
|
|
165
|
-
readonly node: string;
|
|
166
|
-
constructor(node: string);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export declare type DurationInput = number;
|
|
154
|
+
export { DuplicateNodeError }
|
|
170
155
|
|
|
171
|
-
export
|
|
172
|
-
constructor(message: string, cause?: unknown);
|
|
173
|
-
}
|
|
156
|
+
export { DurationInput }
|
|
174
157
|
|
|
175
|
-
export
|
|
158
|
+
export { FatalDeviceError }
|
|
176
159
|
|
|
177
|
-
|
|
160
|
+
export { isFatalDeviceError }
|
|
178
161
|
|
|
179
|
-
declare type
|
|
180
|
-
|
|
181
|
-
|
|
162
|
+
declare type NativeNodeContext<T> = T extends unknown ? Omit<T, '$' | 'onTeardown'> & {
|
|
163
|
+
$: Readonly<NormalizedStepMeta>;
|
|
164
|
+
onTeardown(teardown: NodeScopeTeardown): void;
|
|
165
|
+
} : never;
|
|
182
166
|
|
|
183
|
-
export declare
|
|
184
|
-
readonly
|
|
185
|
-
|
|
167
|
+
export declare class NativeWorkflowFormatError extends WorkflowParseError {
|
|
168
|
+
readonly actualFormat: 'legacy' | 'legacy-batch' | 'mixed';
|
|
169
|
+
constructor(actualFormat: 'legacy' | 'legacy-batch' | 'mixed', sourcePath: string);
|
|
186
170
|
}
|
|
187
171
|
|
|
188
|
-
export
|
|
189
|
-
}
|
|
172
|
+
export { NodeCaseContext }
|
|
190
173
|
|
|
191
|
-
export declare
|
|
192
|
-
constructor(message: string, details?: unknown);
|
|
193
|
-
}
|
|
174
|
+
export declare type NodeDefinition<TInput = unknown, TData = unknown, TContext = unknown> = DefineNodeOptions<TInput, TData, TContext>;
|
|
194
175
|
|
|
195
|
-
export
|
|
176
|
+
export { NodeDefinitionError }
|
|
177
|
+
|
|
178
|
+
export declare type NodeDefinitionWithSchema<TSchema extends Core.NodeInputSchema, TData = unknown, TContext = unknown> = NodeDefinition<z.output<TSchema>, TData, TContext> & {
|
|
196
179
|
inputSchema: TSchema;
|
|
197
180
|
};
|
|
198
181
|
|
|
199
|
-
export
|
|
200
|
-
readonly documentId: string;
|
|
201
|
-
readonly documentRunId: string;
|
|
202
|
-
readonly projectId: string;
|
|
203
|
-
readonly projectName: string;
|
|
204
|
-
readonly sourcePath: string;
|
|
205
|
-
readonly phase: DocumentNodePhase;
|
|
206
|
-
readonly stepIndex: number;
|
|
207
|
-
}
|
|
182
|
+
export { NodeDocumentContext }
|
|
208
183
|
|
|
209
|
-
export declare type NodeExecutionContext<TInput = unknown, TContext = unknown> =
|
|
210
|
-
/** The node is running for one case. */
|
|
211
|
-
scope: 'case';
|
|
212
|
-
/** Identity and phase information for the case being executed. */
|
|
213
|
-
case: NodeCaseContext;
|
|
214
|
-
document?: never;
|
|
215
|
-
} | {
|
|
216
|
-
/** The node is running for the workflow document. */
|
|
217
|
-
scope: 'document';
|
|
218
|
-
/** Identity and phase information for the document being executed. */
|
|
219
|
-
document: NodeDocumentContext;
|
|
220
|
-
case?: never;
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
declare interface NodeExecutionContextBase<TInput = unknown, TContext = unknown> {
|
|
224
|
-
/** The validated node input without `$`. */
|
|
225
|
-
input: TInput;
|
|
226
|
-
/** The normalized engine metadata for this step. */
|
|
227
|
-
$: Readonly<NormalizedStepMeta>;
|
|
228
|
-
/** The timeout and cancellation signal for this step. */
|
|
229
|
-
signal: AbortSignal;
|
|
230
|
-
/** Resources shared by the current workflow document. */
|
|
231
|
-
context: TContext;
|
|
232
|
-
/** Register resource cleanup for the current case attempt or document. */
|
|
233
|
-
onTeardown(teardown: NodeScopeTeardown): void;
|
|
234
|
-
/** Attach report detail references to the current Step result. */
|
|
235
|
-
report: NodeReportCollector;
|
|
236
|
-
}
|
|
184
|
+
export declare type NodeExecutionContext<TInput = unknown, TContext = unknown> = NativeNodeContext<Core.NodeExecutionContext<TInput, TContext>>;
|
|
237
185
|
|
|
238
|
-
export
|
|
239
|
-
readonly node: string;
|
|
240
|
-
constructor(node: string, cause: unknown);
|
|
241
|
-
}
|
|
186
|
+
export { NodeExecutionError }
|
|
242
187
|
|
|
243
|
-
export
|
|
188
|
+
export { NodeExecutionPhase }
|
|
244
189
|
|
|
245
|
-
export
|
|
190
|
+
export { NodeExecutionReturn }
|
|
246
191
|
|
|
247
|
-
export
|
|
192
|
+
export { NodeInputSchema }
|
|
248
193
|
|
|
249
|
-
export
|
|
250
|
-
constructor(message: string, details?: unknown);
|
|
251
|
-
static fromZod(node: string, error: z.ZodError): NodeInputValidationError;
|
|
252
|
-
}
|
|
194
|
+
export { NodeInputValidationError }
|
|
253
195
|
|
|
254
|
-
export
|
|
255
|
-
readonly node: string;
|
|
256
|
-
constructor(node: string);
|
|
257
|
-
}
|
|
196
|
+
export { NodeNotFoundError }
|
|
258
197
|
|
|
259
|
-
export declare
|
|
260
|
-
#private;
|
|
261
|
-
constructor(nodes?: readonly NodeDefinition<any, any>[]);
|
|
262
|
-
register<TInput, TData>(node: NodeDefinition<TInput, TData>): this;
|
|
198
|
+
export declare type NodeRegistry = Omit<NodeRegistry_2, 'get' | 'require' | 'register' | 'definitions'> & {
|
|
263
199
|
get(name: string): NodeDefinition<any, any> | undefined;
|
|
264
200
|
require(name: string): NodeDefinition<any, any>;
|
|
265
|
-
|
|
266
|
-
names(): string[];
|
|
201
|
+
register<TInput, TData>(node: NodeDefinition<TInput, TData>): NodeRegistry;
|
|
267
202
|
definitions(): readonly NodeDefinition<any, any, any>[];
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/** Collects report references produced while the current Step is executing. */
|
|
271
|
-
export declare interface NodeReportCollector {
|
|
272
|
-
addTrace(trace: NodeReportTrace): void;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/** A stable reference from one test Step to report detail data. */
|
|
276
|
-
export declare interface NodeReportTrace {
|
|
277
|
-
type: 'midscene-execution';
|
|
278
|
-
executionId: string;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export declare interface NodeResult<TData = unknown> {
|
|
282
|
-
/** Human-readable summary for reports. */
|
|
283
|
-
summary?: string;
|
|
284
|
-
/** Structured data included in the step result. */
|
|
285
|
-
data?: TData;
|
|
286
|
-
}
|
|
203
|
+
};
|
|
287
204
|
|
|
288
|
-
export declare
|
|
205
|
+
export declare const NodeRegistry: {
|
|
206
|
+
new (nodes?: readonly NodeDefinition<any, any>[]): NodeRegistry;
|
|
207
|
+
};
|
|
289
208
|
|
|
290
|
-
export
|
|
291
|
-
constructor(cause: unknown, details: {
|
|
292
|
-
scope: 'case' | 'document';
|
|
293
|
-
scopeId: string;
|
|
294
|
-
node: string;
|
|
295
|
-
registrationIndex: number;
|
|
296
|
-
});
|
|
297
|
-
}
|
|
209
|
+
export { NodeReportCollector }
|
|
298
210
|
|
|
299
|
-
export
|
|
300
|
-
/** Absolute paths to Midscene reports produced by this execution scope. */
|
|
301
|
-
reportPaths?: readonly string[];
|
|
302
|
-
}
|
|
211
|
+
export { NodeReportTrace }
|
|
303
212
|
|
|
304
|
-
export
|
|
213
|
+
export { NodeResult }
|
|
305
214
|
|
|
306
|
-
export declare
|
|
307
|
-
node: string;
|
|
308
|
-
input: Record<string, unknown>;
|
|
309
|
-
meta: NormalizedStepMeta;
|
|
310
|
-
}
|
|
215
|
+
export declare type NodeScopeTeardown = () => Core.Awaitable<NodeScopeTeardownOutput>;
|
|
311
216
|
|
|
312
|
-
export
|
|
313
|
-
timeoutMs?: number;
|
|
314
|
-
continueOnError: boolean;
|
|
315
|
-
}
|
|
217
|
+
export { NodeScopeTeardownError }
|
|
316
218
|
|
|
317
|
-
|
|
219
|
+
declare type NodeScopeTeardownOutput = NodeScopeTeardownResult | void;
|
|
318
220
|
|
|
319
|
-
export declare
|
|
221
|
+
export declare type NodeScopeTeardownResult = Omit<Core.NodeScopeTeardownResult, 'reportSources'>;
|
|
320
222
|
|
|
321
|
-
export declare
|
|
223
|
+
export declare type NormalizedCaseDefinition = Core.CaseDefinition<NormalizedStep>;
|
|
322
224
|
|
|
323
|
-
export declare
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
readonly canRun: boolean;
|
|
327
|
-
start(): Promise<ProjectRuntimeResult<TProjectContext>>;
|
|
328
|
-
finish(status?: 'success' | 'failed'): Promise<ProjectRuntimeResult<TProjectContext>>;
|
|
329
|
-
abort(reason?: unknown): void;
|
|
330
|
-
}
|
|
225
|
+
export declare type NormalizedStep = Omit<Core.NormalizedStep, 'meta'> & {
|
|
226
|
+
meta: NormalizedStepMeta;
|
|
227
|
+
};
|
|
331
228
|
|
|
332
|
-
export declare
|
|
333
|
-
project: ResolvedExecutionProject<TProjectContext>;
|
|
334
|
-
setup?: ProjectSetupDefinition<TProjectContext>;
|
|
335
|
-
signal?: AbortSignal;
|
|
336
|
-
}
|
|
229
|
+
export declare type NormalizedStepMeta = Omit<Core.NormalizedStepMeta, 'captureResult' | 'resultName'>;
|
|
337
230
|
|
|
338
|
-
export
|
|
339
|
-
projectName: string;
|
|
340
|
-
status: 'success' | 'failed';
|
|
341
|
-
setupError?: WorkflowError;
|
|
342
|
-
teardownErrors?: readonly WorkflowError[];
|
|
343
|
-
startedAt: string;
|
|
344
|
-
endedAt: string;
|
|
345
|
-
durationMs: number;
|
|
346
|
-
}
|
|
231
|
+
export { normalizeNodeExecutionError }
|
|
347
232
|
|
|
348
|
-
declare
|
|
349
|
-
readonly project: ResolvedExecutionProject<TProjectContext>;
|
|
350
|
-
readonly env: Readonly<NodeJS.ProcessEnv>;
|
|
351
|
-
readonly signal: AbortSignal;
|
|
352
|
-
onTeardown(teardown: ProjectTeardown<TProjectContext>): void;
|
|
353
|
-
}
|
|
233
|
+
export declare const normalizeStep: (value: unknown, index?: number, resolveNode?: ResolveNodeForNormalization) => NormalizedStep;
|
|
354
234
|
|
|
355
|
-
declare
|
|
356
|
-
name: string;
|
|
357
|
-
setup(ctx: ProjectSetupContext<TProjectContext>): Awaitable<TProjectContext>;
|
|
358
|
-
}
|
|
235
|
+
export declare const normalizeSteps: (values: unknown, resolveNode?: ResolveNodeForNormalization) => NormalizedStep[];
|
|
359
236
|
|
|
360
|
-
export
|
|
361
|
-
constructor(cause: unknown, details: {
|
|
362
|
-
projectName: string;
|
|
363
|
-
});
|
|
364
|
-
}
|
|
237
|
+
export { ProjectRuntime }
|
|
365
238
|
|
|
366
|
-
|
|
239
|
+
export { ProjectRuntimeOptions }
|
|
367
240
|
|
|
368
|
-
|
|
369
|
-
readonly project: ResolvedExecutionProject<TProjectContext>;
|
|
370
|
-
readonly context: TProjectContext | undefined;
|
|
371
|
-
readonly status: 'success' | 'failed';
|
|
372
|
-
readonly setupError?: WorkflowError;
|
|
373
|
-
}
|
|
241
|
+
export { ProjectRuntimeResult }
|
|
374
242
|
|
|
375
|
-
export
|
|
376
|
-
constructor(cause: unknown, details: {
|
|
377
|
-
projectName: string;
|
|
378
|
-
registrationIndex: number;
|
|
379
|
-
});
|
|
380
|
-
}
|
|
243
|
+
export { ProjectSetupError }
|
|
381
244
|
|
|
382
|
-
|
|
383
|
-
readonly projectId: string;
|
|
384
|
-
readonly name: string;
|
|
385
|
-
readonly setup?: ProjectSetupDefinition<TProjectContext>;
|
|
386
|
-
readonly files?: TestFileSelection;
|
|
387
|
-
readonly tags: Readonly<Required<TestTagSelection>>;
|
|
388
|
-
readonly retry: number;
|
|
389
|
-
readonly variables: Readonly<Record<string, JsonValue>>;
|
|
390
|
-
}
|
|
245
|
+
export { ProjectTeardownError }
|
|
391
246
|
|
|
392
|
-
export
|
|
247
|
+
export { ResolveNodeForNormalization }
|
|
393
248
|
|
|
394
249
|
export declare const resolveWorkflowVariables: (value: unknown, options: ResolveWorkflowVariablesOptions) => unknown;
|
|
395
250
|
|
|
@@ -399,172 +254,51 @@ export declare interface ResolveWorkflowVariablesOptions {
|
|
|
399
254
|
location: VariableResolutionLocation;
|
|
400
255
|
}
|
|
401
256
|
|
|
402
|
-
export declare
|
|
257
|
+
export declare type RunCollectedCaseOptions<TContext = undefined> = Omit<Core.RunCollectedCaseOptions<TContext>, 'reportScopeId' | 'resolveNode' | 'beforeEach' | 'afterEach' | 'onStepResult' | 'onResult'> & {
|
|
403
258
|
resolveNode(name: string): NodeDefinition<any, any, TContext>;
|
|
404
259
|
beforeEach?: readonly NormalizedStep[];
|
|
405
260
|
afterEach?: readonly NormalizedStep[];
|
|
406
|
-
context?: TContext;
|
|
407
|
-
projectName?: string;
|
|
408
|
-
attemptIndex?: number;
|
|
409
|
-
signal?: AbortSignal;
|
|
410
|
-
defaultTimeoutMs?: number;
|
|
411
|
-
onStepStart?: StepStartHandler;
|
|
412
261
|
onStepResult?: StepResultHandler;
|
|
413
|
-
onResult?(result: CaseRunResult): Awaitable<unknown>;
|
|
414
|
-
|
|
415
|
-
}
|
|
262
|
+
onResult?(result: CaseRunResult): Core.Awaitable<unknown>;
|
|
263
|
+
};
|
|
416
264
|
|
|
417
|
-
export declare
|
|
265
|
+
export declare const runWorkflowDocument: <TContext = undefined>(document: CollectedWorkflowDocument, options: RunWorkflowDocumentOptions<TContext>) => Promise<WorkflowDocumentExecutionResult>;
|
|
418
266
|
|
|
419
|
-
export declare
|
|
267
|
+
export declare type RunWorkflowDocumentOptions<TContext = undefined> = Omit<Core.RunWorkflowDocumentOptions<TContext>, 'documentSetup' | 'documentAttemptIndex' | 'resolveCaseReportScopeId' | 'resolveNode' | 'onStepResult' | 'onCaseStart' | 'isFatalError' | 'onCaseResult' | 'onCaseOutcome' | 'onDocumentResult' | 'createCaseRunId' | 'createDocumentRunId'> & {
|
|
420
268
|
resolveNode(name: string): NodeDefinition<any, any, TContext>;
|
|
421
|
-
project?: ResolvedExecutionProject<TContext>;
|
|
422
|
-
projectContext?: TContext;
|
|
423
|
-
retry?: number;
|
|
424
|
-
signal?: AbortSignal;
|
|
425
|
-
defaultTimeoutMs?: number;
|
|
426
|
-
shouldStop?(): boolean;
|
|
427
|
-
stopReason?(): NonNullable<CaseRunOutcome['notRunReason']>;
|
|
428
|
-
isFatalError?(result: CaseRunResult): boolean;
|
|
429
|
-
onCaseStart?(collectedCase: CollectedCase): Awaitable<void>;
|
|
430
|
-
onStepStart?: StepStartHandler;
|
|
431
269
|
onStepResult?: StepResultHandler;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
270
|
+
onCaseStart?(collectedCase: CollectedCase): Core.Awaitable<void>;
|
|
271
|
+
isFatalError?(result: CaseRunResult): boolean;
|
|
272
|
+
onCaseResult?(result: CaseRunResult): Core.Awaitable<unknown>;
|
|
273
|
+
onCaseOutcome?(result: CaseRunOutcome): Core.Awaitable<unknown>;
|
|
274
|
+
onDocumentResult?(result: WorkflowDocumentRunResult): Core.Awaitable<unknown>;
|
|
435
275
|
createCaseRunId?(collectedCase: CollectedCase, attemptIndex: number): string;
|
|
436
276
|
createDocumentRunId?(document: CollectedWorkflowDocument): string;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
export declare function sanitizeReportError(error: unknown): TestRunReportError;
|
|
440
|
-
|
|
441
|
-
export declare function sanitizeReportText(value: string, maximumLength?: number): string;
|
|
442
|
-
|
|
443
|
-
/** Convert arbitrary Node input/output to a bounded, JSON-safe display value. */
|
|
444
|
-
export declare function sanitizeReportValue(value: unknown): TestRunReportValue;
|
|
445
|
-
|
|
446
|
-
export declare type StepExecutionInfo = {
|
|
447
|
-
scope: 'case';
|
|
448
|
-
node: string;
|
|
449
|
-
stepCount: number;
|
|
450
|
-
case: NodeCaseContext;
|
|
451
|
-
document?: never;
|
|
452
|
-
} | {
|
|
453
|
-
scope: 'document';
|
|
454
|
-
node: string;
|
|
455
|
-
stepCount: number;
|
|
456
|
-
document: NodeDocumentContext;
|
|
457
|
-
case?: never;
|
|
458
277
|
};
|
|
459
278
|
|
|
460
|
-
export
|
|
461
|
-
|
|
462
|
-
export declare interface StepMetaInput {
|
|
463
|
-
timeout?: DurationInput;
|
|
464
|
-
'continue-on-error'?: boolean;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
export declare type StepResultHandler = (info: StepExecutionInfo, result: StepRunResult) => Awaitable<unknown>;
|
|
468
|
-
|
|
469
|
-
export declare interface StepRunResult<TOutputData = unknown> {
|
|
470
|
-
phase: NodeExecutionPhase;
|
|
471
|
-
stepIndex: number;
|
|
472
|
-
node: string;
|
|
473
|
-
input: unknown;
|
|
474
|
-
meta: NormalizedStepMeta;
|
|
475
|
-
status: 'success' | 'failed';
|
|
476
|
-
continuedAfterError: boolean;
|
|
477
|
-
startedAt: string;
|
|
478
|
-
endedAt: string;
|
|
479
|
-
durationMs: number;
|
|
480
|
-
output?: NodeResult<TOutputData>;
|
|
481
|
-
error?: WorkflowError;
|
|
482
|
-
report?: {
|
|
483
|
-
traces: readonly NodeReportTrace[];
|
|
484
|
-
};
|
|
485
|
-
}
|
|
279
|
+
export { sanitizeReportError }
|
|
486
280
|
|
|
487
|
-
export
|
|
281
|
+
export { sanitizeReportText }
|
|
488
282
|
|
|
489
|
-
export
|
|
490
|
-
readonly timeoutMs: number;
|
|
491
|
-
readonly node?: string;
|
|
492
|
-
constructor(timeoutMs: number, node?: string);
|
|
493
|
-
}
|
|
283
|
+
export { sanitizeReportValue }
|
|
494
284
|
|
|
495
|
-
export
|
|
285
|
+
export { StepExecutionInfo }
|
|
496
286
|
|
|
497
|
-
|
|
498
|
-
stringInputKey?: string | false;
|
|
499
|
-
}
|
|
287
|
+
export { StepInput }
|
|
500
288
|
|
|
501
|
-
|
|
502
|
-
projectId: string;
|
|
503
|
-
name: string;
|
|
504
|
-
status: 'success' | 'failed';
|
|
505
|
-
retry: number;
|
|
506
|
-
fileSelection: TestFileSelection;
|
|
507
|
-
tagSelection: Readonly<Required<TestTagSelection>>;
|
|
508
|
-
sourceCount: number;
|
|
509
|
-
selectedCaseCount: number;
|
|
510
|
-
filteredCaseCount: number;
|
|
511
|
-
lifecycle?: ProjectRuntimeResult;
|
|
512
|
-
cases: readonly TestProjectCaseRunResult[];
|
|
513
|
-
documents: readonly WorkflowDocumentRunResult[];
|
|
514
|
-
collectionErrors: readonly TestProjectCollectionError[];
|
|
515
|
-
}
|
|
289
|
+
export { StepMetaInput }
|
|
516
290
|
|
|
517
|
-
declare
|
|
518
|
-
include: readonly string[];
|
|
519
|
-
exclude?: readonly string[];
|
|
520
|
-
}
|
|
291
|
+
export declare type StepResultHandler = (info: Core.StepExecutionInfo, result: StepRunResult) => Core.Awaitable<unknown>;
|
|
521
292
|
|
|
522
|
-
declare type
|
|
523
|
-
|
|
293
|
+
export declare type StepRunResult<TData = unknown> = Omit<Core.StepRunResult<TData>, 'meta'> & {
|
|
294
|
+
meta: NormalizedStepMeta;
|
|
524
295
|
};
|
|
525
296
|
|
|
526
|
-
|
|
527
|
-
projectId: string;
|
|
528
|
-
projectName: string;
|
|
529
|
-
sourcePath: string;
|
|
530
|
-
error: WorkflowError;
|
|
531
|
-
}
|
|
297
|
+
export { StepStartHandler }
|
|
532
298
|
|
|
533
|
-
|
|
534
|
-
schemaVersion: 3;
|
|
535
|
-
runId: string;
|
|
536
|
-
startedAt: string;
|
|
537
|
-
endedAt: string;
|
|
538
|
-
durationMs: number;
|
|
539
|
-
status: 'success' | 'failed';
|
|
540
|
-
exitCode: 0 | 1;
|
|
541
|
-
resultDir: string;
|
|
542
|
-
summaryPath: string;
|
|
543
|
-
reportDir: string;
|
|
544
|
-
/** Absolute path to the unified Midscene Test HTML report. */
|
|
545
|
-
reportPath?: string;
|
|
546
|
-
summary: TestProjectRunSummary;
|
|
547
|
-
projects: readonly TestExecutionProjectRunResult[];
|
|
548
|
-
cases: readonly TestProjectCaseRunResult[];
|
|
549
|
-
documents: readonly WorkflowDocumentRunResult[];
|
|
550
|
-
collectionErrors: readonly TestProjectCollectionError[];
|
|
551
|
-
}
|
|
299
|
+
export { StepTimeoutError }
|
|
552
300
|
|
|
553
|
-
|
|
554
|
-
total: number;
|
|
555
|
-
passed: number;
|
|
556
|
-
failed: number;
|
|
557
|
-
notRun: number;
|
|
558
|
-
filtered: number;
|
|
559
|
-
collectionErrors: number;
|
|
560
|
-
documentFailures: number;
|
|
561
|
-
projectFailures: number;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
declare interface TestTagSelection {
|
|
565
|
-
include?: readonly string[];
|
|
566
|
-
exclude?: readonly string[];
|
|
567
|
-
}
|
|
301
|
+
export { StepValue }
|
|
568
302
|
|
|
569
303
|
export declare interface VariableResolutionLocation {
|
|
570
304
|
projectName: string;
|
|
@@ -574,74 +308,34 @@ export declare interface VariableResolutionLocation {
|
|
|
574
308
|
caseIndex?: number;
|
|
575
309
|
}
|
|
576
310
|
|
|
577
|
-
export
|
|
578
|
-
beforeAll?: readonly StepInput[];
|
|
579
|
-
beforeEach?: readonly StepInput[];
|
|
580
|
-
cases: readonly CaseDefinition[];
|
|
581
|
-
afterEach?: readonly StepInput[];
|
|
582
|
-
afterAll?: readonly StepInput[];
|
|
583
|
-
}
|
|
311
|
+
export { WorkflowDocumentDefinition }
|
|
584
312
|
|
|
585
|
-
export
|
|
586
|
-
readonly result: WorkflowDocumentRunResult_2;
|
|
587
|
-
constructor(result: WorkflowDocumentRunResult_2);
|
|
588
|
-
}
|
|
313
|
+
export { WorkflowDocumentExecutionError }
|
|
589
314
|
|
|
590
|
-
export declare
|
|
315
|
+
export declare type WorkflowDocumentExecutionResult = {
|
|
591
316
|
document: WorkflowDocumentRunResult;
|
|
592
317
|
cases: readonly CaseRunOutcome[];
|
|
593
|
-
}
|
|
318
|
+
};
|
|
594
319
|
|
|
595
|
-
export declare
|
|
596
|
-
documentId: string;
|
|
597
|
-
documentRunId: string;
|
|
598
|
-
projectId: string;
|
|
599
|
-
projectName: string;
|
|
600
|
-
sourcePath: string;
|
|
601
|
-
status: 'success' | 'failed';
|
|
602
|
-
startedAt: string;
|
|
603
|
-
endedAt: string;
|
|
604
|
-
durationMs: number;
|
|
320
|
+
export declare type WorkflowDocumentRunResult = Omit<Core.WorkflowDocumentRunResult, 'beforeAll' | 'afterAll' | 'reportSources' | 'reportScopeId'> & {
|
|
605
321
|
beforeAll: StepRunResult[];
|
|
606
322
|
afterAll: StepRunResult[];
|
|
607
|
-
|
|
608
|
-
reportPaths?: string[];
|
|
609
|
-
}
|
|
323
|
+
};
|
|
610
324
|
|
|
611
|
-
export declare
|
|
612
|
-
readonly context: TContext;
|
|
613
|
-
readonly canRunCases: boolean;
|
|
325
|
+
export declare type WorkflowDocumentRuntime<TContext = undefined> = Omit<Core.WorkflowDocumentRuntime<TContext>, 'signal' | 'start' | 'finish'> & {
|
|
614
326
|
start(): Promise<WorkflowDocumentRunResult>;
|
|
615
327
|
finish(): Promise<WorkflowDocumentRunResult>;
|
|
616
|
-
}
|
|
328
|
+
};
|
|
617
329
|
|
|
618
|
-
export declare
|
|
619
|
-
projectId: string;
|
|
620
|
-
projectName?: string;
|
|
621
|
-
sourcePath: string;
|
|
622
|
-
absolutePath: string;
|
|
623
|
-
}
|
|
330
|
+
export declare type WorkflowDocumentSource = Omit<Core.WorkflowDocumentSource, 'invocationIndex'>;
|
|
624
331
|
|
|
625
|
-
export
|
|
626
|
-
readonly code: string;
|
|
627
|
-
readonly details?: unknown;
|
|
628
|
-
constructor(message: string, options?: WorkflowErrorOptions);
|
|
629
|
-
toJSON(): Record<string, unknown>;
|
|
630
|
-
}
|
|
332
|
+
export { WorkflowError }
|
|
631
333
|
|
|
632
|
-
export
|
|
633
|
-
code?: string;
|
|
634
|
-
details?: unknown;
|
|
635
|
-
cause?: unknown;
|
|
636
|
-
}
|
|
334
|
+
export { WorkflowErrorOptions }
|
|
637
335
|
|
|
638
|
-
export
|
|
639
|
-
constructor(message: string, details?: unknown);
|
|
640
|
-
}
|
|
336
|
+
export { WorkflowLifecycleError }
|
|
641
337
|
|
|
642
|
-
export
|
|
643
|
-
constructor(message: string, details?: unknown, cause?: unknown);
|
|
644
|
-
}
|
|
338
|
+
export { WorkflowParseError }
|
|
645
339
|
|
|
646
340
|
export { z }
|
|
647
341
|
|