playwright-logbook 0.2.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/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/artifacts.d.ts +7 -0
- package/dist/artifacts.js +35 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/caseids.d.ts +12 -0
- package/dist/caseids.js +24 -0
- package/dist/caseids.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.js +6 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/debug.d.ts +7 -0
- package/dist/cli/commands/debug.js +14 -0
- package/dist/cli/commands/debug.js.map +1 -0
- package/dist/cli/commands/flaky.d.ts +8 -0
- package/dist/cli/commands/flaky.js +27 -0
- package/dist/cli/commands/flaky.js.map +1 -0
- package/dist/cli/commands/history.d.ts +8 -0
- package/dist/cli/commands/history.js +24 -0
- package/dist/cli/commands/history.js.map +1 -0
- package/dist/cli/commands/merge.d.ts +12 -0
- package/dist/cli/commands/merge.js +102 -0
- package/dist/cli/commands/merge.js.map +1 -0
- package/dist/cli/commands/report.d.ts +9 -0
- package/dist/cli/commands/report.js +13 -0
- package/dist/cli/commands/report.js.map +1 -0
- package/dist/cli/commands/summary.d.ts +7 -0
- package/dist/cli/commands/summary.js +14 -0
- package/dist/cli/commands/summary.js.map +1 -0
- package/dist/cli/format.d.ts +18 -0
- package/dist/cli/format.js +41 -0
- package/dist/cli/format.js.map +1 -0
- package/dist/cli/program.d.ts +12 -0
- package/dist/cli/program.js +74 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/clientlib.d.ts +48 -0
- package/dist/clientlib.js +136 -0
- package/dist/clientlib.js.map +1 -0
- package/dist/collect.d.ts +101 -0
- package/dist/collect.js +50 -0
- package/dist/collect.js.map +1 -0
- package/dist/debugpacket.d.ts +31 -0
- package/dist/debugpacket.js +105 -0
- package/dist/debugpacket.js.map +1 -0
- package/dist/env.d.ts +41 -0
- package/dist/env.js +49 -0
- package/dist/env.js.map +1 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +10 -0
- package/dist/errors.js.map +1 -0
- package/dist/history.d.ts +32 -0
- package/dist/history.js +72 -0
- package/dist/history.js.map +1 -0
- package/dist/index.cjs +1562 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/merge.d.ts +9 -0
- package/dist/merge.js +64 -0
- package/dist/merge.js.map +1 -0
- package/dist/model.d.ts +98 -0
- package/dist/model.js +129 -0
- package/dist/model.js.map +1 -0
- package/dist/options.d.ts +23 -0
- package/dist/options.js +5 -0
- package/dist/options.js.map +1 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.js +17 -0
- package/dist/paths.js.map +1 -0
- package/dist/publish.d.ts +14 -0
- package/dist/publish.js +2 -0
- package/dist/publish.js.map +1 -0
- package/dist/render.d.ts +6 -0
- package/dist/render.js +50 -0
- package/dist/render.js.map +1 -0
- package/dist/reporter.d.ts +53 -0
- package/dist/reporter.js +161 -0
- package/dist/reporter.js.map +1 -0
- package/dist/sanitize.d.ts +11 -0
- package/dist/sanitize.js +33 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/schema.d.ts +581 -0
- package/dist/schema.js +31 -0
- package/dist/schema.js.map +1 -0
- package/dist/signals.d.ts +9 -0
- package/dist/signals.js +37 -0
- package/dist/signals.js.map +1 -0
- package/dist/store.d.ts +41 -0
- package/dist/store.js +142 -0
- package/dist/store.js.map +1 -0
- package/dist/template/css.d.ts +1 -0
- package/dist/template/css.js +17 -0
- package/dist/template/css.js.map +1 -0
- package/dist/template/icons.d.ts +1 -0
- package/dist/template/icons.js +9 -0
- package/dist/template/icons.js.map +1 -0
- package/dist/template/js/core.d.ts +1 -0
- package/dist/template/js/core.js +90 -0
- package/dist/template/js/core.js.map +1 -0
- package/dist/template/js/failures.d.ts +1 -0
- package/dist/template/js/failures.js +33 -0
- package/dist/template/js/failures.js.map +1 -0
- package/dist/template/js/help.d.ts +1 -0
- package/dist/template/js/help.js +4 -0
- package/dist/template/js/help.js.map +1 -0
- package/dist/template/js/panel.d.ts +1 -0
- package/dist/template/js/panel.js +84 -0
- package/dist/template/js/panel.js.map +1 -0
- package/dist/template/js/project.d.ts +1 -0
- package/dist/template/js/project.js +40 -0
- package/dist/template/js/project.js.map +1 -0
- package/dist/template/js/run.d.ts +1 -0
- package/dist/template/js/run.js +38 -0
- package/dist/template/js/run.js.map +1 -0
- package/dist/template/js/tests.d.ts +1 -0
- package/dist/template/js/tests.js +23 -0
- package/dist/template/js/tests.js.map +1 -0
- package/dist/template/js/trends.d.ts +1 -0
- package/dist/template/js/trends.js +57 -0
- package/dist/template/js/trends.js.map +1 -0
- package/dist/template/tokens.d.ts +45 -0
- package/dist/template/tokens.js +12 -0
- package/dist/template/tokens.js.map +1 -0
- package/dist/template.d.ts +2 -0
- package/dist/template.js +19 -0
- package/dist/template.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +63 -0
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SCHEMA_VERSION: 1;
|
|
3
|
+
export declare const statusSchema: z.ZodEnum<{
|
|
4
|
+
passed: "passed";
|
|
5
|
+
failed: "failed";
|
|
6
|
+
timedOut: "timedOut";
|
|
7
|
+
skipped: "skipped";
|
|
8
|
+
interrupted: "interrupted";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const outcomeSchema: z.ZodEnum<{
|
|
11
|
+
skipped: "skipped";
|
|
12
|
+
expected: "expected";
|
|
13
|
+
unexpected: "unexpected";
|
|
14
|
+
flaky: "flaky";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const runStatusSchema: z.ZodEnum<{
|
|
17
|
+
passed: "passed";
|
|
18
|
+
failed: "failed";
|
|
19
|
+
interrupted: "interrupted";
|
|
20
|
+
timedout: "timedout";
|
|
21
|
+
}>;
|
|
22
|
+
export declare const errorRecordSchema: z.ZodObject<{
|
|
23
|
+
message: z.ZodString;
|
|
24
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
25
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
26
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
27
|
+
file: z.ZodString;
|
|
28
|
+
line: z.ZodNumber;
|
|
29
|
+
column: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const stepRecordSchema: z.ZodObject<{
|
|
33
|
+
title: z.ZodString;
|
|
34
|
+
category: z.ZodString;
|
|
35
|
+
durationMs: z.ZodNumber;
|
|
36
|
+
depth: z.ZodNumber;
|
|
37
|
+
failed: z.ZodBoolean;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const attachmentRecordSchema: z.ZodObject<{
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
contentType: z.ZodString;
|
|
42
|
+
path: z.ZodNullable<z.ZodString>;
|
|
43
|
+
inline: z.ZodBoolean;
|
|
44
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
45
|
+
dataUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const attemptRecordSchema: z.ZodObject<{
|
|
48
|
+
retry: z.ZodNumber;
|
|
49
|
+
status: z.ZodEnum<{
|
|
50
|
+
passed: "passed";
|
|
51
|
+
failed: "failed";
|
|
52
|
+
timedOut: "timedOut";
|
|
53
|
+
skipped: "skipped";
|
|
54
|
+
interrupted: "interrupted";
|
|
55
|
+
}>;
|
|
56
|
+
durationMs: z.ZodNumber;
|
|
57
|
+
startedAt: z.ZodString;
|
|
58
|
+
workerIndex: z.ZodNumber;
|
|
59
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
60
|
+
message: z.ZodString;
|
|
61
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
62
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
63
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
64
|
+
file: z.ZodString;
|
|
65
|
+
line: z.ZodNumber;
|
|
66
|
+
column: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
contentType: z.ZodString;
|
|
72
|
+
path: z.ZodNullable<z.ZodString>;
|
|
73
|
+
inline: z.ZodBoolean;
|
|
74
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
75
|
+
dataUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
title: z.ZodString;
|
|
79
|
+
category: z.ZodString;
|
|
80
|
+
durationMs: z.ZodNumber;
|
|
81
|
+
depth: z.ZodNumber;
|
|
82
|
+
failed: z.ZodBoolean;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
stdout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
stderr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare const annotationSchema: z.ZodObject<{
|
|
88
|
+
type: z.ZodString;
|
|
89
|
+
description: z.ZodNullable<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export declare const testRecordSchema: z.ZodObject<{
|
|
92
|
+
testId: z.ZodString;
|
|
93
|
+
title: z.ZodString;
|
|
94
|
+
titlePath: z.ZodArray<z.ZodString>;
|
|
95
|
+
file: z.ZodString;
|
|
96
|
+
line: z.ZodNumber;
|
|
97
|
+
column: z.ZodNumber;
|
|
98
|
+
project: z.ZodString;
|
|
99
|
+
tags: z.ZodArray<z.ZodString>;
|
|
100
|
+
annotations: z.ZodArray<z.ZodObject<{
|
|
101
|
+
type: z.ZodString;
|
|
102
|
+
description: z.ZodNullable<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
caseIds: z.ZodArray<z.ZodString>;
|
|
105
|
+
expectedStatus: z.ZodEnum<{
|
|
106
|
+
passed: "passed";
|
|
107
|
+
failed: "failed";
|
|
108
|
+
timedOut: "timedOut";
|
|
109
|
+
skipped: "skipped";
|
|
110
|
+
interrupted: "interrupted";
|
|
111
|
+
}>;
|
|
112
|
+
outcome: z.ZodEnum<{
|
|
113
|
+
skipped: "skipped";
|
|
114
|
+
expected: "expected";
|
|
115
|
+
unexpected: "unexpected";
|
|
116
|
+
flaky: "flaky";
|
|
117
|
+
}>;
|
|
118
|
+
status: z.ZodEnum<{
|
|
119
|
+
passed: "passed";
|
|
120
|
+
failed: "failed";
|
|
121
|
+
timedOut: "timedOut";
|
|
122
|
+
skipped: "skipped";
|
|
123
|
+
interrupted: "interrupted";
|
|
124
|
+
}>;
|
|
125
|
+
durationMs: z.ZodNumber;
|
|
126
|
+
finalDurationMs: z.ZodNumber;
|
|
127
|
+
attemptCount: z.ZodNumber;
|
|
128
|
+
repeatEachIndex: z.ZodNumber;
|
|
129
|
+
firstError: z.ZodNullable<z.ZodObject<{
|
|
130
|
+
message: z.ZodString;
|
|
131
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
132
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
133
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
134
|
+
file: z.ZodString;
|
|
135
|
+
line: z.ZodNumber;
|
|
136
|
+
column: z.ZodNumber;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
attempts: z.ZodArray<z.ZodObject<{
|
|
140
|
+
retry: z.ZodNumber;
|
|
141
|
+
status: z.ZodEnum<{
|
|
142
|
+
passed: "passed";
|
|
143
|
+
failed: "failed";
|
|
144
|
+
timedOut: "timedOut";
|
|
145
|
+
skipped: "skipped";
|
|
146
|
+
interrupted: "interrupted";
|
|
147
|
+
}>;
|
|
148
|
+
durationMs: z.ZodNumber;
|
|
149
|
+
startedAt: z.ZodString;
|
|
150
|
+
workerIndex: z.ZodNumber;
|
|
151
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
152
|
+
message: z.ZodString;
|
|
153
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
154
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
155
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
156
|
+
file: z.ZodString;
|
|
157
|
+
line: z.ZodNumber;
|
|
158
|
+
column: z.ZodNumber;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
162
|
+
name: z.ZodString;
|
|
163
|
+
contentType: z.ZodString;
|
|
164
|
+
path: z.ZodNullable<z.ZodString>;
|
|
165
|
+
inline: z.ZodBoolean;
|
|
166
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
167
|
+
dataUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
170
|
+
title: z.ZodString;
|
|
171
|
+
category: z.ZodString;
|
|
172
|
+
durationMs: z.ZodNumber;
|
|
173
|
+
depth: z.ZodNumber;
|
|
174
|
+
failed: z.ZodBoolean;
|
|
175
|
+
}, z.core.$strip>>>;
|
|
176
|
+
stdout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
stderr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export declare const envInfoSchema: z.ZodObject<{
|
|
181
|
+
ci: z.ZodNullable<z.ZodObject<{
|
|
182
|
+
provider: z.ZodEnum<{
|
|
183
|
+
github: "github";
|
|
184
|
+
gitlab: "gitlab";
|
|
185
|
+
azure: "azure";
|
|
186
|
+
jenkins: "jenkins";
|
|
187
|
+
circleci: "circleci";
|
|
188
|
+
bitbucket: "bitbucket";
|
|
189
|
+
other: "other";
|
|
190
|
+
}>;
|
|
191
|
+
buildId: z.ZodNullable<z.ZodString>;
|
|
192
|
+
buildUrl: z.ZodNullable<z.ZodString>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
git: z.ZodObject<{
|
|
195
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
196
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
197
|
+
prNumber: z.ZodNullable<z.ZodNumber>;
|
|
198
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
machine: z.ZodObject<{
|
|
201
|
+
os: z.ZodString;
|
|
202
|
+
arch: z.ZodString;
|
|
203
|
+
node: z.ZodString;
|
|
204
|
+
cpus: z.ZodNumber;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
playwrightVersion: z.ZodString;
|
|
207
|
+
workers: z.ZodNumber;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
export declare const projectInfoSchema: z.ZodObject<{
|
|
210
|
+
name: z.ZodNullable<z.ZodString>;
|
|
211
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
212
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
213
|
+
name: z.ZodString;
|
|
214
|
+
testDir: z.ZodString;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
workers: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
export declare const summarySchema: z.ZodObject<{
|
|
219
|
+
total: z.ZodNumber;
|
|
220
|
+
passed: z.ZodNumber;
|
|
221
|
+
failed: z.ZodNumber;
|
|
222
|
+
flaky: z.ZodNumber;
|
|
223
|
+
skipped: z.ZodNumber;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
export declare const shardFileSchema: z.ZodObject<{
|
|
226
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
227
|
+
kind: z.ZodLiteral<"shard">;
|
|
228
|
+
runId: z.ZodString;
|
|
229
|
+
title: z.ZodNullable<z.ZodString>;
|
|
230
|
+
shard: z.ZodNullable<z.ZodObject<{
|
|
231
|
+
current: z.ZodNumber;
|
|
232
|
+
total: z.ZodNumber;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
startedAt: z.ZodString;
|
|
235
|
+
endedAt: z.ZodString;
|
|
236
|
+
status: z.ZodEnum<{
|
|
237
|
+
passed: "passed";
|
|
238
|
+
failed: "failed";
|
|
239
|
+
interrupted: "interrupted";
|
|
240
|
+
timedout: "timedout";
|
|
241
|
+
}>;
|
|
242
|
+
env: z.ZodObject<{
|
|
243
|
+
ci: z.ZodNullable<z.ZodObject<{
|
|
244
|
+
provider: z.ZodEnum<{
|
|
245
|
+
github: "github";
|
|
246
|
+
gitlab: "gitlab";
|
|
247
|
+
azure: "azure";
|
|
248
|
+
jenkins: "jenkins";
|
|
249
|
+
circleci: "circleci";
|
|
250
|
+
bitbucket: "bitbucket";
|
|
251
|
+
other: "other";
|
|
252
|
+
}>;
|
|
253
|
+
buildId: z.ZodNullable<z.ZodString>;
|
|
254
|
+
buildUrl: z.ZodNullable<z.ZodString>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
git: z.ZodObject<{
|
|
257
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
258
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
259
|
+
prNumber: z.ZodNullable<z.ZodNumber>;
|
|
260
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
machine: z.ZodObject<{
|
|
263
|
+
os: z.ZodString;
|
|
264
|
+
arch: z.ZodString;
|
|
265
|
+
node: z.ZodString;
|
|
266
|
+
cpus: z.ZodNumber;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
playwrightVersion: z.ZodString;
|
|
269
|
+
workers: z.ZodNumber;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
project: z.ZodObject<{
|
|
272
|
+
name: z.ZodNullable<z.ZodString>;
|
|
273
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
274
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
275
|
+
name: z.ZodString;
|
|
276
|
+
testDir: z.ZodString;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
workers: z.ZodNumber;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
tests: z.ZodArray<z.ZodObject<{
|
|
281
|
+
testId: z.ZodString;
|
|
282
|
+
title: z.ZodString;
|
|
283
|
+
titlePath: z.ZodArray<z.ZodString>;
|
|
284
|
+
file: z.ZodString;
|
|
285
|
+
line: z.ZodNumber;
|
|
286
|
+
column: z.ZodNumber;
|
|
287
|
+
project: z.ZodString;
|
|
288
|
+
tags: z.ZodArray<z.ZodString>;
|
|
289
|
+
annotations: z.ZodArray<z.ZodObject<{
|
|
290
|
+
type: z.ZodString;
|
|
291
|
+
description: z.ZodNullable<z.ZodString>;
|
|
292
|
+
}, z.core.$strip>>;
|
|
293
|
+
caseIds: z.ZodArray<z.ZodString>;
|
|
294
|
+
expectedStatus: z.ZodEnum<{
|
|
295
|
+
passed: "passed";
|
|
296
|
+
failed: "failed";
|
|
297
|
+
timedOut: "timedOut";
|
|
298
|
+
skipped: "skipped";
|
|
299
|
+
interrupted: "interrupted";
|
|
300
|
+
}>;
|
|
301
|
+
outcome: z.ZodEnum<{
|
|
302
|
+
skipped: "skipped";
|
|
303
|
+
expected: "expected";
|
|
304
|
+
unexpected: "unexpected";
|
|
305
|
+
flaky: "flaky";
|
|
306
|
+
}>;
|
|
307
|
+
status: z.ZodEnum<{
|
|
308
|
+
passed: "passed";
|
|
309
|
+
failed: "failed";
|
|
310
|
+
timedOut: "timedOut";
|
|
311
|
+
skipped: "skipped";
|
|
312
|
+
interrupted: "interrupted";
|
|
313
|
+
}>;
|
|
314
|
+
durationMs: z.ZodNumber;
|
|
315
|
+
finalDurationMs: z.ZodNumber;
|
|
316
|
+
attemptCount: z.ZodNumber;
|
|
317
|
+
repeatEachIndex: z.ZodNumber;
|
|
318
|
+
firstError: z.ZodNullable<z.ZodObject<{
|
|
319
|
+
message: z.ZodString;
|
|
320
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
321
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
322
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
323
|
+
file: z.ZodString;
|
|
324
|
+
line: z.ZodNumber;
|
|
325
|
+
column: z.ZodNumber;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
attempts: z.ZodArray<z.ZodObject<{
|
|
329
|
+
retry: z.ZodNumber;
|
|
330
|
+
status: z.ZodEnum<{
|
|
331
|
+
passed: "passed";
|
|
332
|
+
failed: "failed";
|
|
333
|
+
timedOut: "timedOut";
|
|
334
|
+
skipped: "skipped";
|
|
335
|
+
interrupted: "interrupted";
|
|
336
|
+
}>;
|
|
337
|
+
durationMs: z.ZodNumber;
|
|
338
|
+
startedAt: z.ZodString;
|
|
339
|
+
workerIndex: z.ZodNumber;
|
|
340
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
341
|
+
message: z.ZodString;
|
|
342
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
343
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
344
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
345
|
+
file: z.ZodString;
|
|
346
|
+
line: z.ZodNumber;
|
|
347
|
+
column: z.ZodNumber;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
351
|
+
name: z.ZodString;
|
|
352
|
+
contentType: z.ZodString;
|
|
353
|
+
path: z.ZodNullable<z.ZodString>;
|
|
354
|
+
inline: z.ZodBoolean;
|
|
355
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
356
|
+
dataUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
357
|
+
}, z.core.$strip>>;
|
|
358
|
+
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
359
|
+
title: z.ZodString;
|
|
360
|
+
category: z.ZodString;
|
|
361
|
+
durationMs: z.ZodNumber;
|
|
362
|
+
depth: z.ZodNumber;
|
|
363
|
+
failed: z.ZodBoolean;
|
|
364
|
+
}, z.core.$strip>>>;
|
|
365
|
+
stdout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
366
|
+
stderr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
+
}, z.core.$strip>>;
|
|
368
|
+
}, z.core.$strip>>;
|
|
369
|
+
globalErrors: z.ZodArray<z.ZodObject<{
|
|
370
|
+
message: z.ZodString;
|
|
371
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
372
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
373
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
374
|
+
file: z.ZodString;
|
|
375
|
+
line: z.ZodNumber;
|
|
376
|
+
column: z.ZodNumber;
|
|
377
|
+
}, z.core.$strip>>;
|
|
378
|
+
}, z.core.$strip>>;
|
|
379
|
+
}, z.core.$strip>;
|
|
380
|
+
export declare const runRecordSchema: z.ZodObject<{
|
|
381
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
382
|
+
kind: z.ZodLiteral<"run">;
|
|
383
|
+
runId: z.ZodString;
|
|
384
|
+
title: z.ZodNullable<z.ZodString>;
|
|
385
|
+
startedAt: z.ZodString;
|
|
386
|
+
endedAt: z.ZodString;
|
|
387
|
+
durationMs: z.ZodNumber;
|
|
388
|
+
status: z.ZodEnum<{
|
|
389
|
+
passed: "passed";
|
|
390
|
+
failed: "failed";
|
|
391
|
+
interrupted: "interrupted";
|
|
392
|
+
timedout: "timedout";
|
|
393
|
+
}>;
|
|
394
|
+
complete: z.ZodBoolean;
|
|
395
|
+
expectedShards: z.ZodNullable<z.ZodNumber>;
|
|
396
|
+
receivedShards: z.ZodArray<z.ZodNumber>;
|
|
397
|
+
env: z.ZodObject<{
|
|
398
|
+
ci: z.ZodNullable<z.ZodObject<{
|
|
399
|
+
provider: z.ZodEnum<{
|
|
400
|
+
github: "github";
|
|
401
|
+
gitlab: "gitlab";
|
|
402
|
+
azure: "azure";
|
|
403
|
+
jenkins: "jenkins";
|
|
404
|
+
circleci: "circleci";
|
|
405
|
+
bitbucket: "bitbucket";
|
|
406
|
+
other: "other";
|
|
407
|
+
}>;
|
|
408
|
+
buildId: z.ZodNullable<z.ZodString>;
|
|
409
|
+
buildUrl: z.ZodNullable<z.ZodString>;
|
|
410
|
+
}, z.core.$strip>>;
|
|
411
|
+
git: z.ZodObject<{
|
|
412
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
413
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
414
|
+
prNumber: z.ZodNullable<z.ZodNumber>;
|
|
415
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
416
|
+
}, z.core.$strip>;
|
|
417
|
+
machine: z.ZodObject<{
|
|
418
|
+
os: z.ZodString;
|
|
419
|
+
arch: z.ZodString;
|
|
420
|
+
node: z.ZodString;
|
|
421
|
+
cpus: z.ZodNumber;
|
|
422
|
+
}, z.core.$strip>;
|
|
423
|
+
playwrightVersion: z.ZodString;
|
|
424
|
+
workers: z.ZodNumber;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
project: z.ZodObject<{
|
|
427
|
+
name: z.ZodNullable<z.ZodString>;
|
|
428
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
429
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
430
|
+
name: z.ZodString;
|
|
431
|
+
testDir: z.ZodString;
|
|
432
|
+
}, z.core.$strip>>;
|
|
433
|
+
workers: z.ZodNumber;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
paths: z.ZodObject<{
|
|
436
|
+
outputDir: z.ZodString;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
summary: z.ZodObject<{
|
|
439
|
+
total: z.ZodNumber;
|
|
440
|
+
passed: z.ZodNumber;
|
|
441
|
+
failed: z.ZodNumber;
|
|
442
|
+
flaky: z.ZodNumber;
|
|
443
|
+
skipped: z.ZodNumber;
|
|
444
|
+
}, z.core.$strip>;
|
|
445
|
+
tests: z.ZodArray<z.ZodObject<{
|
|
446
|
+
testId: z.ZodString;
|
|
447
|
+
title: z.ZodString;
|
|
448
|
+
titlePath: z.ZodArray<z.ZodString>;
|
|
449
|
+
file: z.ZodString;
|
|
450
|
+
line: z.ZodNumber;
|
|
451
|
+
column: z.ZodNumber;
|
|
452
|
+
project: z.ZodString;
|
|
453
|
+
tags: z.ZodArray<z.ZodString>;
|
|
454
|
+
annotations: z.ZodArray<z.ZodObject<{
|
|
455
|
+
type: z.ZodString;
|
|
456
|
+
description: z.ZodNullable<z.ZodString>;
|
|
457
|
+
}, z.core.$strip>>;
|
|
458
|
+
caseIds: z.ZodArray<z.ZodString>;
|
|
459
|
+
expectedStatus: z.ZodEnum<{
|
|
460
|
+
passed: "passed";
|
|
461
|
+
failed: "failed";
|
|
462
|
+
timedOut: "timedOut";
|
|
463
|
+
skipped: "skipped";
|
|
464
|
+
interrupted: "interrupted";
|
|
465
|
+
}>;
|
|
466
|
+
outcome: z.ZodEnum<{
|
|
467
|
+
skipped: "skipped";
|
|
468
|
+
expected: "expected";
|
|
469
|
+
unexpected: "unexpected";
|
|
470
|
+
flaky: "flaky";
|
|
471
|
+
}>;
|
|
472
|
+
status: z.ZodEnum<{
|
|
473
|
+
passed: "passed";
|
|
474
|
+
failed: "failed";
|
|
475
|
+
timedOut: "timedOut";
|
|
476
|
+
skipped: "skipped";
|
|
477
|
+
interrupted: "interrupted";
|
|
478
|
+
}>;
|
|
479
|
+
durationMs: z.ZodNumber;
|
|
480
|
+
finalDurationMs: z.ZodNumber;
|
|
481
|
+
attemptCount: z.ZodNumber;
|
|
482
|
+
repeatEachIndex: z.ZodNumber;
|
|
483
|
+
firstError: z.ZodNullable<z.ZodObject<{
|
|
484
|
+
message: z.ZodString;
|
|
485
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
486
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
487
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
488
|
+
file: z.ZodString;
|
|
489
|
+
line: z.ZodNumber;
|
|
490
|
+
column: z.ZodNumber;
|
|
491
|
+
}, z.core.$strip>>;
|
|
492
|
+
}, z.core.$strip>>;
|
|
493
|
+
attempts: z.ZodArray<z.ZodObject<{
|
|
494
|
+
retry: z.ZodNumber;
|
|
495
|
+
status: z.ZodEnum<{
|
|
496
|
+
passed: "passed";
|
|
497
|
+
failed: "failed";
|
|
498
|
+
timedOut: "timedOut";
|
|
499
|
+
skipped: "skipped";
|
|
500
|
+
interrupted: "interrupted";
|
|
501
|
+
}>;
|
|
502
|
+
durationMs: z.ZodNumber;
|
|
503
|
+
startedAt: z.ZodString;
|
|
504
|
+
workerIndex: z.ZodNumber;
|
|
505
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
506
|
+
message: z.ZodString;
|
|
507
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
508
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
509
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
510
|
+
file: z.ZodString;
|
|
511
|
+
line: z.ZodNumber;
|
|
512
|
+
column: z.ZodNumber;
|
|
513
|
+
}, z.core.$strip>>;
|
|
514
|
+
}, z.core.$strip>>;
|
|
515
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
516
|
+
name: z.ZodString;
|
|
517
|
+
contentType: z.ZodString;
|
|
518
|
+
path: z.ZodNullable<z.ZodString>;
|
|
519
|
+
inline: z.ZodBoolean;
|
|
520
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
521
|
+
dataUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
524
|
+
title: z.ZodString;
|
|
525
|
+
category: z.ZodString;
|
|
526
|
+
durationMs: z.ZodNumber;
|
|
527
|
+
depth: z.ZodNumber;
|
|
528
|
+
failed: z.ZodBoolean;
|
|
529
|
+
}, z.core.$strip>>>;
|
|
530
|
+
stdout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
531
|
+
stderr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
532
|
+
}, z.core.$strip>>;
|
|
533
|
+
}, z.core.$strip>>;
|
|
534
|
+
globalErrors: z.ZodArray<z.ZodObject<{
|
|
535
|
+
message: z.ZodString;
|
|
536
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
537
|
+
snippet: z.ZodNullable<z.ZodString>;
|
|
538
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
539
|
+
file: z.ZodString;
|
|
540
|
+
line: z.ZodNumber;
|
|
541
|
+
column: z.ZodNumber;
|
|
542
|
+
}, z.core.$strip>>;
|
|
543
|
+
}, z.core.$strip>>;
|
|
544
|
+
}, z.core.$strip>;
|
|
545
|
+
export declare const runSummaryRecordSchema: z.ZodObject<{
|
|
546
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
547
|
+
runId: z.ZodString;
|
|
548
|
+
title: z.ZodNullable<z.ZodString>;
|
|
549
|
+
startedAt: z.ZodString;
|
|
550
|
+
durationMs: z.ZodNumber;
|
|
551
|
+
status: z.ZodEnum<{
|
|
552
|
+
passed: "passed";
|
|
553
|
+
failed: "failed";
|
|
554
|
+
interrupted: "interrupted";
|
|
555
|
+
timedout: "timedout";
|
|
556
|
+
}>;
|
|
557
|
+
complete: z.ZodBoolean;
|
|
558
|
+
summary: z.ZodObject<{
|
|
559
|
+
total: z.ZodNumber;
|
|
560
|
+
passed: z.ZodNumber;
|
|
561
|
+
failed: z.ZodNumber;
|
|
562
|
+
flaky: z.ZodNumber;
|
|
563
|
+
skipped: z.ZodNumber;
|
|
564
|
+
}, z.core.$strip>;
|
|
565
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
566
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
567
|
+
ciProvider: z.ZodNullable<z.ZodString>;
|
|
568
|
+
buildUrl: z.ZodNullable<z.ZodString>;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
export type ErrorRecord = z.infer<typeof errorRecordSchema>;
|
|
571
|
+
export type StepRecord = z.infer<typeof stepRecordSchema>;
|
|
572
|
+
export type TestRecord = z.infer<typeof testRecordSchema>;
|
|
573
|
+
export type ShardFile = z.infer<typeof shardFileSchema>;
|
|
574
|
+
export type RunRecord = z.infer<typeof runRecordSchema>;
|
|
575
|
+
export type RunSummaryRecord = z.infer<typeof runSummaryRecordSchema>;
|
|
576
|
+
/** Validate a shard and report its file path in the error. */
|
|
577
|
+
export declare function readShard(value: unknown, filePath?: string): ShardFile;
|
|
578
|
+
/** Validate a run record and report its file path in the error. */
|
|
579
|
+
export declare function readRun(value: unknown, filePath?: string): RunRecord;
|
|
580
|
+
export declare const parseShard: typeof readShard;
|
|
581
|
+
export declare const parseRun: typeof readRun;
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LogbookError } from './errors.js';
|
|
3
|
+
export const SCHEMA_VERSION = 1;
|
|
4
|
+
export const statusSchema = z.enum(['passed', 'failed', 'timedOut', 'skipped', 'interrupted']);
|
|
5
|
+
export const outcomeSchema = z.enum(['expected', 'unexpected', 'flaky', 'skipped']);
|
|
6
|
+
export const runStatusSchema = z.enum(['passed', 'failed', 'timedout', 'interrupted']);
|
|
7
|
+
export const errorRecordSchema = z.object({ message: z.string(), stack: z.string().nullable(), snippet: z.string().nullable(), location: z.object({ file: z.string(), line: z.number(), column: z.number() }).nullable() });
|
|
8
|
+
export const stepRecordSchema = z.object({ title: z.string(), category: z.string(), durationMs: z.number(), depth: z.number().int().min(0).max(2), failed: z.boolean() });
|
|
9
|
+
export const attachmentRecordSchema = z.object({ name: z.string(), contentType: z.string(), path: z.string().nullable(), inline: z.boolean(), sizeBytes: z.number().nullable(), dataUri: z.string().nullable().optional() });
|
|
10
|
+
export const attemptRecordSchema = z.object({ retry: z.number(), status: statusSchema, durationMs: z.number(), startedAt: z.string(), workerIndex: z.number(), errors: z.array(errorRecordSchema), attachments: z.array(attachmentRecordSchema), steps: z.array(stepRecordSchema).optional(), stdout: z.string().nullable().optional(), stderr: z.string().nullable().optional() });
|
|
11
|
+
export const annotationSchema = z.object({ type: z.string(), description: z.string().nullable() });
|
|
12
|
+
export const testRecordSchema = z.object({ testId: z.string(), title: z.string(), titlePath: z.array(z.string()), file: z.string(), line: z.number(), column: z.number(), project: z.string(), tags: z.array(z.string()), annotations: z.array(annotationSchema), caseIds: z.array(z.string()), expectedStatus: statusSchema, outcome: outcomeSchema, status: statusSchema, durationMs: z.number(), finalDurationMs: z.number(), attemptCount: z.number(), repeatEachIndex: z.number(), firstError: errorRecordSchema.nullable(), attempts: z.array(attemptRecordSchema) });
|
|
13
|
+
export const envInfoSchema = z.object({ ci: z.object({ provider: z.enum(['github', 'gitlab', 'azure', 'jenkins', 'circleci', 'bitbucket', 'other']), buildId: z.string().nullable(), buildUrl: z.string().nullable() }).nullable(), git: z.object({ commit: z.string().nullable(), branch: z.string().nullable(), prNumber: z.number().nullable(), repository: z.string().nullable() }), machine: z.object({ os: z.string(), arch: z.string(), node: z.string(), cpus: z.number() }), playwrightVersion: z.string(), workers: z.number() });
|
|
14
|
+
export const projectInfoSchema = z.object({ name: z.string().nullable(), configFile: z.string().nullable(), projects: z.array(z.object({ name: z.string(), testDir: z.string() })), workers: z.number() });
|
|
15
|
+
export const summarySchema = z.object({ total: z.number(), passed: z.number(), failed: z.number(), flaky: z.number(), skipped: z.number() });
|
|
16
|
+
export const shardFileSchema = z.object({ schemaVersion: z.literal(SCHEMA_VERSION), kind: z.literal('shard'), runId: z.string(), title: z.string().nullable(), shard: z.object({ current: z.number(), total: z.number() }).nullable(), startedAt: z.string(), endedAt: z.string(), status: runStatusSchema, env: envInfoSchema, project: projectInfoSchema, tests: z.array(testRecordSchema), globalErrors: z.array(errorRecordSchema) });
|
|
17
|
+
export const runRecordSchema = z.object({ schemaVersion: z.literal(SCHEMA_VERSION), kind: z.literal('run'), runId: z.string(), title: z.string().nullable(), startedAt: z.string(), endedAt: z.string(), durationMs: z.number(), status: runStatusSchema, complete: z.boolean(), expectedShards: z.number().nullable(), receivedShards: z.array(z.number()), env: envInfoSchema, project: projectInfoSchema, paths: z.object({ outputDir: z.string() }), summary: summarySchema, tests: z.array(testRecordSchema), globalErrors: z.array(errorRecordSchema) });
|
|
18
|
+
export const runSummaryRecordSchema = z.object({ schemaVersion: z.literal(SCHEMA_VERSION), runId: z.string(), title: z.string().nullable(), startedAt: z.string(), durationMs: z.number(), status: runStatusSchema, complete: z.boolean(), summary: summarySchema, branch: z.string().nullable(), commit: z.string().nullable(), ciProvider: z.string().nullable(), buildUrl: z.string().nullable() });
|
|
19
|
+
function validate(schema, value, filePath, kind) {
|
|
20
|
+
const parsed = schema.safeParse(value);
|
|
21
|
+
if (!parsed.success)
|
|
22
|
+
throw new LogbookError('INVALID_DATA', `${filePath}: invalid ${kind} data`);
|
|
23
|
+
return parsed.data;
|
|
24
|
+
}
|
|
25
|
+
/** Validate a shard and report its file path in the error. */
|
|
26
|
+
export function readShard(value, filePath = '<input>') { return validate(shardFileSchema, value, filePath, 'shard'); }
|
|
27
|
+
/** Validate a run record and report its file path in the error. */
|
|
28
|
+
export function readRun(value, filePath = '<input>') { return validate(runRecordSchema, value, filePath, 'run'); }
|
|
29
|
+
export const parseShard = readShard;
|
|
30
|
+
export const parseRun = readRun;
|
|
31
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,O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QAAQ,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AASvY,SAAS,QAAQ,CAAI,MAAoB,EAAE,KAAc,EAAE,QAAgB,EAAE,IAAY;IACvF,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE,GAAG,QAAQ,aAAa,IAAI,OAAO,CAAC,CAAC;IACjG,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,QAAQ,GAAG,SAAS,IAAe,OAAO,QAAQ,CAAC,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1I,mEAAmE;AACnE,MAAM,UAAU,OAAO,CAAC,KAAc,EAAE,QAAQ,GAAG,SAAS,IAAe,OAAO,QAAQ,CAAC,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACtI,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AACpC,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DebugEvidence } from './debugpacket.js';
|
|
2
|
+
export interface DebugSignal {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
explanation: string;
|
|
6
|
+
evidenceIds: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Conservative, evidence-linked clues. These are not root-cause diagnoses. */
|
|
9
|
+
export declare function detectSignals(evidence: DebugEvidence[], outcome: string): DebugSignal[];
|
package/dist/signals.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Conservative, evidence-linked clues. These are not root-cause diagnoses. */
|
|
2
|
+
export function detectSignals(evidence, outcome) {
|
|
3
|
+
const signals = [];
|
|
4
|
+
const errors = evidence.filter((item) => item.kind === 'error');
|
|
5
|
+
const steps = evidence.filter((item) => item.kind === 'step');
|
|
6
|
+
const attempts = evidence.filter((item) => item.kind === 'attempt');
|
|
7
|
+
const history = evidence.find((item) => item.kind === 'history');
|
|
8
|
+
const findPair = (errorPattern, stepPattern) => {
|
|
9
|
+
for (const error of errors) {
|
|
10
|
+
const retry = error.id.split(':')[1];
|
|
11
|
+
const step = steps.find((item) => item.id.startsWith(`step:retry-${retry}:`) && /; failed\b/.test(item.text) && stepPattern.test(item.text));
|
|
12
|
+
if (step && errorPattern.test(error.text))
|
|
13
|
+
return [error, step];
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
const locator = findPair(/(?:locator\.|Locator:[\s\S]*Timeout:|waiting for locator|Timeout .*exceeded)/i, /^(?:(?:pw:api|test\.step):.*(?:locator|click|fill|waitFor)|expect: Expect "toBeVisible")/i);
|
|
18
|
+
if (locator)
|
|
19
|
+
signals.push({ id: 'locator-timeout', label: 'Locator operation timed out', explanation: 'A failed locator-related step and timeout evidence are recorded on the same attempt. Check selector state and timing.', evidenceIds: locator.map((item) => item.id) });
|
|
20
|
+
const assertion = findPair(/(?:expect\(|expect\.|AssertionError|Expected:)/i, /^(?:expect|test\.step):/i);
|
|
21
|
+
if (assertion && (!locator || assertion[0].id !== locator[0].id))
|
|
22
|
+
signals.push({ id: 'assertion', label: 'Assertion failed', explanation: 'A failed assertion step and its error are recorded on the same attempt. Inspect the expected and actual values.', evidenceIds: assertion.map((item) => item.id) });
|
|
23
|
+
const navigation = findPair(/(?:page\.goto|net::ERR_|Navigation failed)/i, /^(?:pw:api|test\.step):.*(?:goto|navigate)/i);
|
|
24
|
+
if (navigation)
|
|
25
|
+
signals.push({ id: 'navigation', label: 'Navigation failed', explanation: 'A navigation step failed with a matching error. Inspect the URL and page availability.', evidenceIds: navigation.map((item) => item.id) });
|
|
26
|
+
const failedAttempt = attempts.find((item) => /: (?:failed|timedOut|interrupted);/.test(item.text));
|
|
27
|
+
const passedAttempt = attempts.find((item) => /: passed;/.test(item.text));
|
|
28
|
+
if (outcome === 'flaky' && failedAttempt && passedAttempt)
|
|
29
|
+
signals.push({ id: 'retry-changed-outcome', label: 'Passed after a failed attempt', explanation: 'The recorded attempts changed outcome. This is not evidence that the underlying issue is fixed.', evidenceIds: [failedAttempt.id, passedAttempt.id] });
|
|
30
|
+
if (outcome === 'unexpected' && history && /: [pfks-]*p$/.test(history.text)) {
|
|
31
|
+
const failure = errors[0] ?? failedAttempt;
|
|
32
|
+
if (failure)
|
|
33
|
+
signals.push({ id: 'new-failure', label: 'Failed after a prior pass', explanation: 'The previous recorded result passed; this run failed. Compare recent changes before assigning a cause.', evidenceIds: [history.id, failure.id] });
|
|
34
|
+
}
|
|
35
|
+
return signals.length ? signals : [{ id: 'unknown', label: 'No specific clue', explanation: 'Available evidence does not support a specific debugging clue. Inspect the error and trace manually.', evidenceIds: [] }];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=signals.js.map
|