@sun-asterisk/sungen 3.2.5 → 3.2.7

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.
Files changed (126) hide show
  1. package/dist/cli/commands/delivery.d.ts.map +1 -1
  2. package/dist/cli/commands/delivery.js +7 -46
  3. package/dist/cli/commands/delivery.js.map +1 -1
  4. package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
  5. package/dist/dashboard/snapshot-builder.js +28 -6
  6. package/dist/dashboard/snapshot-builder.js.map +1 -1
  7. package/dist/dashboard/templates/index.html +20 -20
  8. package/dist/dashboard/types.d.ts +18 -0
  9. package/dist/dashboard/types.d.ts.map +1 -1
  10. package/dist/exporters/api-catalog-loader.d.ts +18 -0
  11. package/dist/exporters/api-catalog-loader.d.ts.map +1 -0
  12. package/dist/exporters/api-catalog-loader.js +77 -0
  13. package/dist/exporters/api-catalog-loader.js.map +1 -0
  14. package/dist/exporters/csv-exporter.d.ts.map +1 -1
  15. package/dist/exporters/csv-exporter.js +20 -26
  16. package/dist/exporters/csv-exporter.js.map +1 -1
  17. package/dist/exporters/feature-parser.d.ts +6 -0
  18. package/dist/exporters/feature-parser.d.ts.map +1 -1
  19. package/dist/exporters/feature-parser.js +9 -3
  20. package/dist/exporters/feature-parser.js.map +1 -1
  21. package/dist/exporters/json-exporter.d.ts +10 -1
  22. package/dist/exporters/json-exporter.d.ts.map +1 -1
  23. package/dist/exporters/json-exporter.js +92 -50
  24. package/dist/exporters/json-exporter.js.map +1 -1
  25. package/dist/exporters/playwright-report-parser.d.ts +14 -0
  26. package/dist/exporters/playwright-report-parser.d.ts.map +1 -1
  27. package/dist/exporters/playwright-report-parser.js +30 -0
  28. package/dist/exporters/playwright-report-parser.js.map +1 -1
  29. package/dist/exporters/result-variants.d.ts +29 -0
  30. package/dist/exporters/result-variants.d.ts.map +1 -0
  31. package/dist/exporters/result-variants.js +33 -0
  32. package/dist/exporters/result-variants.js.map +1 -0
  33. package/dist/exporters/xlsx-exporter.d.ts +18 -17
  34. package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
  35. package/dist/exporters/xlsx-exporter.js +25 -563
  36. package/dist/exporters/xlsx-exporter.js.map +1 -1
  37. package/dist/exporters/xlsx-report-builder.d.ts +196 -0
  38. package/dist/exporters/xlsx-report-builder.d.ts.map +1 -0
  39. package/dist/exporters/xlsx-report-builder.js +653 -0
  40. package/dist/exporters/xlsx-report-builder.js.map +1 -0
  41. package/dist/generators/test-generator/adapters/appium/templates/scenario.hbs +1 -1
  42. package/dist/generators/test-generator/adapters/playwright/templates/scenario.hbs +6 -6
  43. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/expand-action.hbs +30 -8
  44. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +16 -1
  45. package/dist/generators/test-generator/patterns/expect-patterns.d.ts.map +1 -1
  46. package/dist/generators/test-generator/patterns/expect-patterns.js +23 -0
  47. package/dist/generators/test-generator/patterns/expect-patterns.js.map +1 -1
  48. package/dist/generators/test-generator/utils/selector-resolver.d.ts +7 -0
  49. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  50. package/dist/generators/test-generator/utils/selector-resolver.js +13 -2
  51. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  52. package/dist/orchestrator/project-initializer.d.ts +9 -0
  53. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  54. package/dist/orchestrator/project-initializer.js +66 -9
  55. package/dist/orchestrator/project-initializer.js.map +1 -1
  56. package/dist/orchestrator/templates/ai-src/commands/add-api.md +76 -0
  57. package/dist/orchestrator/templates/ai-src/commands/create-test.md +2 -2
  58. package/dist/orchestrator/templates/ai-src/config/codex.md +3 -2
  59. package/dist/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +73 -0
  60. package/dist/orchestrator/templates/ai-src/skills/sungen-api-design/SKILL.md +42 -8
  61. package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +21 -0
  62. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +2 -0
  63. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +33 -0
  64. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +6 -0
  65. package/dist/orchestrator/templates/specs-api.d.ts +26 -0
  66. package/dist/orchestrator/templates/specs-api.d.ts.map +1 -1
  67. package/dist/orchestrator/templates/specs-api.js +131 -3
  68. package/dist/orchestrator/templates/specs-api.js.map +1 -1
  69. package/dist/orchestrator/templates/specs-api.ts +118 -5
  70. package/dist/orchestrator/templates/specs-test-data.ts +20 -1
  71. package/package.json +3 -3
  72. package/src/cli/commands/delivery.ts +8 -42
  73. package/src/dashboard/snapshot-builder.ts +31 -7
  74. package/src/dashboard/templates/index.html +20 -20
  75. package/src/dashboard/types.ts +19 -0
  76. package/src/exporters/api-catalog-loader.ts +44 -0
  77. package/src/exporters/csv-exporter.ts +19 -24
  78. package/src/exporters/feature-parser.ts +8 -2
  79. package/src/exporters/json-exporter.ts +102 -51
  80. package/src/exporters/playwright-report-parser.ts +27 -0
  81. package/src/exporters/result-variants.ts +47 -0
  82. package/src/exporters/xlsx-exporter.ts +34 -623
  83. package/src/exporters/xlsx-report-builder.ts +806 -0
  84. package/src/generators/test-generator/adapters/appium/templates/scenario.hbs +1 -1
  85. package/src/generators/test-generator/adapters/playwright/templates/scenario.hbs +6 -6
  86. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/expand-action.hbs +30 -8
  87. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +16 -1
  88. package/src/generators/test-generator/patterns/expect-patterns.ts +23 -0
  89. package/src/generators/test-generator/utils/selector-resolver.ts +30 -2
  90. package/src/orchestrator/project-initializer.ts +67 -9
  91. package/src/orchestrator/templates/ai-src/commands/add-api.md +76 -0
  92. package/src/orchestrator/templates/ai-src/commands/create-test.md +2 -2
  93. package/src/orchestrator/templates/ai-src/config/codex.md +3 -2
  94. package/src/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +73 -0
  95. package/src/orchestrator/templates/ai-src/skills/sungen-api-design/SKILL.md +42 -8
  96. package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +21 -0
  97. package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +2 -0
  98. package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +33 -0
  99. package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +6 -0
  100. package/src/orchestrator/templates/specs-api.ts +118 -5
  101. package/src/orchestrator/templates/specs-test-data.ts +20 -1
  102. package/dist/cli/types.d.ts +0 -9
  103. package/dist/cli/types.d.ts.map +0 -1
  104. package/dist/cli/types.js +0 -7
  105. package/dist/cli/types.js.map +0 -1
  106. package/dist/generators/gherkin-parser/selector-extractor.d.ts +0 -37
  107. package/dist/generators/gherkin-parser/selector-extractor.d.ts.map +0 -1
  108. package/dist/generators/gherkin-parser/selector-extractor.js +0 -108
  109. package/dist/generators/gherkin-parser/selector-extractor.js.map +0 -1
  110. package/dist/generators/test-generator/types.d.ts +0 -25
  111. package/dist/generators/test-generator/types.d.ts.map +0 -1
  112. package/dist/generators/test-generator/types.js +0 -7
  113. package/dist/generators/test-generator/types.js.map +0 -1
  114. package/dist/generators/types.d.ts +0 -119
  115. package/dist/generators/types.d.ts.map +0 -1
  116. package/dist/generators/types.js +0 -48
  117. package/dist/generators/types.js.map +0 -1
  118. package/dist/orchestrator/figma/node-path-collapser.d.ts +0 -16
  119. package/dist/orchestrator/figma/node-path-collapser.d.ts.map +0 -1
  120. package/dist/orchestrator/figma/node-path-collapser.js +0 -37
  121. package/dist/orchestrator/figma/node-path-collapser.js.map +0 -1
  122. package/src/cli/types.ts +0 -9
  123. package/src/generators/gherkin-parser/selector-extractor.ts +0 -142
  124. package/src/generators/test-generator/types.ts +0 -26
  125. package/src/generators/types.ts +0 -227
  126. package/src/orchestrator/figma/node-path-collapser.ts +0 -38
