executable-stories-formatters 0.7.13 → 0.7.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "executable-stories-formatters",
3
- "version": "0.7.13",
3
+ "version": "0.7.15",
4
4
  "description": "Cucumber-compatible report formats (HTML, Markdown, JUnit XML, Cucumber JSON) for executable-stories test results.",
5
5
  "author": "Jag Reehal <jag@jagreehal.com>",
6
6
  "license": "MIT",
@@ -0,0 +1,410 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://executable-stories.dev/schemas/story-report-v1.schema.json",
4
+ "title": "StoryReport",
5
+ "description": "Pre-grouped, denormalized report shape consumed by UI renderers (React, Svelte, Vue, etc.). Stable public contract — additive-only within a major. Distinct from internal TestRunResult.",
6
+ "type": "object",
7
+ "$ref": "#/$defs/StoryReport",
8
+ "$defs": {
9
+ "StoryReport": {
10
+ "type": "object",
11
+ "description": "Top-level report containing all features, runtime metadata, and a pre-computed summary.",
12
+ "properties": {
13
+ "schemaVersion": {
14
+ "type": "string",
15
+ "pattern": "^1\\.[0-9]+$",
16
+ "description": "Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x."
17
+ },
18
+ "runId": {
19
+ "type": "string",
20
+ "minLength": 1,
21
+ "description": "Unique deterministic identifier for this run."
22
+ },
23
+ "startedAtMs": {
24
+ "type": "number",
25
+ "minimum": 0,
26
+ "description": "Run start time as Unix epoch milliseconds."
27
+ },
28
+ "finishedAtMs": {
29
+ "type": "number",
30
+ "minimum": 0,
31
+ "description": "Run finish time as Unix epoch milliseconds."
32
+ },
33
+ "durationMs": {
34
+ "type": "number",
35
+ "minimum": 0,
36
+ "description": "Total run duration in milliseconds."
37
+ },
38
+ "projectRoot": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "description": "Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred)."
42
+ },
43
+ "packageVersion": {
44
+ "type": "string",
45
+ "description": "Version of the package under test, if known."
46
+ },
47
+ "gitSha": {
48
+ "type": "string",
49
+ "description": "Git commit SHA at the time of the run."
50
+ },
51
+ "ci": {
52
+ "$ref": "#/$defs/CIInfo"
53
+ },
54
+ "coverage": {
55
+ "$ref": "#/$defs/CoverageSummary"
56
+ },
57
+ "summary": {
58
+ "$ref": "#/$defs/Summary",
59
+ "description": "Pre-computed counts across all features and scenarios."
60
+ },
61
+ "features": {
62
+ "type": "array",
63
+ "items": { "$ref": "#/$defs/Feature" },
64
+ "description": "Features grouped by sourceFile, sorted by title."
65
+ }
66
+ },
67
+ "required": ["schemaVersion", "runId", "startedAtMs", "finishedAtMs", "durationMs", "projectRoot", "summary", "features"],
68
+ "additionalProperties": false
69
+ },
70
+ "Summary": {
71
+ "type": "object",
72
+ "description": "Counts by status. Sums equal 'total'.",
73
+ "properties": {
74
+ "total": { "type": "integer", "minimum": 0 },
75
+ "passed": { "type": "integer", "minimum": 0 },
76
+ "failed": { "type": "integer", "minimum": 0 },
77
+ "skipped": { "type": "integer", "minimum": 0 },
78
+ "pending": { "type": "integer", "minimum": 0 },
79
+ "durationMs": { "type": "number", "minimum": 0 }
80
+ },
81
+ "required": ["total", "passed", "failed", "skipped", "pending", "durationMs"],
82
+ "additionalProperties": false
83
+ },
84
+ "Feature": {
85
+ "type": "object",
86
+ "description": "A group of scenarios from the same source file.",
87
+ "properties": {
88
+ "id": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "description": "Stable slug derived from the relative source path. Suitable for use as a deep-link anchor."
92
+ },
93
+ "title": {
94
+ "type": "string",
95
+ "minLength": 1,
96
+ "description": "Display title. Derived from describe block when present, otherwise the file basename."
97
+ },
98
+ "sourceFile": {
99
+ "type": "string",
100
+ "minLength": 1,
101
+ "description": "Source path, relative to projectRoot when possible."
102
+ },
103
+ "summary": { "$ref": "#/$defs/Summary" },
104
+ "scenarios": {
105
+ "type": "array",
106
+ "items": { "$ref": "#/$defs/Scenario" },
107
+ "description": "Scenarios in this feature, in declaration order."
108
+ }
109
+ },
110
+ "required": ["id", "title", "sourceFile", "summary", "scenarios"],
111
+ "additionalProperties": false
112
+ },
113
+ "Scenario": {
114
+ "type": "object",
115
+ "description": "A single scenario with its steps, story-level doc entries, and attachments.",
116
+ "properties": {
117
+ "id": {
118
+ "type": "string",
119
+ "minLength": 1,
120
+ "description": "Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor."
121
+ },
122
+ "title": { "type": "string", "minLength": 1 },
123
+ "status": { "$ref": "#/$defs/TestStatus" },
124
+ "durationMs": { "type": "number", "minimum": 0 },
125
+ "tags": {
126
+ "type": "array",
127
+ "items": { "type": "string" },
128
+ "description": "Normalized tags, deduplicated, lowercased."
129
+ },
130
+ "tickets": {
131
+ "type": "array",
132
+ "items": { "$ref": "#/$defs/Ticket" }
133
+ },
134
+ "sourceLine": { "type": "integer", "minimum": 1 },
135
+ "errorMessage": { "type": "string" },
136
+ "errorStack": { "type": "string" },
137
+ "retry": { "type": "integer", "minimum": 0 },
138
+ "retries": { "type": "integer", "minimum": 0 },
139
+ "docEntries": {
140
+ "type": "array",
141
+ "items": { "$ref": "#/$defs/DocEntry" },
142
+ "description": "Story-level doc entries (rendered before steps)."
143
+ },
144
+ "steps": {
145
+ "type": "array",
146
+ "items": { "$ref": "#/$defs/Step" }
147
+ },
148
+ "attachments": {
149
+ "type": "array",
150
+ "items": { "$ref": "#/$defs/Attachment" }
151
+ }
152
+ },
153
+ "required": ["id", "title", "status", "durationMs", "tags", "retry", "retries", "docEntries", "steps", "attachments"],
154
+ "additionalProperties": false
155
+ },
156
+ "Step": {
157
+ "type": "object",
158
+ "description": "A single BDD step.",
159
+ "properties": {
160
+ "id": { "type": "string", "minLength": 1 },
161
+ "index": { "type": "integer", "minimum": 0 },
162
+ "keyword": { "$ref": "#/$defs/StepKeyword" },
163
+ "text": { "type": "string" },
164
+ "status": { "$ref": "#/$defs/TestStatus" },
165
+ "durationMs": { "type": "number", "minimum": 0 },
166
+ "errorMessage": { "type": "string" },
167
+ "mode": { "$ref": "#/$defs/StepMode" },
168
+ "docEntries": {
169
+ "type": "array",
170
+ "items": { "$ref": "#/$defs/DocEntry" },
171
+ "description": "Doc entries attached to this step."
172
+ }
173
+ },
174
+ "required": ["id", "index", "keyword", "text", "status", "durationMs", "docEntries"],
175
+ "additionalProperties": false
176
+ },
177
+ "StepKeyword": {
178
+ "type": "string",
179
+ "enum": ["Given", "When", "Then", "And", "But"]
180
+ },
181
+ "StepMode": {
182
+ "type": "string",
183
+ "enum": ["normal", "skip", "only", "todo", "fails", "concurrent"]
184
+ },
185
+ "TestStatus": {
186
+ "type": "string",
187
+ "enum": ["passed", "failed", "skipped", "pending"]
188
+ },
189
+ "Ticket": {
190
+ "type": "object",
191
+ "properties": {
192
+ "id": { "type": "string", "minLength": 1 },
193
+ "url": { "type": "string" }
194
+ },
195
+ "required": ["id"],
196
+ "additionalProperties": false
197
+ },
198
+ "Attachment": {
199
+ "type": "object",
200
+ "properties": {
201
+ "name": { "type": "string" },
202
+ "mediaType": { "type": "string", "minLength": 1 },
203
+ "body": { "type": "string" },
204
+ "contentEncoding": {
205
+ "type": "string",
206
+ "enum": ["BASE64", "IDENTITY"]
207
+ }
208
+ },
209
+ "required": ["name", "mediaType", "body", "contentEncoding"],
210
+ "additionalProperties": false
211
+ },
212
+ "CIInfo": {
213
+ "type": "object",
214
+ "properties": {
215
+ "name": { "type": "string" },
216
+ "url": { "type": "string" },
217
+ "buildNumber": { "type": "string" },
218
+ "branch": { "type": "string" },
219
+ "commitSha": { "type": "string" },
220
+ "prNumber": { "type": "string" }
221
+ },
222
+ "required": ["name"],
223
+ "additionalProperties": false
224
+ },
225
+ "CoverageSummary": {
226
+ "type": "object",
227
+ "properties": {
228
+ "linesPct": { "type": "number", "minimum": 0, "maximum": 100 },
229
+ "branchesPct": { "type": "number", "minimum": 0, "maximum": 100 },
230
+ "functionsPct": { "type": "number", "minimum": 0, "maximum": 100 },
231
+ "statementsPct": { "type": "number", "minimum": 0, "maximum": 100 }
232
+ },
233
+ "additionalProperties": false
234
+ },
235
+ "DocPhase": {
236
+ "type": "string",
237
+ "enum": ["static", "runtime"]
238
+ },
239
+ "DocEntry": {
240
+ "oneOf": [
241
+ { "$ref": "#/$defs/DocNote" },
242
+ { "$ref": "#/$defs/DocTag" },
243
+ { "$ref": "#/$defs/DocKv" },
244
+ { "$ref": "#/$defs/DocCode" },
245
+ { "$ref": "#/$defs/DocTable" },
246
+ { "$ref": "#/$defs/DocLink" },
247
+ { "$ref": "#/$defs/DocSection" },
248
+ { "$ref": "#/$defs/DocMermaid" },
249
+ { "$ref": "#/$defs/DocScreenshot" },
250
+ { "$ref": "#/$defs/DocCustom" }
251
+ ]
252
+ },
253
+ "DocNote": {
254
+ "type": "object",
255
+ "properties": {
256
+ "kind": { "const": "note" },
257
+ "text": { "type": "string" },
258
+ "phase": { "$ref": "#/$defs/DocPhase" },
259
+ "children": {
260
+ "type": "array",
261
+ "items": { "$ref": "#/$defs/DocEntry" }
262
+ }
263
+ },
264
+ "required": ["kind", "text", "phase"],
265
+ "additionalProperties": false
266
+ },
267
+ "DocTag": {
268
+ "type": "object",
269
+ "properties": {
270
+ "kind": { "const": "tag" },
271
+ "names": { "type": "array", "items": { "type": "string" } },
272
+ "phase": { "$ref": "#/$defs/DocPhase" },
273
+ "children": {
274
+ "type": "array",
275
+ "items": { "$ref": "#/$defs/DocEntry" }
276
+ }
277
+ },
278
+ "required": ["kind", "names", "phase"],
279
+ "additionalProperties": false
280
+ },
281
+ "DocKv": {
282
+ "type": "object",
283
+ "properties": {
284
+ "kind": { "const": "kv" },
285
+ "label": { "type": "string" },
286
+ "value": {},
287
+ "phase": { "$ref": "#/$defs/DocPhase" },
288
+ "children": {
289
+ "type": "array",
290
+ "items": { "$ref": "#/$defs/DocEntry" }
291
+ }
292
+ },
293
+ "required": ["kind", "label", "value", "phase"],
294
+ "additionalProperties": false
295
+ },
296
+ "DocCode": {
297
+ "type": "object",
298
+ "properties": {
299
+ "kind": { "const": "code" },
300
+ "label": { "type": "string" },
301
+ "content": { "type": "string" },
302
+ "lang": { "type": "string" },
303
+ "phase": { "$ref": "#/$defs/DocPhase" },
304
+ "children": {
305
+ "type": "array",
306
+ "items": { "$ref": "#/$defs/DocEntry" }
307
+ }
308
+ },
309
+ "required": ["kind", "label", "content", "phase"],
310
+ "additionalProperties": false
311
+ },
312
+ "DocTable": {
313
+ "type": "object",
314
+ "properties": {
315
+ "kind": { "const": "table" },
316
+ "label": { "type": "string" },
317
+ "columns": { "type": "array", "items": { "type": "string" } },
318
+ "rows": {
319
+ "type": "array",
320
+ "items": {
321
+ "type": "array",
322
+ "items": { "type": "string" }
323
+ }
324
+ },
325
+ "phase": { "$ref": "#/$defs/DocPhase" },
326
+ "children": {
327
+ "type": "array",
328
+ "items": { "$ref": "#/$defs/DocEntry" }
329
+ }
330
+ },
331
+ "required": ["kind", "label", "columns", "rows", "phase"],
332
+ "additionalProperties": false
333
+ },
334
+ "DocLink": {
335
+ "type": "object",
336
+ "properties": {
337
+ "kind": { "const": "link" },
338
+ "label": { "type": "string" },
339
+ "url": { "type": "string" },
340
+ "phase": { "$ref": "#/$defs/DocPhase" },
341
+ "children": {
342
+ "type": "array",
343
+ "items": { "$ref": "#/$defs/DocEntry" }
344
+ }
345
+ },
346
+ "required": ["kind", "label", "url", "phase"],
347
+ "additionalProperties": false
348
+ },
349
+ "DocSection": {
350
+ "type": "object",
351
+ "properties": {
352
+ "kind": { "const": "section" },
353
+ "title": { "type": "string" },
354
+ "markdown": { "type": "string" },
355
+ "phase": { "$ref": "#/$defs/DocPhase" },
356
+ "children": {
357
+ "type": "array",
358
+ "items": { "$ref": "#/$defs/DocEntry" }
359
+ }
360
+ },
361
+ "required": ["kind", "title", "markdown", "phase"],
362
+ "additionalProperties": false
363
+ },
364
+ "DocMermaid": {
365
+ "type": "object",
366
+ "properties": {
367
+ "kind": { "const": "mermaid" },
368
+ "code": { "type": "string" },
369
+ "title": { "type": "string" },
370
+ "phase": { "$ref": "#/$defs/DocPhase" },
371
+ "children": {
372
+ "type": "array",
373
+ "items": { "$ref": "#/$defs/DocEntry" }
374
+ }
375
+ },
376
+ "required": ["kind", "code", "phase"],
377
+ "additionalProperties": false
378
+ },
379
+ "DocScreenshot": {
380
+ "type": "object",
381
+ "properties": {
382
+ "kind": { "const": "screenshot" },
383
+ "path": { "type": "string" },
384
+ "alt": { "type": "string" },
385
+ "phase": { "$ref": "#/$defs/DocPhase" },
386
+ "children": {
387
+ "type": "array",
388
+ "items": { "$ref": "#/$defs/DocEntry" }
389
+ }
390
+ },
391
+ "required": ["kind", "path", "phase"],
392
+ "additionalProperties": false
393
+ },
394
+ "DocCustom": {
395
+ "type": "object",
396
+ "properties": {
397
+ "kind": { "const": "custom" },
398
+ "type": { "type": "string", "minLength": 1 },
399
+ "data": {},
400
+ "phase": { "$ref": "#/$defs/DocPhase" },
401
+ "children": {
402
+ "type": "array",
403
+ "items": { "$ref": "#/$defs/DocEntry" }
404
+ }
405
+ },
406
+ "required": ["kind", "type", "data", "phase"],
407
+ "additionalProperties": false
408
+ }
409
+ }
410
+ }