@@ -34,6 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.api = void 0;
37
+ exports.inferMime = inferMime;
38
+ exports.resolveFixture = resolveFixture;
37
39
  exports.joinApiUrl = joinApiUrl;
38
40
  /* eslint-disable */
39
41
  /**
@@ -75,6 +77,37 @@ function loadConfig() {
75
77
  function substitute(text, params) {
76
78
  return text.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => encodeURIComponent(String(params[p] ?? '')));
77
79
  }
80
+ /** Bind `:param` tokens WITHOUT URL-encoding — for headers, body-file paths, and multipart file paths. */
81
+ function substituteRaw(text, params) {
82
+ return text.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
83
+ }
84
+ /** Delete any case-insensitive variant of a header (HTTP header names are case-insensitive, but a
85
+ * plain object keys on exact case — so a datasource `Content-Type` and our `content-type` would
86
+ * both be sent). Call before setting, or to let Playwright own the header (multipart boundary). */
87
+ function deleteHeader(headers, name) {
88
+ const lower = name.toLowerCase();
89
+ for (const k of Object.keys(headers))
90
+ if (k.toLowerCase() === lower)
91
+ delete headers[k];
92
+ }
93
+ const MIME = {
94
+ png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg', gif: 'image/gif', webp: 'image/webp',
95
+ svg: 'image/svg+xml', pdf: 'application/pdf', csv: 'text/csv', txt: 'text/plain',
96
+ json: 'application/json', xml: 'application/xml', zip: 'application/zip', mp4: 'video/mp4',
97
+ };
98
+ function inferMime(name) {
99
+ return MIME[(name.split('.').pop() || '').toLowerCase()] || 'application/octet-stream';
100
+ }
101
+ /** Resolve a fixture path: cwd-relative/absolute first, else qa/fixtures/<path>. */
102
+ function resolveFixture(p, label) {
103
+ const direct = path.isAbsolute(p) ? p : path.join(process.cwd(), p);
104
+ if (fs.existsSync(direct))
105
+ return direct;
106
+ const inFixtures = path.join(process.cwd(), 'qa', 'fixtures', p);
107
+ if (fs.existsSync(inFixtures))
108
+ return inFixtures;
109
+ throw new Error(`API Driver: ${label} — fixture "${p}" not found (looked in ${direct} and qa/fixtures/${p}).`);
110
+ }
78
111
  /**
79
112
  * Join a datasource base URL with a catalog path. Concatenate rather than rely on Playwright's
80
113
  * baseURL resolution: an absolute path (`/user/1`) resolves against the base ORIGIN and would drop
@@ -116,7 +149,7 @@ class ApiClient {
116
149
  const headers = { ...(conf.headers || {}) };
117
150
  // catalog headers; :param tokens bind at runtime — raw (no URL-encoding, unlike the path)
118
151
  for (const [k, v] of Object.entries(req.headers || {}))
119
- headers[k] = String(v).replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
152
+ headers[k] = substituteRaw(String(v), params);
120
153
  // Body: substitute `:param` into the body template (object values), then encode per `encoding`.
121
154
  let body;
122
155
  if (req.body !== undefined && req.body !== null) {
@@ -124,8 +157,43 @@ class ApiClient {
124
157
  }
125
158
  // Map the wire format to the right Playwright option (#345): json → data (application/json,
126
159
  // default), form → form (application/x-www-form-urlencoded), multipart → multipart (form-data).
160
+ // A `files` block is a real upload: read each fixture into a { name, mimeType, buffer } part and
161
+ // send multipart, with any `body` values riding along as text fields.
127
162
  const bodyOpt = {};
128
- if (body !== undefined) {
163
+ if (req.bodyFile) {
164
+ // Raw-binary body: the whole request body is the fixture's bytes. Content-Type comes from the
165
+ // spec's mimeType (default application/octet-stream) — this is what octet-stream upload
166
+ // endpoints expect (a multipart body would be rejected 415).
167
+ const spec = typeof req.bodyFile === 'string' ? { path: req.bodyFile } : req.bodyFile;
168
+ const fpath = substituteRaw(String(spec.path), params);
169
+ if (fpath) {
170
+ const resolved = resolveFixture(fpath, label);
171
+ bodyOpt.data = fs.readFileSync(resolved);
172
+ // Own the Content-Type: drop any datasource default (case-insensitive) so we don't send both.
173
+ deleteHeader(headers, 'content-type');
174
+ headers['content-type'] = spec.mimeType ?? 'application/octet-stream';
175
+ }
176
+ }
177
+ else if (req.files && Object.keys(req.files).length) {
178
+ const mp = {};
179
+ if (body && typeof body === 'object')
180
+ for (const [k, v] of Object.entries(body))
181
+ mp[k] = typeof v === 'string' ? v : JSON.stringify(v);
182
+ for (const [field, raw] of Object.entries(req.files)) {
183
+ const spec = typeof raw === 'string' ? { path: raw } : raw;
184
+ const fpath = substituteRaw(String(spec.path), params);
185
+ if (!fpath)
186
+ continue; // empty param → omit the part (a missing-file / wrong-type error row)
187
+ const resolved = resolveFixture(fpath, label);
188
+ const filename = spec.filename ?? path.basename(resolved);
189
+ mp[spec.name ?? field] = { name: filename, mimeType: spec.mimeType ?? inferMime(filename), buffer: fs.readFileSync(resolved) };
190
+ }
191
+ // Playwright generates the multipart/form-data Content-Type (with boundary); drop any datasource
192
+ // default Content-Type so it doesn't conflict with / duplicate the generated one.
193
+ deleteHeader(headers, 'content-type');
194
+ bodyOpt.multipart = mp;
195
+ }
196
+ else if (body !== undefined) {
129
197
  const enc = req.encoding ?? 'json';
130
198
  if (enc === 'form')
131
199
  bodyOpt.form = body;
@@ -139,7 +207,7 @@ class ApiClient {
139
207
  // authenticated cookies. Disposed per call so no request context lingers and hangs the process.
140
208
  const ctx = await test_1.request.newContext({
141
209
  extraHTTPHeaders: headers,
142
- timeout: conf.timeout_ms ?? 15000,
210
+ timeout: req.timeout ?? conf.timeout_ms ?? 15000, // per-endpoint override → datasource → 15s
143
211
  ...(opts.storageState ? { storageState: opts.storageState } : {}),
144
212
  });
145
213
  try {
@@ -177,6 +245,66 @@ class ApiClient {
177
245
  statuses: responses.map((r) => r.status),
178
246
  };
179
247
  }
248
+ /**
249
+ * Validate a response body against a named JSON Schema from `qa/api/schemas.yaml` (populated by
250
+ * `sungen api import` from the OpenAPI `components.schemas`). Backs `expect {{name.body}} matches
251
+ * schema [Ref]` — a full-contract check beyond individual field asserts. Returns `{ ok, errors }`;
252
+ * the generated assertion feeds `errors` into the failure message. Uses Ajv (a QA-project dep).
253
+ */
254
+ assertSchema(value, schemaName) {
255
+ return assertSchemaImpl(value, schemaName);
256
+ }
257
+ }
258
+ // ── Response-schema validation (Ajv) ─────────────────────────────────────────────────────────────
259
+ // Schemas live in qa/api/schemas.yaml (name → JSON Schema, incl. #/components/schemas/* $refs).
260
+ // Loaded + compiled lazily so a project that never asserts a schema needs no Ajv resolution.
261
+ let _apiSchemas;
262
+ function loadApiSchemas() {
263
+ if (_apiSchemas !== undefined)
264
+ return _apiSchemas || {};
265
+ const file = [path.join(process.cwd(), 'qa', 'api', 'schemas.yaml'), path.join(process.cwd(), 'schemas.yaml')].find((f) => fs.existsSync(f));
266
+ if (!file) {
267
+ _apiSchemas = null;
268
+ return {};
269
+ }
270
+ const { parse } = require('yaml');
271
+ _apiSchemas = parse(fs.readFileSync(file, 'utf8')) || {};
272
+ return _apiSchemas || {};
273
+ }
274
+ let _ajv;
275
+ function getAjv() {
276
+ if (_ajv)
277
+ return _ajv;
278
+ const Ajv = require('ajv');
279
+ _ajv = new Ajv({ allErrors: true, strict: false });
280
+ try {
281
+ require('ajv-formats')(_ajv);
282
+ }
283
+ catch { /* formats optional */ }
284
+ // Register every named schema under its component ref so inter-schema $refs resolve.
285
+ for (const [name, schema] of Object.entries(loadApiSchemas())) {
286
+ try {
287
+ _ajv.addSchema(schema, `#/components/schemas/${name}`);
288
+ }
289
+ catch { /* dup/invalid → skip */ }
290
+ }
291
+ return _ajv;
292
+ }
293
+ function assertSchemaImpl(value, schemaName) {
294
+ const schema = loadApiSchemas()[schemaName];
295
+ if (!schema)
296
+ return { ok: false, errors: `schema "${schemaName}" not found in qa/api/schemas.yaml` };
297
+ let validate;
298
+ try {
299
+ const ajv = getAjv();
300
+ validate = ajv.getSchema(`#/components/schemas/${schemaName}`) || ajv.compile(schema);
301
+ }
302
+ catch (e) {
303
+ return { ok: false, errors: `schema "${schemaName}" failed to compile: ${e?.message || e}` };
304
+ }
305
+ const ok = validate(value) === true;
306
+ const errors = ok ? '' : (validate.errors || []).map((e) => `${e.instancePath || '(root)'} ${e.message}`).join('; ') || 'did not match schema';
307
+ return { ok, errors };
180
308
  }
181
309
  exports.api = new ApiClient();
182
310
  //# sourceMappingURL=specs-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"specs-api.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,gCAGC;AA5DD,oBAAoB;AACpB;;;;;;;;;;GAUG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAmE;AAWnE,SAAS,SAAS;IAChB,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,WAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;QAC1E,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5C,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1D,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBACrE,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS;oBAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YACjG,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,UAAU;IACjB,SAAS,EAAE,CAAC;IACZ,MAAM,IAAI,GAAG,CAAC,IAAI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;QACrB,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,wBAAwB,UAAU,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxF,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,UAAU,wBAAwB,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC;IAC/F,CAAC;IACD,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACpC,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,YAAY,IAAI,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC;IACpJ,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;AACxB,CAAC;AAEY,QAAA,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC"}
@@ -48,6 +48,37 @@ function loadConfig(): Record<string, ApiDataSource> {
48
48
  function substitute(text: string, params: Record<string, any>): string {
49
49
  return text.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => encodeURIComponent(String(params[p] ?? '')));
50
50
  }
51
+ /** Bind `:param` tokens WITHOUT URL-encoding — for headers, body-file paths, and multipart file paths. */
52
+ function substituteRaw(text: string, params: Record<string, any>): string {
53
+ return text.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
54
+ }
55
+ /** Delete any case-insensitive variant of a header (HTTP header names are case-insensitive, but a
56
+ * plain object keys on exact case — so a datasource `Content-Type` and our `content-type` would
57
+ * both be sent). Call before setting, or to let Playwright own the header (multipart boundary). */
58
+ function deleteHeader(headers: Record<string, string>, name: string): void {
59
+ const lower = name.toLowerCase();
60
+ for (const k of Object.keys(headers)) if (k.toLowerCase() === lower) delete headers[k];
61
+ }
62
+
63
+ /** A multipart file field embedded by the compiler (string = shorthand for { path }). */
64
+ type FileSpec = string | { path: string; mimeType?: string; filename?: string; name?: string };
65
+
66
+ const MIME: Record<string, string> = {
67
+ png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg', gif: 'image/gif', webp: 'image/webp',
68
+ svg: 'image/svg+xml', pdf: 'application/pdf', csv: 'text/csv', txt: 'text/plain',
69
+ json: 'application/json', xml: 'application/xml', zip: 'application/zip', mp4: 'video/mp4',
70
+ };
71
+ export function inferMime(name: string): string {
72
+ return MIME[(name.split('.').pop() || '').toLowerCase()] || 'application/octet-stream';
73
+ }
74
+ /** Resolve a fixture path: cwd-relative/absolute first, else qa/fixtures/<path>. */
75
+ export function resolveFixture(p: string, label: string): string {
76
+ const direct = path.isAbsolute(p) ? p : path.join(process.cwd(), p);
77
+ if (fs.existsSync(direct)) return direct;
78
+ const inFixtures = path.join(process.cwd(), 'qa', 'fixtures', p);
79
+ if (fs.existsSync(inFixtures)) return inFixtures;
80
+ throw new Error(`API Driver: ${label} — fixture "${p}" not found (looked in ${direct} and qa/fixtures/${p}).`);
81
+ }
51
82
 
52
83
  /**
53
84
  * Join a datasource base URL with a catalog path. Concatenate rather than rely on Playwright's
@@ -82,7 +113,7 @@ class ApiClient {
82
113
  */
83
114
  async call(
84
115
  label: string,
85
- req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; headers?: Record<string, string>; datasource?: string },
116
+ req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; files?: Record<string, FileSpec>; bodyFile?: FileSpec; headers?: Record<string, string>; timeout?: number; datasource?: string },
86
117
  params: Record<string, any> = {},
87
118
  opts: { storageState?: string } = {},
88
119
  ): Promise<{ status: number; ok: boolean; body: any; headers: Record<string, string> }> {
@@ -94,7 +125,7 @@ class ApiClient {
94
125
  const headers: Record<string, string> = { ...(conf.headers || {}) };
95
126
  // catalog headers; :param tokens bind at runtime — raw (no URL-encoding, unlike the path)
96
127
  for (const [k, v] of Object.entries(req.headers || {}))
97
- headers[k] = String(v).replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
128
+ headers[k] = substituteRaw(String(v), params);
98
129
  // Body: substitute `:param` into the body template (object values), then encode per `encoding`.
99
130
  let body: any;
100
131
  if (req.body !== undefined && req.body !== null) {
@@ -102,8 +133,39 @@ class ApiClient {
102
133
  }
103
134
  // Map the wire format to the right Playwright option (#345): json → data (application/json,
104
135
  // default), form → form (application/x-www-form-urlencoded), multipart → multipart (form-data).
136
+ // A `files` block is a real upload: read each fixture into a { name, mimeType, buffer } part and
137
+ // send multipart, with any `body` values riding along as text fields.
105
138
  const bodyOpt: Record<string, unknown> = {};
106
- if (body !== undefined) {
139
+ if (req.bodyFile) {
140
+ // Raw-binary body: the whole request body is the fixture's bytes. Content-Type comes from the
141
+ // spec's mimeType (default application/octet-stream) — this is what octet-stream upload
142
+ // endpoints expect (a multipart body would be rejected 415).
143
+ const spec = typeof req.bodyFile === 'string' ? { path: req.bodyFile } : req.bodyFile;
144
+ const fpath = substituteRaw(String(spec.path), params);
145
+ if (fpath) {
146
+ const resolved = resolveFixture(fpath, label);
147
+ bodyOpt.data = fs.readFileSync(resolved);
148
+ // Own the Content-Type: drop any datasource default (case-insensitive) so we don't send both.
149
+ deleteHeader(headers, 'content-type');
150
+ headers['content-type'] = spec.mimeType ?? 'application/octet-stream';
151
+ }
152
+ } else if (req.files && Object.keys(req.files).length) {
153
+ const mp: Record<string, any> = {};
154
+ if (body && typeof body === 'object')
155
+ for (const [k, v] of Object.entries(body as Record<string, unknown>)) mp[k] = typeof v === 'string' ? v : JSON.stringify(v);
156
+ for (const [field, raw] of Object.entries(req.files)) {
157
+ const spec = typeof raw === 'string' ? { path: raw } : raw;
158
+ const fpath = substituteRaw(String(spec.path), params);
159
+ if (!fpath) continue; // empty param → omit the part (a missing-file / wrong-type error row)
160
+ const resolved = resolveFixture(fpath, label);
161
+ const filename = spec.filename ?? path.basename(resolved);
162
+ mp[spec.name ?? field] = { name: filename, mimeType: spec.mimeType ?? inferMime(filename), buffer: fs.readFileSync(resolved) };
163
+ }
164
+ // Playwright generates the multipart/form-data Content-Type (with boundary); drop any datasource
165
+ // default Content-Type so it doesn't conflict with / duplicate the generated one.
166
+ deleteHeader(headers, 'content-type');
167
+ bodyOpt.multipart = mp;
168
+ } else if (body !== undefined) {
107
169
  const enc = req.encoding ?? 'json';
108
170
  if (enc === 'form') bodyOpt.form = body;
109
171
  else if (enc === 'multipart') bodyOpt.multipart = body;
@@ -115,7 +177,7 @@ class ApiClient {
115
177
  // authenticated cookies. Disposed per call so no request context lingers and hangs the process.
116
178
  const ctx: APIRequestContext = await request.newContext({
117
179
  extraHTTPHeaders: headers,
118
- timeout: conf.timeout_ms ?? 15000,
180
+ timeout: req.timeout ?? conf.timeout_ms ?? 15000, // per-endpoint override → datasource → 15s
119
181
  ...(opts.storageState ? { storageState: opts.storageState } : {}),
120
182
  });
121
183
  try {
@@ -139,7 +201,7 @@ class ApiClient {
139
201
  */
140
202
  async callN(
141
203
  label: string,
142
- req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; headers?: Record<string, string>; datasource?: string },
204
+ req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; files?: Record<string, FileSpec>; bodyFile?: FileSpec; headers?: Record<string, string>; timeout?: number; datasource?: string },
143
205
  params: Record<string, any> = {},
144
206
  n = 1,
145
207
  opts: { storageState?: string } = {},
@@ -160,6 +222,57 @@ class ApiClient {
160
222
  statuses: responses.map((r) => r.status),
161
223
  };
162
224
  }
225
+
226
+ /**
227
+ * Validate a response body against a named JSON Schema from `qa/api/schemas.yaml` (populated by
228
+ * `sungen api import` from the OpenAPI `components.schemas`). Backs `expect {{name.body}} matches
229
+ * schema [Ref]` — a full-contract check beyond individual field asserts. Returns `{ ok, errors }`;
230
+ * the generated assertion feeds `errors` into the failure message. Uses Ajv (a QA-project dep).
231
+ */
232
+ assertSchema(value: unknown, schemaName: string): { ok: boolean; errors: string } {
233
+ return assertSchemaImpl(value, schemaName);
234
+ }
235
+ }
236
+
237
+ // ── Response-schema validation (Ajv) ─────────────────────────────────────────────────────────────
238
+ // Schemas live in qa/api/schemas.yaml (name → JSON Schema, incl. #/components/schemas/* $refs).
239
+ // Loaded + compiled lazily so a project that never asserts a schema needs no Ajv resolution.
240
+ let _apiSchemas: Record<string, any> | null | undefined;
241
+ function loadApiSchemas(): Record<string, any> {
242
+ if (_apiSchemas !== undefined) return _apiSchemas || {};
243
+ const file = [path.join(process.cwd(), 'qa', 'api', 'schemas.yaml'), path.join(process.cwd(), 'schemas.yaml')].find((f) => fs.existsSync(f));
244
+ if (!file) { _apiSchemas = null; return {}; }
245
+ const { parse } = require('yaml');
246
+ _apiSchemas = (parse(fs.readFileSync(file, 'utf8')) as Record<string, any>) || {};
247
+ return _apiSchemas || {};
248
+ }
249
+
250
+ let _ajv: any;
251
+ function getAjv(): any {
252
+ if (_ajv) return _ajv;
253
+ const Ajv = require('ajv');
254
+ _ajv = new Ajv({ allErrors: true, strict: false });
255
+ try { require('ajv-formats')(_ajv); } catch { /* formats optional */ }
256
+ // Register every named schema under its component ref so inter-schema $refs resolve.
257
+ for (const [name, schema] of Object.entries(loadApiSchemas())) {
258
+ try { _ajv.addSchema(schema, `#/components/schemas/${name}`); } catch { /* dup/invalid → skip */ }
259
+ }
260
+ return _ajv;
261
+ }
262
+
263
+ function assertSchemaImpl(value: unknown, schemaName: string): { ok: boolean; errors: string } {
264
+ const schema = loadApiSchemas()[schemaName];
265
+ if (!schema) return { ok: false, errors: `schema "${schemaName}" not found in qa/api/schemas.yaml` };
266
+ let validate: any;
267
+ try {
268
+ const ajv = getAjv();
269
+ validate = ajv.getSchema(`#/components/schemas/${schemaName}`) || ajv.compile(schema);
270
+ } catch (e: any) {
271
+ return { ok: false, errors: `schema "${schemaName}" failed to compile: ${e?.message || e}` };
272
+ }
273
+ const ok = validate(value) === true;
274
+ const errors = ok ? '' : (validate.errors || []).map((e: any) => `${e.instancePath || '(root)'} ${e.message}`).join('; ') || 'did not match schema';
275
+ return { ok, errors };
163
276
  }
164
277
 
165
278
  export const api = new ApiClient();
@@ -48,7 +48,26 @@ export class TestDataLoader {
48
48
  if (value === undefined || value === null) {
49
49
  throw new Error(`Test data key not found: ${key}`);
50
50
  }
51
- return String(value);
51
+ return this.interpolate(String(value));
52
+ }
53
+
54
+ /**
55
+ * Substitute embedded `{{ref}}` cross-references inside a resolved string value.
56
+ * Each ref is looked up via resolve() (flat key, @cases row column, or dotted path),
57
+ * so `expected_operator_id_label: 'ID : {{operator.id}}'` yields the real value at
58
+ * runtime — matching the delivery report's substituteTestDataVars. `$`-prefixed
59
+ * dynamic vars ({{$timestamp}} …) are already substituted at load time and never
60
+ * match `[\w.]+`, so they are left untouched. Resolution recurses (a referenced value
61
+ * may itself hold refs) up to a depth cap that guards against reference cycles; an
62
+ * unknown or empty ref is left as the literal `{{ref}}` — never blanked.
63
+ */
64
+ private interpolate(value: string, depth: number = 0): string {
65
+ if (depth > 10 || value.indexOf('{{') === -1) return value;
66
+ return value.replace(/\{\{\s*([\w.]+)\s*\}\}/g, (match, ref: string) => {
67
+ const resolved = this.resolve(ref);
68
+ if (resolved === undefined || resolved === null || resolved === '') return match;
69
+ return this.interpolate(String(resolved), depth + 1);
70
+ });
52
71
  }
53
72
 
54
73
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sun-asterisk/sungen",
3
- "version": "3.2.5",
3
+ "version": "3.2.7",
4
4
  "description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -12,7 +12,7 @@
12
12
  "copy-templates": "mkdir -p dist/generators/test-generator/adapters/playwright/templates/steps && mkdir -p dist/generators/test-generator/templates && mkdir -p dist/orchestrator/templates && mkdir -p dist/dashboard/templates && cp -r src/generators/test-generator/adapters/playwright/templates/*.hbs dist/generators/test-generator/adapters/playwright/templates/ 2>/dev/null || true && cp -r src/generators/test-generator/adapters/playwright/templates/steps dist/generators/test-generator/adapters/playwright/templates/ && mkdir -p dist/generators/test-generator/adapters/appium/templates/steps && cp -r src/generators/test-generator/adapters/appium/templates/*.hbs dist/generators/test-generator/adapters/appium/templates/ 2>/dev/null || true && cp -r src/generators/test-generator/adapters/appium/templates/steps dist/generators/test-generator/adapters/appium/templates/ && cp src/generators/test-generator/templates/*.hbs dist/generators/test-generator/templates/ 2>/dev/null || true && cp -r src/orchestrator/templates/* dist/orchestrator/templates/ && cp src/dashboard/templates/index.html dist/dashboard/templates/index.html && mkdir -p dist/harness/catalog && cp src/harness/catalog/*.yaml dist/harness/catalog/",
13
13
  "build:dashboard": "cd ../../dashboard && npm install --silent && npm run build && cd - && cp ../../dashboard/dist/index.html src/dashboard/templates/index.html",
14
14
  "dev": "tsx src/cli/index.ts",
15
- "test": "tsx tests/golden/run.ts && tsx tests/audit/run.ts && tsx tests/ingest/run.ts && tsx tests/eval/run.ts && tsx tests/exporter/run.ts && tsx tests/exporter/feature-parser-category.run.ts && tsx tests/exporter/api-detail-sheet.run.ts && tsx tests/exporter/overview-sheet.run.ts && tsx tests/exporter/delivery-divider-tcid.run.ts && tsx tests/exporter/note-expected-actual.run.ts && tsx tests/exporter/test-data-vars.run.ts && tsx tests/exporter/mobile-app-id.run.ts && tsx tests/exporter/api-testcase-cells.run.ts && tsx tests/dashboard/api-flows-discovery.run.ts && tsx tests/codegen/verb-ref-masking.run.ts && tsx tests/api-runtime/base-path-url-join.run.ts && tsx tests/capabilities/run.ts && tsx tests/openapi/run.ts && tsx tests/packaging/run.ts && tsx tests/generate-hint/run.ts && tsx tests/template-assertion/run.ts && tsx tests/journey/run.ts && tsx tests/harness/serial-cascade.run.ts && tsx tests/ai-skills/cross-assistant-orphan.run.ts && tsx tests/init/codex-mcp-config.run.ts && tsx src/orchestrator/ai-skills/golden-skills.test.ts",
15
+ "test": "tsx tests/golden/run.ts && tsx tests/audit/run.ts && tsx tests/ingest/run.ts && tsx tests/eval/run.ts && tsx tests/exporter/run.ts && tsx tests/exporter/feature-parser-category.run.ts && tsx tests/exporter/api-detail-sheet.run.ts && tsx tests/exporter/overview-sheet.run.ts && tsx tests/exporter/delivery-divider-tcid.run.ts && tsx tests/exporter/note-expected-actual.run.ts && tsx tests/exporter/test-data-vars.run.ts && tsx tests/exporter/mobile-app-id.run.ts && tsx tests/exporter/api-testcase-cells.run.ts && tsx tests/exporter/delivery-cases-result.run.ts && tsx tests/exporter/precondition-auth-role.run.ts && tsx tests/exporter/report-builder-parity.run.ts && tsx tests/dashboard/api-flows-discovery.run.ts && tsx tests/dashboard/status-results-fallback.run.ts && tsx tests/codegen/verb-ref-masking.run.ts && tsx tests/api-runtime/base-path-url-join.run.ts && tsx tests/api-runtime/file-upload-multipart.run.ts && tsx tests/api-runtime/schema-assertion.run.ts && tsx tests/runtime/test-data-cross-ref.run.ts && tsx tests/capabilities/run.ts && tsx tests/openapi/run.ts && tsx tests/api-field-coverage/run.ts && tsx tests/packaging/run.ts && tsx tests/generate-hint/run.ts && tsx tests/template-assertion/run.ts && tsx tests/journey/run.ts && tsx tests/harness/serial-cascade.run.ts && tsx tests/ai-skills/cross-assistant-orphan.run.ts && tsx tests/init/codex-mcp-config.run.ts && tsx src/orchestrator/ai-skills/golden-skills.test.ts",
16
16
  "test:update": "tsx tests/golden/run.ts --update && tsx tests/audit/run.ts --update && tsx tests/ingest/run.ts --update",
17
17
  "prepublishOnly": "npm run build:dashboard && npm run build"
18
18
  },
@@ -33,7 +33,7 @@
33
33
  "node": ">=18.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@sungen/driver-ui": "3.2.5",
36
+ "@sungen/driver-ui": "3.2.7",
37
37
  "@anthropic-ai/sdk": "^0.71.0",
38
38
  "@babel/parser": "^7.28.5",
39
39
  "@babel/traverse": "^7.28.5",
@@ -12,7 +12,7 @@ import { parseFeatureMetadata } from '../../exporters/feature-parser';
12
12
  import { parseSpecFile } from '../../exporters/spec-parser';
13
13
  import { loadTestData } from '../../exporters/test-data-resolver';
14
14
  import { loadSelectorKeyMap } from '../../exporters/selector-key-resolver';
15
- import { loadPlaywrightReport } from '../../exporters/playwright-report-parser';
15
+ import { loadPlaywrightReport, resolveResultsPath as resolveResultsPathShared } from '../../exporters/playwright-report-parser';
16
16
  import { mergeFeatureAndSpec } from '../../exporters/scenario-merger';
17
17
  import {
18
18
  buildTestCaseRows,
@@ -21,6 +21,7 @@ import {
21
21
  writeCsv,
22
22
  } from '../../exporters/csv-exporter';
23
23
  import { renderXlsxMultiSheet, writeXlsx, buildApiDetailRows, addApiDetailSheet } from '../../exporters/xlsx-exporter';
24
+ import { loadApiCatalog } from '../../exporters/api-catalog-loader';
24
25
  import { resolvePlatformAppId } from '../../exporters/mobile-app-id';
25
26
  import { EnvironmentInfo, PreflightCheck, ScreenSummary, TestCaseRow, ApiCatalogEntry } from '../../exporters/types';
26
27
 
@@ -136,35 +137,8 @@ function qaDir(cwd: string, target: DeliveryTarget): string {
136
137
  return path.join(cwd, 'qa', qaParent(target.kind), target.screen);
137
138
  }
138
139
 
139
- /**
140
- * Load the apis.yaml catalog for an api-kind unit, merging the shared catalog under
141
- * the unit catalog. The runtime resolves an endpoint unit-scope-first then falls back
142
- * to the shared catalog (driver-api api-catalog.ts), so an endpoint defined only in
143
- * `qa/api/apis.yaml` still runs — we must load it too, or its request block would come
144
- * back empty (the very bug this feature fixes). Unit wins on a name collision.
145
- * Returns an empty object when neither file is present (graceful degradation).
146
- */
147
- function loadApiCatalog(cwd: string, target: DeliveryTarget): Record<string, ApiCatalogEntry> {
148
- if (target.kind !== 'api') return {};
149
- const shared = readApiCatalogFile(path.join(cwd, 'qa', 'api', 'apis.yaml'));
150
- const unit = readApiCatalogFile(path.join(cwd, 'qa', 'api', target.screen, 'api', 'apis.yaml'));
151
- return { ...shared, ...unit };
152
- }
153
-
154
- /** Parse one apis.yaml file into an endpoint map, unwrapping the optional `apis:` wrapper. */
155
- function readApiCatalogFile(catalogPath: string): Record<string, ApiCatalogEntry> {
156
- if (!fs.existsSync(catalogPath)) return {};
157
- try {
158
- const parsed = parseYaml(fs.readFileSync(catalogPath, 'utf-8')) as Record<string, unknown> | null;
159
- if (parsed && typeof parsed === 'object') {
160
- // The runtime loader accepts both a flat map and an `apis:` wrapper — unwrap it
161
- // here too so both loaders read the same file identically.
162
- const root = parsed.apis && typeof parsed.apis === 'object' ? parsed.apis : parsed;
163
- return root as Record<string, ApiCatalogEntry>;
164
- }
165
- } catch { /* malformed yaml — skip */ }
166
- return {};
167
- }
140
+ // apis.yaml catalog loading moved to ../../exporters/api-catalog-loader so the
141
+ // dashboard snapshot builder loads the identical contract (shared + unit merge).
168
142
 
169
143
  function generatedDir(cwd: string, target: DeliveryTarget): string {
170
144
  const sub = target.kind === 'flow' ? path.join('flows', target.screen) : target.kind === 'api' ? path.join('api', target.screen) : target.screen;
@@ -188,17 +162,9 @@ function generatedDir(cwd: string, target: DeliveryTarget): string {
188
162
  * `SUNGEN_ENV` is set, so each locale run keeps its own results file.
189
163
  */
190
164
  function resolveResultsPath(cwd: string, target: DeliveryTarget): string | null {
191
- const genDir = generatedDir(cwd, target);
192
- const env = process.env.SUNGEN_ENV;
193
- const candidates: string[] = [];
194
- if (env) candidates.push(path.join(genDir, `${target.featureBaseName}-test-result.${env}.json`));
195
- candidates.push(path.join(genDir, `${target.featureBaseName}-test-result.json`));
196
- if (env) candidates.push(path.join(cwd, 'test-results', `results.${env}.json`));
197
- candidates.push(path.join(cwd, 'test-results', 'results.json'));
198
- for (const c of candidates) {
199
- if (fs.existsSync(c)) return c;
200
- }
201
- return null;
165
+ // Shared with the dashboard snapshot builder (same candidate order incl. the
166
+ // test-results/results.json fallback) so the two surfaces can't drift.
167
+ return resolveResultsPathShared(cwd, generatedDir(cwd, target), target.featureBaseName);
202
168
  }
203
169
 
204
170
  /**
@@ -477,7 +443,7 @@ async function exportTarget(
477
443
  const explicitEnv = process.env.SUNGEN_ENV;
478
444
 
479
445
  // For api-kind units, load the endpoint catalog so we can add the API detail sheet.
480
- const apiCatalog = loadApiCatalog(cwd, target);
446
+ const apiCatalog = loadApiCatalog(cwd, target.kind, target.screen);
481
447
  const hasApiCatalog = target.kind === 'api' && Object.keys(apiCatalog).length > 0;
482
448
 
483
449
  // Decide between single-locale and aggregated multi-locale flows.
@@ -19,12 +19,14 @@ import { parseFeatureMetadata } from '../exporters/feature-parser';
19
19
  import { parseSpecFile } from '../exporters/spec-parser';
20
20
  import { loadTestData } from '../exporters/test-data-resolver';
21
21
  import { loadSelectorKeyMap } from '../exporters/selector-key-resolver';
22
- import { loadPlaywrightReport } from '../exporters/playwright-report-parser';
22
+ import { loadPlaywrightReport, resolveResultsPath } from '../exporters/playwright-report-parser';
23
23
  import { mergeFeatureAndSpec } from '../exporters/scenario-merger';
24
24
  import { buildScreenSnapshot } from '../exporters/json-exporter';
25
+ import { loadApiCatalog } from '../exporters/api-catalog-loader';
26
+ import { buildApiDetailRows } from '../exporters/xlsx-exporter';
25
27
  import { resolvePlatformAppId } from '../exporters/mobile-app-id';
26
28
  import { getPackageVersion } from '../exporters/package-info';
27
- import { EnvironmentInfo } from '../exporters/types';
29
+ import { ApiCatalogEntry, EnvironmentInfo } from '../exporters/types';
28
30
  import {
29
31
  AggregateSummary,
30
32
  DashboardSnapshot,
@@ -126,9 +128,13 @@ function buildOneScreen(
126
128
  const specLink = fs.existsSync(specMdFile) ? path.relative(cwd, specMdFile) : undefined;
127
129
 
128
130
  const mobile = isMobileProject(cwd);
131
+ // api-kind units: load the endpoint catalog once per target — the same
132
+ // shared+unit merge delivery.ts uses — so Steps/Expected cells and the API
133
+ // detail sheet match the delivery CSV/XLSX exactly.
134
+ const apiCatalog = loadApiCatalog(cwd, target.kind, target.name);
129
135
  const features: FeatureSnapshot[] = [];
130
136
  for (const featureBaseName of featureBaseNames) {
131
- features.push(...buildOneFeature(cwd, target, featureBaseName, env, specLink, mobile));
137
+ features.push(...buildOneFeature(cwd, target, featureBaseName, env, specLink, mobile, apiCatalog));
132
138
  }
133
139
  if (features.length === 0) return null;
134
140
 
@@ -183,6 +189,7 @@ function buildOneFeature(
183
189
  env: EnvironmentInfo,
184
190
  specLink: string | undefined,
185
191
  mobile: boolean,
192
+ apiCatalog: Record<string, ApiCatalogEntry>,
186
193
  ): FeatureSnapshot[] {
187
194
  const base = qaDir(cwd, target);
188
195
  const genBase = generatedDir(cwd, target);
@@ -210,7 +217,7 @@ function buildOneFeature(
210
217
  // Discover locale variants by scanning <feature>-test-result*.json files.
211
218
  // Always includes base ('') as the first entry, even if its results file
212
219
  // is missing — UI still needs to render the feature.
213
- const variants = discoverLocaleVariants(genBase, featureBaseName);
220
+ const variants = discoverLocaleVariants(cwd, genBase, featureBaseName);
214
221
 
215
222
  // Build one per-variant ScreenSnapshot (test-data overlay + results + OS-precise
216
223
  // env column). Reused by both the web/i18n (locale-axis) and mobile (platform-axis) paths.
@@ -233,10 +240,21 @@ function buildOneFeature(
233
240
  env,
234
241
  featureBaseName,
235
242
  selectorKeyMap,
243
+ kind: target.kind,
244
+ apiCatalog,
236
245
  });
237
246
  };
238
247
  type Built = ReturnType<typeof buildVariant>;
239
248
 
249
+ // API detail sheet rows — the identical buildApiDetailRows call delivery.ts
250
+ // makes before addApiDetailSheet, precomputed so the (browser-side) XLSX
251
+ // export just passes them to the shared builder. Endpoint contract is
252
+ // locale-invariant → computed once per feature.
253
+ const apiDetailRows = target.kind === 'api' && Object.keys(apiCatalog).length > 0
254
+ ? buildApiDetailRows(apiCatalog, feature.scenarios)
255
+ : [];
256
+ const apiDetail = apiDetailRows.length > 0 ? apiDetailRows : undefined;
257
+
240
258
  // -- Mobile (platform axis): the per-OS runs (android / ios) are their own
241
259
  // FeatureSnapshot entries — one per OS, `platform` tagged — NOT locale tabs.
242
260
  // Locale overlays for a given OS (e.g. `android.ja`) nest inside that OS's
@@ -272,6 +290,7 @@ function buildOneFeature(
272
290
  platform: os,
273
291
  executedPlatforms,
274
292
  locales: localeSnaps.length >= 2 ? localeSnaps : undefined,
293
+ apiDetail,
275
294
  });
276
295
  }
277
296
  if (feats.length > 0) return feats;
@@ -318,6 +337,7 @@ function buildOneFeature(
318
337
  // Only expose `locales` array when 2+ variants exist — single-locale
319
338
  // features stay slimmer and UI can skip the locale tab UI entirely.
320
339
  locales: locales.length >= 2 ? locales : undefined,
340
+ apiDetail,
321
341
  }];
322
342
  }
323
343
 
@@ -342,15 +362,19 @@ interface FeatureLocaleVariant {
342
362
  * dashboard and the CSV/XLSX delivery agree on what locales exist for a
343
363
  * given feature.
344
364
  */
345
- function discoverLocaleVariants(genDir: string, featureBaseName: string): FeatureLocaleVariant[] {
365
+ function discoverLocaleVariants(cwd: string, genDir: string, featureBaseName: string): FeatureLocaleVariant[] {
346
366
  const prefix = `${featureBaseName}-test-result`;
347
367
  const variants: FeatureLocaleVariant[] = [];
348
368
 
349
- const basePath = path.join(genDir, `${prefix}.json`);
369
+ // Base variant resolves through the SHARED candidate chain (per-feature file
370
+ // first, then the global test-results/results.json playwright writes by
371
+ // default) — the same resolution delivery.ts uses. Without the fallback the
372
+ // dashboard showed every scenario Pending on projects that only have the
373
+ // global results file, while delivery correctly reported Passed.
350
374
  variants.push({
351
375
  locale: '',
352
376
  displayCode: DEFAULT_BASE_LOCALE.toUpperCase(),
353
- resultsPath: fs.existsSync(basePath) ? basePath : null,
377
+ resultsPath: resolveResultsPath(cwd, genDir, featureBaseName),
354
378
  });
355
379
 
356
380
  if (fs.existsSync(genDir)) {