@sun-asterisk/sungen 3.2.28 → 3.2.30

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 (486) hide show
  1. package/dist/capabilities/discover.d.ts +29 -0
  2. package/dist/capabilities/discover.d.ts.map +1 -1
  3. package/dist/capabilities/discover.js +144 -10
  4. package/dist/capabilities/discover.js.map +1 -1
  5. package/dist/capabilities/registry.d.ts +18 -0
  6. package/dist/capabilities/registry.d.ts.map +1 -1
  7. package/dist/capabilities/registry.js +25 -0
  8. package/dist/capabilities/registry.js.map +1 -1
  9. package/dist/cli/commands/audit.d.ts.map +1 -1
  10. package/dist/cli/commands/audit.js +9 -0
  11. package/dist/cli/commands/audit.js.map +1 -1
  12. package/dist/cli/commands/capability.js +1 -1
  13. package/dist/cli/commands/capability.js.map +1 -1
  14. package/dist/cli/commands/delivery.d.ts.map +1 -1
  15. package/dist/cli/commands/delivery.js +2 -1
  16. package/dist/cli/commands/delivery.js.map +1 -1
  17. package/dist/cli/commands/generate.d.ts.map +1 -1
  18. package/dist/cli/commands/generate.js +6 -2
  19. package/dist/cli/commands/generate.js.map +1 -1
  20. package/dist/cli/commands/inspect.js +1 -1
  21. package/dist/cli/commands/inspect.js.map +1 -1
  22. package/dist/cli/commands/results-merge.d.ts.map +1 -1
  23. package/dist/cli/commands/results-merge.js +9 -2
  24. package/dist/cli/commands/results-merge.js.map +1 -1
  25. package/dist/cli/commands/results-sanitize.d.ts +24 -0
  26. package/dist/cli/commands/results-sanitize.d.ts.map +1 -0
  27. package/dist/cli/commands/results-sanitize.js +126 -0
  28. package/dist/cli/commands/results-sanitize.js.map +1 -0
  29. package/dist/cli/commands/script-check.d.ts.map +1 -1
  30. package/dist/cli/commands/script-check.js +3 -1
  31. package/dist/cli/commands/script-check.js.map +1 -1
  32. package/dist/cli/commands/update.d.ts.map +1 -1
  33. package/dist/cli/commands/update.js +3 -0
  34. package/dist/cli/commands/update.js.map +1 -1
  35. package/dist/dashboard/templates/index.html +1 -1
  36. package/dist/exporters/api-testcase-formatter.d.ts +3 -6
  37. package/dist/exporters/api-testcase-formatter.d.ts.map +1 -1
  38. package/dist/exporters/api-testcase-formatter.js +7 -10
  39. package/dist/exporters/api-testcase-formatter.js.map +1 -1
  40. package/dist/exporters/feature-parser.d.ts +1 -1
  41. package/dist/exporters/feature-parser.js +1 -1
  42. package/dist/exporters/matrix/build.d.ts.map +1 -1
  43. package/dist/exporters/matrix/build.js +18 -3
  44. package/dist/exporters/matrix/build.js.map +1 -1
  45. package/dist/exporters/matrix/item-labels.d.ts +35 -0
  46. package/dist/exporters/matrix/item-labels.d.ts.map +1 -0
  47. package/dist/exporters/matrix/item-labels.js +90 -0
  48. package/dist/exporters/matrix/item-labels.js.map +1 -0
  49. package/dist/exporters/matrix/render-coverage-sheet.d.ts +14 -0
  50. package/dist/exporters/matrix/render-coverage-sheet.d.ts.map +1 -0
  51. package/dist/exporters/matrix/render-coverage-sheet.js +162 -0
  52. package/dist/exporters/matrix/render-coverage-sheet.js.map +1 -0
  53. package/dist/exporters/matrix/render-csv.d.ts.map +1 -1
  54. package/dist/exporters/matrix/render-csv.js +3 -1
  55. package/dist/exporters/matrix/render-csv.js.map +1 -1
  56. package/dist/exporters/matrix/render-overview-sheet.d.ts +20 -0
  57. package/dist/exporters/matrix/render-overview-sheet.d.ts.map +1 -0
  58. package/dist/exporters/matrix/render-overview-sheet.js +32 -0
  59. package/dist/exporters/matrix/render-overview-sheet.js.map +1 -0
  60. package/dist/exporters/matrix/render-testcase-sheet.d.ts +30 -0
  61. package/dist/exporters/matrix/render-testcase-sheet.d.ts.map +1 -0
  62. package/dist/exporters/matrix/render-testcase-sheet.js +156 -0
  63. package/dist/exporters/matrix/render-testcase-sheet.js.map +1 -0
  64. package/dist/exporters/matrix/render-xlsx.d.ts +41 -31
  65. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -1
  66. package/dist/exporters/matrix/render-xlsx.js +72 -425
  67. package/dist/exporters/matrix/render-xlsx.js.map +1 -1
  68. package/dist/exporters/matrix/result-totals.d.ts +23 -0
  69. package/dist/exporters/matrix/result-totals.d.ts.map +1 -0
  70. package/dist/exporters/matrix/result-totals.js +21 -0
  71. package/dist/exporters/matrix/result-totals.js.map +1 -0
  72. package/dist/exporters/matrix/testcase-summary-band.d.ts +30 -0
  73. package/dist/exporters/matrix/testcase-summary-band.d.ts.map +1 -0
  74. package/dist/exporters/matrix/testcase-summary-band.js +71 -0
  75. package/dist/exporters/matrix/testcase-summary-band.js.map +1 -0
  76. package/dist/exporters/matrix/wording.d.ts.map +1 -1
  77. package/dist/exporters/matrix/wording.js +13 -0
  78. package/dist/exporters/matrix/wording.js.map +1 -1
  79. package/dist/exporters/matrix/xlsx-cells.d.ts +38 -0
  80. package/dist/exporters/matrix/xlsx-cells.d.ts.map +1 -0
  81. package/dist/exporters/matrix/xlsx-cells.js +52 -0
  82. package/dist/exporters/matrix/xlsx-cells.js.map +1 -0
  83. package/dist/exporters/qa-env-secret-denylist.js +2 -2
  84. package/dist/exporters/qa-env-secret-denylist.js.map +1 -1
  85. package/dist/exporters/report-path-sanitizer.d.ts +38 -0
  86. package/dist/exporters/report-path-sanitizer.d.ts.map +1 -0
  87. package/dist/exporters/report-path-sanitizer.js +137 -0
  88. package/dist/exporters/report-path-sanitizer.js.map +1 -0
  89. package/dist/exporters/result-variants.d.ts.map +1 -1
  90. package/dist/exporters/result-variants.js +2 -1
  91. package/dist/exporters/result-variants.js.map +1 -1
  92. package/dist/exporters/sensitive-key.d.ts +31 -0
  93. package/dist/exporters/sensitive-key.d.ts.map +1 -0
  94. package/dist/exporters/sensitive-key.js +50 -0
  95. package/dist/exporters/sensitive-key.js.map +1 -0
  96. package/dist/exporters/test-data-resolver.d.ts +4 -1
  97. package/dist/exporters/test-data-resolver.d.ts.map +1 -1
  98. package/dist/exporters/test-data-resolver.js +12 -2
  99. package/dist/exporters/test-data-resolver.js.map +1 -1
  100. package/dist/exporters/xlsx-report-builder.d.ts +12 -1
  101. package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
  102. package/dist/exporters/xlsx-report-builder.js +10 -2
  103. package/dist/exporters/xlsx-report-builder.js.map +1 -1
  104. package/dist/generators/gherkin-parser/index.d.ts +10 -0
  105. package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
  106. package/dist/generators/gherkin-parser/index.js +20 -12
  107. package/dist/generators/gherkin-parser/index.js.map +1 -1
  108. package/dist/generators/gherkin-parser/parent-scope-clause.d.ts +54 -0
  109. package/dist/generators/gherkin-parser/parent-scope-clause.d.ts.map +1 -0
  110. package/dist/generators/gherkin-parser/parent-scope-clause.js +109 -0
  111. package/dist/generators/gherkin-parser/parent-scope-clause.js.map +1 -0
  112. package/dist/generators/test-generator/adapters/adapter-interface.d.ts +23 -18
  113. package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
  114. package/dist/generators/test-generator/adapters/appium/appium-adapter.d.ts +4 -19
  115. package/dist/generators/test-generator/adapters/appium/appium-adapter.d.ts.map +1 -1
  116. package/dist/generators/test-generator/adapters/appium/appium-adapter.js.map +1 -1
  117. package/dist/generators/test-generator/adapters/appium/os-support.d.ts +53 -0
  118. package/dist/generators/test-generator/adapters/appium/os-support.d.ts.map +1 -0
  119. package/dist/generators/test-generator/adapters/appium/os-support.js +200 -0
  120. package/dist/generators/test-generator/adapters/appium/os-support.js.map +1 -0
  121. package/dist/generators/test-generator/adapters/appium/templates/after-all.hbs +18 -0
  122. package/dist/generators/test-generator/adapters/appium/templates/after-each.hbs +18 -0
  123. package/dist/generators/test-generator/adapters/appium/templates/before-all.hbs +18 -0
  124. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/alert-fill-action.hbs +9 -2
  125. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/capture-variable.hbs +24 -1
  126. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/click-at-position-action.hbs +1 -0
  127. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/click-element-with-text.hbs +1 -1
  128. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/double-click-action.hbs +7 -0
  129. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/frame-enter-action.hbs +3 -6
  130. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/hover-action.hbs +6 -2
  131. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/hover-element-with-text.hbs +4 -3
  132. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/table-paginate-action.hbs +3 -0
  133. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/unknown-element-action.hbs +9 -0
  134. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/have-value-assertion.hbs +34 -1
  135. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +14 -6
  136. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/visible-assertion.hbs +1 -1
  137. package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/go-back-action.hbs +21 -0
  138. package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/long-press-action.hbs +4 -0
  139. package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/pinch-zoom-action.hbs +4 -0
  140. package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/set-geolocation-action.hbs +16 -0
  141. package/dist/generators/test-generator/adapters/appium/templates/steps/partials/locator.hbs +9 -1
  142. package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +62 -23
  143. package/dist/generators/test-generator/adapters/index.d.ts +1 -1
  144. package/dist/generators/test-generator/adapters/index.d.ts.map +1 -1
  145. package/dist/generators/test-generator/adapters/playwright/playwright-adapter.d.ts +4 -19
  146. package/dist/generators/test-generator/adapters/playwright/playwright-adapter.d.ts.map +1 -1
  147. package/dist/generators/test-generator/adapters/playwright/playwright-adapter.js.map +1 -1
  148. package/dist/generators/test-generator/adapters/playwright/templates/after-all.hbs +19 -1
  149. package/dist/generators/test-generator/adapters/playwright/templates/after-each.hbs +18 -0
  150. package/dist/generators/test-generator/adapters/playwright/templates/before-all.hbs +19 -1
  151. package/dist/generators/test-generator/adapters/playwright/templates/imports.hbs +3 -0
  152. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/check-action.hbs +6 -1
  153. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/click-at-position-action.hbs +23 -0
  154. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/expand-action.hbs +8 -8
  155. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/fill-editor-action.hbs +7 -2
  156. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row-nth.hbs +7 -2
  157. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +7 -2
  158. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-paginate-action.hbs +5 -0
  159. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/uncheck-action.hbs +3 -1
  160. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/unknown-element-action.hbs +1 -1
  161. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/wait-for-page.hbs +18 -1
  162. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +32 -4
  163. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-element.hbs +5 -2
  164. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/checked-assertion.hbs +5 -1
  165. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/column-cell-assertion.hbs +13 -2
  166. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/contain-text-assertion.hbs +1 -1
  167. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-role-variable-assertion.hbs +2 -2
  168. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-variable-assertion.hbs +1 -1
  169. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/have-text-assertion.hbs +1 -1
  170. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-role-variable-assertion.hbs +2 -2
  171. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-variable-assertion.hbs +1 -1
  172. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/not-checked-assertion.hbs +2 -1
  173. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +21 -3
  174. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +20 -2
  175. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-empty.hbs +4 -1
  176. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-match-data.hbs +4 -1
  177. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-count.hbs +4 -1
  178. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-exists.hbs +12 -4
  179. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-not-exists.hbs +14 -2
  180. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +3 -3
  181. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-value-assertion.hbs +1 -1
  182. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-variable-assertion.hbs +1 -1
  183. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/checked-opts.hbs +8 -0
  184. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +8 -8
  185. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-nth.hbs +1 -1
  186. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/id.hbs +1 -1
  187. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/testid.hbs +1 -1
  188. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +8 -8
  189. package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +10 -8
  190. package/dist/generators/test-generator/code-generator.d.ts +37 -0
  191. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  192. package/dist/generators/test-generator/code-generator.js +165 -40
  193. package/dist/generators/test-generator/code-generator.js.map +1 -1
  194. package/dist/generators/test-generator/diagnostics.d.ts +116 -6
  195. package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
  196. package/dist/generators/test-generator/diagnostics.js +115 -5
  197. package/dist/generators/test-generator/diagnostics.js.map +1 -1
  198. package/dist/generators/test-generator/patterns/index.d.ts +57 -11
  199. package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
  200. package/dist/generators/test-generator/patterns/index.js +163 -21
  201. package/dist/generators/test-generator/patterns/index.js.map +1 -1
  202. package/dist/generators/test-generator/patterns/types.d.ts +8 -0
  203. package/dist/generators/test-generator/patterns/types.d.ts.map +1 -1
  204. package/dist/generators/test-generator/patterns/with-parent-scope.d.ts +18 -0
  205. package/dist/generators/test-generator/patterns/with-parent-scope.d.ts.map +1 -0
  206. package/dist/generators/test-generator/patterns/with-parent-scope.js +40 -0
  207. package/dist/generators/test-generator/patterns/with-parent-scope.js.map +1 -0
  208. package/dist/generators/test-generator/step-mapper.d.ts +103 -10
  209. package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
  210. package/dist/generators/test-generator/step-mapper.js +266 -45
  211. package/dist/generators/test-generator/step-mapper.js.map +1 -1
  212. package/dist/generators/test-generator/template-engine.d.ts +4 -19
  213. package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
  214. package/dist/generators/test-generator/template-engine.js +17 -12
  215. package/dist/generators/test-generator/template-engine.js.map +1 -1
  216. package/dist/generators/test-generator/utils/data-resolver.d.ts +7 -0
  217. package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
  218. package/dist/generators/test-generator/utils/data-resolver.js +19 -2
  219. package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
  220. package/dist/generators/test-generator/utils/dialog-scope-identity.d.ts +41 -0
  221. package/dist/generators/test-generator/utils/dialog-scope-identity.d.ts.map +1 -0
  222. package/dist/generators/test-generator/utils/dialog-scope-identity.js +61 -0
  223. package/dist/generators/test-generator/utils/dialog-scope-identity.js.map +1 -0
  224. package/dist/generators/test-generator/utils/escape-js-string.d.ts +17 -0
  225. package/dist/generators/test-generator/utils/escape-js-string.d.ts.map +1 -0
  226. package/dist/generators/test-generator/utils/escape-js-string.js +29 -0
  227. package/dist/generators/test-generator/utils/escape-js-string.js.map +1 -0
  228. package/dist/generators/test-generator/utils/nearest-match.d.ts +24 -0
  229. package/dist/generators/test-generator/utils/nearest-match.d.ts.map +1 -0
  230. package/dist/generators/test-generator/utils/nearest-match.js +56 -0
  231. package/dist/generators/test-generator/utils/nearest-match.js.map +1 -0
  232. package/dist/generators/test-generator/utils/selector-entry-fields.d.ts +58 -0
  233. package/dist/generators/test-generator/utils/selector-entry-fields.d.ts.map +1 -0
  234. package/dist/generators/test-generator/utils/selector-entry-fields.js +119 -0
  235. package/dist/generators/test-generator/utils/selector-entry-fields.js.map +1 -0
  236. package/dist/generators/test-generator/utils/selector-entry-walk.d.ts +25 -0
  237. package/dist/generators/test-generator/utils/selector-entry-walk.d.ts.map +1 -0
  238. package/dist/generators/test-generator/utils/selector-entry-walk.js +54 -0
  239. package/dist/generators/test-generator/utils/selector-entry-walk.js.map +1 -0
  240. package/dist/generators/test-generator/utils/selector-nth-validation.d.ts +59 -0
  241. package/dist/generators/test-generator/utils/selector-nth-validation.d.ts.map +1 -0
  242. package/dist/generators/test-generator/utils/selector-nth-validation.js +91 -0
  243. package/dist/generators/test-generator/utils/selector-nth-validation.js.map +1 -0
  244. package/dist/generators/test-generator/utils/selector-resolver.d.ts +53 -2
  245. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  246. package/dist/generators/test-generator/utils/selector-resolver.js +273 -27
  247. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  248. package/dist/generators/test-generator/utils/selector-type-validation.d.ts +51 -0
  249. package/dist/generators/test-generator/utils/selector-type-validation.d.ts.map +1 -0
  250. package/dist/generators/test-generator/utils/selector-type-validation.js +77 -0
  251. package/dist/generators/test-generator/utils/selector-type-validation.js.map +1 -0
  252. package/dist/harness/audit.d.ts +3 -1
  253. package/dist/harness/audit.d.ts.map +1 -1
  254. package/dist/harness/audit.js +51 -28
  255. package/dist/harness/audit.js.map +1 -1
  256. package/dist/harness/capability-plan.d.ts +4 -0
  257. package/dist/harness/capability-plan.d.ts.map +1 -1
  258. package/dist/harness/capability-plan.js +32 -2
  259. package/dist/harness/capability-plan.js.map +1 -1
  260. package/dist/harness/catalog/drivers.yaml +1 -1
  261. package/dist/harness/catalog/universal-viewpoints.yaml +145 -0
  262. package/dist/harness/data-driven-lint.d.ts.map +1 -1
  263. package/dist/harness/data-driven-lint.js +217 -33
  264. package/dist/harness/data-driven-lint.js.map +1 -1
  265. package/dist/harness/parse.d.ts +6 -0
  266. package/dist/harness/parse.d.ts.map +1 -1
  267. package/dist/harness/parse.js +1 -1
  268. package/dist/harness/parse.js.map +1 -1
  269. package/dist/harness/repair.d.ts.map +1 -1
  270. package/dist/harness/repair.js +8 -1
  271. package/dist/harness/repair.js.map +1 -1
  272. package/dist/harness/script-check.d.ts +2 -2
  273. package/dist/harness/script-check.d.ts.map +1 -1
  274. package/dist/harness/script-check.js +186 -25
  275. package/dist/harness/script-check.js.map +1 -1
  276. package/dist/harness/sensors.d.ts +48 -0
  277. package/dist/harness/sensors.d.ts.map +1 -1
  278. package/dist/harness/sensors.js +26 -1
  279. package/dist/harness/sensors.js.map +1 -1
  280. package/dist/harness/viewpoint-ledger.d.ts +10 -0
  281. package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
  282. package/dist/harness/viewpoint-ledger.js +23 -2
  283. package/dist/harness/viewpoint-ledger.js.map +1 -1
  284. package/dist/index.d.ts +2 -0
  285. package/dist/index.d.ts.map +1 -1
  286. package/dist/index.js +10 -1
  287. package/dist/index.js.map +1 -1
  288. package/dist/orchestrator/project-initializer.d.ts +6 -0
  289. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  290. package/dist/orchestrator/project-initializer.js +16 -0
  291. package/dist/orchestrator/project-initializer.js.map +1 -1
  292. package/dist/orchestrator/report-sanitize-reporter-install.d.ts +24 -0
  293. package/dist/orchestrator/report-sanitize-reporter-install.d.ts.map +1 -0
  294. package/dist/orchestrator/report-sanitize-reporter-install.js +161 -0
  295. package/dist/orchestrator/report-sanitize-reporter-install.js.map +1 -0
  296. package/dist/orchestrator/templates/ai-src/commands/delivery.md +4 -3
  297. package/dist/orchestrator/templates/ai-src/commands/run-test.md +9 -1
  298. package/dist/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +10 -0
  299. package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -5
  300. package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +62 -3
  301. package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +126 -11
  302. package/dist/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md +16 -1
  303. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +12 -0
  304. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +19 -5
  305. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +88 -2
  306. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +62 -5
  307. package/dist/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md +13 -0
  308. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +59 -10
  309. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-f-mobile-native.md +419 -0
  310. package/dist/orchestrator/templates/playwright.config.ts +7 -0
  311. package/dist/orchestrator/templates/readme.md +1 -1
  312. package/dist/orchestrator/templates/specs-checked-state.d.ts +83 -0
  313. package/dist/orchestrator/templates/specs-checked-state.d.ts.map +1 -0
  314. package/dist/orchestrator/templates/specs-checked-state.js +261 -0
  315. package/dist/orchestrator/templates/specs-checked-state.js.map +1 -0
  316. package/dist/orchestrator/templates/specs-checked-state.ts +324 -0
  317. package/dist/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
  318. package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.d.ts +36 -0
  319. package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.d.ts.map +1 -0
  320. package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.js +155 -0
  321. package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.js.map +1 -0
  322. package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.ts +142 -0
  323. package/dist/orchestrator/templates/specs-url-assert.d.ts +50 -25
  324. package/dist/orchestrator/templates/specs-url-assert.d.ts.map +1 -1
  325. package/dist/orchestrator/templates/specs-url-assert.js +65 -24
  326. package/dist/orchestrator/templates/specs-url-assert.js.map +1 -1
  327. package/dist/orchestrator/templates/specs-url-assert.ts +101 -28
  328. package/dist/orchestrator/templates/wdio.conf.ts +105 -1
  329. package/dist/utils/selector-types.d.ts +43 -1
  330. package/dist/utils/selector-types.d.ts.map +1 -1
  331. package/dist/utils/selector-types.js +51 -7
  332. package/dist/utils/selector-types.js.map +1 -1
  333. package/package.json +3 -3
  334. package/src/capabilities/discover.ts +146 -10
  335. package/src/capabilities/registry.ts +30 -0
  336. package/src/cli/commands/audit.ts +9 -0
  337. package/src/cli/commands/capability.ts +1 -1
  338. package/src/cli/commands/delivery.ts +2 -1
  339. package/src/cli/commands/generate.ts +5 -2
  340. package/src/cli/commands/inspect.ts +1 -1
  341. package/src/cli/commands/results-merge.ts +9 -2
  342. package/src/cli/commands/results-sanitize.ts +98 -0
  343. package/src/cli/commands/script-check.ts +3 -1
  344. package/src/cli/commands/update.ts +3 -0
  345. package/src/dashboard/templates/index.html +1 -1
  346. package/src/exporters/api-testcase-formatter.ts +5 -7
  347. package/src/exporters/feature-parser.ts +1 -1
  348. package/src/exporters/matrix/build.ts +17 -3
  349. package/src/exporters/matrix/item-labels.ts +78 -0
  350. package/src/exporters/matrix/render-coverage-sheet.ts +170 -0
  351. package/src/exporters/matrix/render-csv.ts +3 -1
  352. package/src/exporters/matrix/render-overview-sheet.ts +51 -0
  353. package/src/exporters/matrix/render-testcase-sheet.ts +178 -0
  354. package/src/exporters/matrix/render-xlsx.ts +67 -448
  355. package/src/exporters/matrix/result-totals.ts +37 -0
  356. package/src/exporters/matrix/testcase-summary-band.ts +74 -0
  357. package/src/exporters/matrix/wording.ts +13 -0
  358. package/src/exporters/matrix/xlsx-cells.ts +56 -0
  359. package/src/exporters/qa-env-secret-denylist.ts +1 -1
  360. package/src/exporters/report-path-sanitizer.ts +144 -0
  361. package/src/exporters/result-variants.ts +2 -1
  362. package/src/exporters/sensitive-key.ts +48 -0
  363. package/src/exporters/test-data-resolver.ts +12 -2
  364. package/src/exporters/xlsx-report-builder.ts +16 -2
  365. package/src/generators/gherkin-parser/index.ts +22 -11
  366. package/src/generators/gherkin-parser/parent-scope-clause.ts +130 -0
  367. package/src/generators/test-generator/adapters/adapter-interface.ts +25 -3
  368. package/src/generators/test-generator/adapters/appium/appium-adapter.ts +4 -4
  369. package/src/generators/test-generator/adapters/appium/os-support.ts +176 -0
  370. package/src/generators/test-generator/adapters/appium/templates/after-all.hbs +18 -0
  371. package/src/generators/test-generator/adapters/appium/templates/after-each.hbs +18 -0
  372. package/src/generators/test-generator/adapters/appium/templates/before-all.hbs +18 -0
  373. package/src/generators/test-generator/adapters/appium/templates/steps/actions/alert-fill-action.hbs +9 -2
  374. package/src/generators/test-generator/adapters/appium/templates/steps/actions/capture-variable.hbs +24 -1
  375. package/src/generators/test-generator/adapters/appium/templates/steps/actions/click-at-position-action.hbs +1 -0
  376. package/src/generators/test-generator/adapters/appium/templates/steps/actions/click-element-with-text.hbs +1 -1
  377. package/src/generators/test-generator/adapters/appium/templates/steps/actions/double-click-action.hbs +7 -0
  378. package/src/generators/test-generator/adapters/appium/templates/steps/actions/frame-enter-action.hbs +3 -6
  379. package/src/generators/test-generator/adapters/appium/templates/steps/actions/hover-action.hbs +6 -2
  380. package/src/generators/test-generator/adapters/appium/templates/steps/actions/hover-element-with-text.hbs +4 -3
  381. package/src/generators/test-generator/adapters/appium/templates/steps/actions/table-paginate-action.hbs +3 -0
  382. package/src/generators/test-generator/adapters/appium/templates/steps/actions/unknown-element-action.hbs +9 -0
  383. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/have-value-assertion.hbs +34 -1
  384. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +14 -6
  385. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/visible-assertion.hbs +1 -1
  386. package/src/generators/test-generator/adapters/appium/templates/steps/gestures/go-back-action.hbs +21 -0
  387. package/src/generators/test-generator/adapters/appium/templates/steps/gestures/long-press-action.hbs +4 -0
  388. package/src/generators/test-generator/adapters/appium/templates/steps/gestures/pinch-zoom-action.hbs +4 -0
  389. package/src/generators/test-generator/adapters/appium/templates/steps/gestures/set-geolocation-action.hbs +16 -0
  390. package/src/generators/test-generator/adapters/appium/templates/steps/partials/locator.hbs +9 -1
  391. package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +62 -23
  392. package/src/generators/test-generator/adapters/index.ts +1 -1
  393. package/src/generators/test-generator/adapters/playwright/playwright-adapter.ts +4 -4
  394. package/src/generators/test-generator/adapters/playwright/templates/after-all.hbs +19 -1
  395. package/src/generators/test-generator/adapters/playwright/templates/after-each.hbs +18 -0
  396. package/src/generators/test-generator/adapters/playwright/templates/before-all.hbs +19 -1
  397. package/src/generators/test-generator/adapters/playwright/templates/imports.hbs +3 -0
  398. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/check-action.hbs +6 -1
  399. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/click-at-position-action.hbs +23 -0
  400. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/expand-action.hbs +8 -8
  401. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/fill-editor-action.hbs +7 -2
  402. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row-nth.hbs +7 -2
  403. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +7 -2
  404. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-paginate-action.hbs +5 -0
  405. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/uncheck-action.hbs +3 -1
  406. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/unknown-element-action.hbs +1 -1
  407. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/wait-for-page.hbs +18 -1
  408. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +32 -4
  409. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-element.hbs +5 -2
  410. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/checked-assertion.hbs +5 -1
  411. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/column-cell-assertion.hbs +13 -2
  412. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/contain-text-assertion.hbs +1 -1
  413. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-role-variable-assertion.hbs +2 -2
  414. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-variable-assertion.hbs +1 -1
  415. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/have-text-assertion.hbs +1 -1
  416. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-role-variable-assertion.hbs +2 -2
  417. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-variable-assertion.hbs +1 -1
  418. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/not-checked-assertion.hbs +2 -1
  419. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +21 -3
  420. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +20 -2
  421. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-empty.hbs +4 -1
  422. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-match-data.hbs +4 -1
  423. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-count.hbs +4 -1
  424. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-exists.hbs +12 -4
  425. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-not-exists.hbs +14 -2
  426. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +3 -3
  427. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-value-assertion.hbs +1 -1
  428. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-variable-assertion.hbs +1 -1
  429. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/checked-opts.hbs +8 -0
  430. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +8 -8
  431. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-nth.hbs +1 -1
  432. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/id.hbs +1 -1
  433. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/testid.hbs +1 -1
  434. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +8 -8
  435. package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +10 -8
  436. package/src/generators/test-generator/code-generator.ts +181 -46
  437. package/src/generators/test-generator/diagnostics.ts +117 -6
  438. package/src/generators/test-generator/patterns/index.ts +175 -24
  439. package/src/generators/test-generator/patterns/types.ts +8 -0
  440. package/src/generators/test-generator/patterns/with-parent-scope.ts +41 -0
  441. package/src/generators/test-generator/step-mapper.ts +277 -43
  442. package/src/generators/test-generator/template-engine.ts +21 -21
  443. package/src/generators/test-generator/utils/data-resolver.ts +23 -2
  444. package/src/generators/test-generator/utils/dialog-scope-identity.ts +71 -0
  445. package/src/generators/test-generator/utils/escape-js-string.ts +24 -0
  446. package/src/generators/test-generator/utils/nearest-match.ts +55 -0
  447. package/src/generators/test-generator/utils/selector-entry-fields.ts +131 -0
  448. package/src/generators/test-generator/utils/selector-entry-walk.ts +58 -0
  449. package/src/generators/test-generator/utils/selector-nth-validation.ts +99 -0
  450. package/src/generators/test-generator/utils/selector-resolver.ts +333 -28
  451. package/src/generators/test-generator/utils/selector-type-validation.ts +87 -0
  452. package/src/harness/audit.ts +55 -30
  453. package/src/harness/capability-plan.ts +33 -1
  454. package/src/harness/catalog/drivers.yaml +1 -1
  455. package/src/harness/catalog/universal-viewpoints.yaml +145 -0
  456. package/src/harness/data-driven-lint.ts +192 -32
  457. package/src/harness/parse.ts +7 -1
  458. package/src/harness/repair.ts +8 -1
  459. package/src/harness/script-check.ts +186 -21
  460. package/src/harness/sensors.ts +75 -1
  461. package/src/harness/viewpoint-ledger.ts +26 -5
  462. package/src/index.ts +7 -0
  463. package/src/orchestrator/project-initializer.ts +17 -0
  464. package/src/orchestrator/report-sanitize-reporter-install.ts +109 -0
  465. package/src/orchestrator/templates/ai-src/commands/delivery.md +4 -3
  466. package/src/orchestrator/templates/ai-src/commands/run-test.md +9 -1
  467. package/src/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +10 -0
  468. package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -5
  469. package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +62 -3
  470. package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +126 -11
  471. package/src/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md +16 -1
  472. package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +12 -0
  473. package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +19 -5
  474. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +88 -2
  475. package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +62 -5
  476. package/src/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md +13 -0
  477. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +59 -10
  478. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-f-mobile-native.md +419 -0
  479. package/src/orchestrator/templates/playwright.config.ts +7 -0
  480. package/src/orchestrator/templates/readme.md +1 -1
  481. package/src/orchestrator/templates/specs-checked-state.ts +324 -0
  482. package/src/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
  483. package/src/orchestrator/templates/specs-report-path-sanitize-reporter.ts +142 -0
  484. package/src/orchestrator/templates/specs-url-assert.ts +101 -28
  485. package/src/orchestrator/templates/wdio.conf.ts +105 -1
  486. package/src/utils/selector-types.ts +54 -5
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The trailing scope clause — `… in [Parent] <containerType>` and its optional `with <value>` tail.
3
+ *
4
+ * Lifted out of `parseStep` because the clause failed SILENTLY (#667): the container whitelist held
5
+ * five types, anything else fell through, and the unmatched words stayed inline in the sentence
6
+ * where the first-match extractors below simply ignored them. The step compiled clean
7
+ * and the assertion ran against the WHOLE page instead of the named container — a test that passes
8
+ * for the wrong reason, findable only by diffing the generated spec against the Gherkin.
9
+ *
10
+ * So this module answers two questions, not one:
11
+ * - what the clause MEANS when it is recognized (`parentRef` / `parentType` / the value tail), and
12
+ * - what was DISCARDED when it is not (`unsupportedType`), so the compiler can say so (SG-W028)
13
+ * instead of quietly truncating the sentence.
14
+ */
15
+ /**
16
+ * Container types a step may scope into. Every one of these is something that HOLDS other elements
17
+ * on a page; `button`, `field`, `badge` and friends are deliberately absent — a leaf cannot be a
18
+ * parent, and admitting one would turn a typo into a silently wrong locator rather than a report.
19
+ *
20
+ * Ordered longest-first where one type is a prefix of another (`list-item` before `list`), because
21
+ * the alternation is matched left-to-right: `in [X] list-item` must not resolve as `list` with a
22
+ * stray `-item` left behind.
23
+ *
24
+ * `header` and `footer` are NOT here, though both hold elements. The auto-inferred fallback role
25
+ * for them would be the page landmarks `banner`/`contentinfo`, and a `<header>` nested inside an
26
+ * `<article>`/`<section>` — which is exactly how a repeating card is marked up — carries neither.
27
+ * That fallback would match nothing and fail for a reason unreadable from the Gherkin, so the
28
+ * clause is refused (SG-W028) and the author is pointed at a container type that resolves.
29
+ */
30
+ export declare const PARENT_CONTAINER_TYPES: readonly string[];
31
+ export interface ParentScopeClause {
32
+ /** The `[Parent]` reference — a selectors.yaml key, or `{{var}}` naming the container's text. */
33
+ ref: string;
34
+ /** The container type, lowercased. */
35
+ type: string;
36
+ /** `{{var}}` name when the value tail scopes the parent BY CONTENT. */
37
+ valueRef?: string;
38
+ /** Quoted literal when the value tail scopes the parent by content without a variable. */
39
+ valueText?: string;
40
+ /** The sentence with the clause removed, so the target extractors never see the parent's tokens. */
41
+ remainingText: string;
42
+ }
43
+ /**
44
+ * Extract the scope clause from a step sentence.
45
+ *
46
+ * Returns `{ clause }` when a container type was recognized, `{ unsupportedType }` when the
47
+ * sentence carries an `in [X] <word>` clause whose `<word>` is not a container (it is dropped, and
48
+ * the caller reports it), or an empty object when there is no scope clause at all.
49
+ */
50
+ export declare function extractParentScopeClause(text: string): {
51
+ clause?: ParentScopeClause;
52
+ unsupportedType?: string;
53
+ };
54
+ //# sourceMappingURL=parent-scope-clause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parent-scope-clause.d.ts","sourceRoot":"","sources":["../../../src/generators/gherkin-parser/parent-scope-clause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAKnD,CAAC;AAgBF,MAAM,WAAW,iBAAiB;IAChC,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oGAAoG;IACpG,aAAa,EAAE,MAAM,CAAC;CACvB;AA4BD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG;IACtD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CA6BA"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ /**
3
+ * The trailing scope clause — `… in [Parent] <containerType>` and its optional `with <value>` tail.
4
+ *
5
+ * Lifted out of `parseStep` because the clause failed SILENTLY (#667): the container whitelist held
6
+ * five types, anything else fell through, and the unmatched words stayed inline in the sentence
7
+ * where the first-match extractors below simply ignored them. The step compiled clean
8
+ * and the assertion ran against the WHOLE page instead of the named container — a test that passes
9
+ * for the wrong reason, findable only by diffing the generated spec against the Gherkin.
10
+ *
11
+ * So this module answers two questions, not one:
12
+ * - what the clause MEANS when it is recognized (`parentRef` / `parentType` / the value tail), and
13
+ * - what was DISCARDED when it is not (`unsupportedType`), so the compiler can say so (SG-W028)
14
+ * instead of quietly truncating the sentence.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.PARENT_CONTAINER_TYPES = void 0;
18
+ exports.extractParentScopeClause = extractParentScopeClause;
19
+ /**
20
+ * Container types a step may scope into. Every one of these is something that HOLDS other elements
21
+ * on a page; `button`, `field`, `badge` and friends are deliberately absent — a leaf cannot be a
22
+ * parent, and admitting one would turn a typo into a silently wrong locator rather than a report.
23
+ *
24
+ * Ordered longest-first where one type is a prefix of another (`list-item` before `list`), because
25
+ * the alternation is matched left-to-right: `in [X] list-item` must not resolve as `list` with a
26
+ * stray `-item` left behind.
27
+ *
28
+ * `header` and `footer` are NOT here, though both hold elements. The auto-inferred fallback role
29
+ * for them would be the page landmarks `banner`/`contentinfo`, and a `<header>` nested inside an
30
+ * `<article>`/`<section>` — which is exactly how a repeating card is marked up — carries neither.
31
+ * That fallback would match nothing and fail for a reason unreadable from the Gherkin, so the
32
+ * clause is refused (SG-W028) and the author is pointed at a container type that resolves.
33
+ */
34
+ exports.PARENT_CONTAINER_TYPES = [
35
+ 'list-item', 'listitem', 'list',
36
+ 'table', 'section', 'dialog', 'modal', 'drawer', 'overlay', 'form',
37
+ 'card', 'item', 'row', 'group', 'panel', 'region', 'container',
38
+ 'tab', 'menu',
39
+ ];
40
+ const TYPES_ALT = exports.PARENT_CONTAINER_TYPES.join('|');
41
+ /** `in [Parent] <containerType>` — the clause proper, without any value tail. */
42
+ const SCOPE_CLAUSE_BASE = new RegExp(`\\s+in\\s+\\[([^\\]]+)\\]\\s+(${TYPES_ALT})\\b`, 'i');
43
+ /** The same, plus the optional `with {{v}}` / `with "text"` tail. */
44
+ const SCOPE_CLAUSE = new RegExp(`${SCOPE_CLAUSE_BASE.source}(?:\\s+with\\s+(\\{\\{[a-z0-9\\-._]+\\}\\}|"[^"]*"))?`, 'i');
45
+ /** The same shape with ANY word where a container type belongs — used only to report what was lost. */
46
+ const SCOPE_CLAUSE_ANY_TYPE = /\s+in\s+\[([^\]]+)\]\s+([\w-]+)/i;
47
+ /**
48
+ * Is the `[…]` at `clauseAt` a CONTAINER, or is it the step's own target?
49
+ *
50
+ * A scope clause narrows a target, so the target's bracket must already have appeared. Without this
51
+ * test, `User select {{country}} in [Country Picker] dropdown` reads its one and only target as a
52
+ * parent — the bracket is what the step acts ON, and the `in` is English, not grammar.
53
+ */
54
+ function scopesATarget(text, clauseAt) {
55
+ return /\[[^\]]*\]/.test(text.slice(0, clauseAt));
56
+ }
57
+ /**
58
+ * Does the segment before the scope clause already carry its own `with`?
59
+ *
60
+ * This is what keeps the value tail backward compatible. The documented grammar
61
+ * (`see [first] row in [apply list] table with {{job_name}}`) spends its single `with` on the
62
+ * TARGET, and re-reading that as a parent filter would silently invert the meaning of every such
63
+ * step already written. A SECOND `with` — `see [Tag] header with {{label}} in [Job Card] card with
64
+ * {{title}}` — cannot belong to the target, which already has one; only then does the tail bind to
65
+ * the parent. `[Ref]` contents are blanked first so a bracket like `[Filter With Tags]` is not
66
+ * mistaken for the keyword.
67
+ */
68
+ function targetAlreadyHasValue(head) {
69
+ return /\s+with\s+/i.test(head.replace(/\[[^\]]*\]/g, ''));
70
+ }
71
+ /**
72
+ * Extract the scope clause from a step sentence.
73
+ *
74
+ * Returns `{ clause }` when a container type was recognized, `{ unsupportedType }` when the
75
+ * sentence carries an `in [X] <word>` clause whose `<word>` is not a container (it is dropped, and
76
+ * the caller reports it), or an empty object when there is no scope clause at all.
77
+ */
78
+ function extractParentScopeClause(text) {
79
+ const match = text.match(SCOPE_CLAUSE);
80
+ if (!match) {
81
+ const loose = text.match(SCOPE_CLAUSE_ANY_TYPE);
82
+ return loose && scopesATarget(text, loose.index)
83
+ ? { unsupportedType: loose[2].toLowerCase() }
84
+ : {};
85
+ }
86
+ if (!scopesATarget(text, match.index))
87
+ return {};
88
+ const head = text.slice(0, match.index);
89
+ const tail = match[3];
90
+ const bindsToParent = Boolean(tail) && targetAlreadyHasValue(head);
91
+ // A value tail the target has already claimed stays in the sentence, exactly where it was, for the
92
+ // target extractors to pick up — what gets consumed is then only `in [Parent] <type>`.
93
+ const consumedLength = bindsToParent
94
+ ? match[0].length
95
+ : match[0].match(SCOPE_CLAUSE_BASE)[0].length;
96
+ const clause = {
97
+ ref: match[1],
98
+ type: match[2].toLowerCase(),
99
+ remainingText: head + text.slice(match.index + consumedLength),
100
+ };
101
+ if (bindsToParent) {
102
+ if (tail.startsWith('{{'))
103
+ clause.valueRef = tail.slice(2, -2);
104
+ else
105
+ clause.valueText = tail.slice(1, -1);
106
+ }
107
+ return { clause };
108
+ }
109
+ //# sourceMappingURL=parent-scope-clause.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parent-scope-clause.js","sourceRoot":"","sources":["../../../src/generators/gherkin-parser/parent-scope-clause.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAoFH,4DAgCC;AAlHD;;;;;;;;;;;;;;GAcG;AACU,QAAA,sBAAsB,GAAsB;IACvD,WAAW,EAAE,UAAU,EAAE,MAAM;IAC/B,OAAO,EAAE,SAAS,EA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* One statement of a hook block (`@beforeAll` / `@afterEach` / `@afterAll`). `wrap` → the template
11
+ * guards the statement with try/catch and records a failure under `label` (a JSON string literal,
12
+ * safe to paste into code); `stopOnFailure` → a failure also ends the hook right there (action
13
+ * steps: later steps would run on state the failed action never produced). A plain step runs
14
+ * unwrapped and throws as before.
15
+ */
16
+ export interface HookStep {
17
+ comment?: string;
18
+ code: string;
19
+ wrap?: boolean;
20
+ stopOnFailure?: boolean;
21
+ label?: string;
22
+ }
23
+ /** Hook block render input. `collect` → declare the failure list and end with the fail-once guard. */
24
+ export interface HookRenderData {
25
+ steps: HookStep[];
26
+ collect?: boolean;
27
+ }
9
28
  export interface TestFileData {
10
29
  imports: string;
11
30
  featureName: string;
@@ -82,6 +101,7 @@ export interface RenderImportsOptions {
82
101
  needsMock?: boolean;
83
102
  urlAssertImports?: string;
84
103
  regexEscapeImport?: boolean;
104
+ checkedStateImports?: string;
85
105
  }
86
106
  export interface TestGeneratorAdapter {
87
107
  readonly frameworkName: string;
@@ -96,24 +116,9 @@ export interface TestGeneratorAdapter {
96
116
  code: string;
97
117
  }>;
98
118
  }): string;
99
- renderBeforeAll(data: {
100
- steps: Array<{
101
- comment?: string;
102
- code: string;
103
- }>;
104
- }): string;
105
- renderAfterEach(data: {
106
- steps: Array<{
107
- comment?: string;
108
- code: string;
109
- }>;
110
- }): string;
111
- renderAfterAll(data: {
112
- steps: Array<{
113
- comment?: string;
114
- code: string;
115
- }>;
116
- }): string;
119
+ renderBeforeAll(data: HookRenderData): string;
120
+ renderAfterEach(data: HookRenderData): string;
121
+ renderAfterAll(data: HookRenderData): string;
117
122
  renderStep(templateName: string, data: any): string;
118
123
  }
119
124
  //# sourceMappingURL=adapter-interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter-interface.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/adapters/adapter-interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAA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AAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAG9B,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC3C,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAAC;IACtD,gBAAgB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IACrF,eAAe,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IACpF,eAAe,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IACpF,cAAc,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IAGnF,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAAC;CACrD"}
1
+ {"version":3,"file":"adapter-interface.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/adapters/adapter-interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AAC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IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAG9B,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC3C,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAAC;IACtD,gBAAgB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,MAAM,CAAC;IACrF,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC;IAC9C,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC;IAC9C,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC;IAG7C,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAAC;CACrD"}
@@ -1,4 +1,4 @@
1
- import { TestGeneratorAdapter, TestFileData, ScenarioData, RenderImportsOptions } from '../adapter-interface';
1
+ import { TestGeneratorAdapter, TestFileData, ScenarioData, RenderImportsOptions, HookRenderData } from '../adapter-interface';
2
2
  /**
3
3
  * AppiumAdapter
4
4
  * Generates WebdriverIO + Appium (Mocha) test code using Handlebars templates.
@@ -24,24 +24,9 @@ export declare class AppiumAdapter implements TestGeneratorAdapter {
24
24
  code: string;
25
25
  }>;
26
26
  }): string;
27
- renderBeforeAll(data: {
28
- steps: Array<{
29
- comment?: string;
30
- code: string;
31
- }>;
32
- }): string;
33
- renderAfterEach(data: {
34
- steps: Array<{
35
- comment?: string;
36
- code: string;
37
- }>;
38
- }): string;
39
- renderAfterAll(data: {
40
- steps: Array<{
41
- comment?: string;
42
- code: string;
43
- }>;
44
- }): string;
27
+ renderBeforeAll(data: HookRenderData): string;
28
+ renderAfterEach(data: HookRenderData): string;
29
+ renderAfterAll(data: HookRenderData): string;
45
30
  renderStep(templateName: string, data: any): string;
46
31
  }
47
32
  //# sourceMappingURL=appium-adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appium-adapter.d.ts","sourceRoot":"","sources":["../../../../../src/generators/test-generator/adapters/appium/appium-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG9G;;;;;;;;;GASG;AACH,qBAAa,aAAc,YAAW,oBAAoB;IACxD,QAAQ,CAAC,aAAa,YAAY;IAClC,QAAQ,CAAC,aAAa,cAAc;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,cAAc,CAAiB;;IAOvC,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM;IAI1C,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM;IAI1C,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM;IAIrD,gBAAgB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,MAAM;IAIpF,eAAe,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,I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M;IAI7C,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAI7C,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAI5C,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM;CAGpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"appium-adapter.js","sourceRoot":"","sources":["../../../../../src/generators/test-generator/adapters/appium/appium-adapter.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,2DAAuD;AAEvD;;;;;;;;;GASG;AACH,MAAa,aAAa;IAMxB;QALS,kBAAa,GAAG,QAAQ,CAAC;QACzB,kBAAa,GAAG,UAAU,CAAC;QAKlC,IAAI,CAAC,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,cAAc,CAAC,IAAkB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,cAAc,CAAC,IAAkB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,aAAa,CAAC,OAA8B;QAC1C,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,gBAAgB,CAAC,IAA0D;QACzE,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,eAAe,CAAC,IAA0D;QACxE,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,eAAe,CAAC,IAA0D;QACxE,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,cAAc,CAAC,IAA0D;QACvE,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,UAAU,CAAC,YAAoB,EAAE,IAAS;QACxC,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;CACF;AA1CD,sCA0CC"}
1
+ {"version":3,"file":"appium-adapter.js","sourceRoot":"","sources":["../../../../../src/generators/test-generator/adapters/appium/appium-adapter.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,2DAAuD;AAEvD;;;;;;;;;GASG;AACH,MAAa,aAAa;IAMxB;QALS,kBAAa,GAAG,QAAQ,CAAC;QACzB,kBAAa,GAAG,UAAU,CAAC;QAKlC,IAAI,CAAC,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,cAAc,CAAC,IAAkB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,cAAc,CAAC,IAAkB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,aAAa,CAAC,OAA8B;QAC1C,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,gBAAgB,CAAC,IAA0D;QACzE,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,eAAe,CAAC,IAAoB;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,eAAe,CAAC,IAAoB;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,cAAc,CAAC,IAAoB;QACjC,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,UAAU,CAAC,YAAoB,EAAE,IAAS;QACxC,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;CACF;AA1CD,sCA0CC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The per-OS axis of the step-support matrix, DERIVED from each Appium template's own body.
3
+ *
4
+ * The Web|Mobile columns answer "does a template exist". They cannot answer the question that
5
+ * actually bites: a template can ship, compile, and still do nothing on one of the two mobile
6
+ * runtimes. `hide-keyboard-action` is guarded `if (!driver.isIOS && …)` — on iOS the step compiles,
7
+ * runs, and silently skips. Nothing in the matrix showed that, so nobody could see iOS drifting
8
+ * behind Android, which is exactly what the Android-first decision needs to be able to see.
9
+ *
10
+ * Derived, never declared. A hand-written per-OS column is the same mistake the spec made when it
11
+ * claimed capabilities the code did not have: two sources of truth, one of them wrong, no gate to
12
+ * catch it. Reading the template body means the column cannot lie for longer than a regenerate.
13
+ *
14
+ * A template mentioning `driver.isIOS` in a shape this file does not recognise is a THROW, never a
15
+ * default. Defaulting to 'yes' would let a new one-sided template enter the matrix reported as
16
+ * working on both — the precise failure the axis exists to prevent.
17
+ */
18
+ /**
19
+ * Strip handlebars comments so a body is judged by what it EXECUTES, never by prose ABOUT iOS.
20
+ * Several templates explain their per-OS reasoning at length in a `{{!-- … --}}` block; counting
21
+ * that as code would classify half the adapter wrongly.
22
+ */
23
+ export declare const stripComments: (src: string) => string;
24
+ /**
25
+ * How a template behaves on ONE mobile OS.
26
+ * yes — real implementation on this OS
27
+ * refuses — the OS branch throws, naming the alternative: loud, and therefore safe
28
+ * noop — the OS is guarded OUT with no throw: compiles, runs, does nothing. The dangerous one
29
+ * inherit — the template never branches on OS, so both OSes are whatever the Mobile column says
30
+ */
31
+ export type OsSupport = 'yes' | 'refuses' | 'noop' | 'inherit';
32
+ export interface OsPair {
33
+ android: OsSupport;
34
+ ios: OsSupport;
35
+ }
36
+ /**
37
+ * Per-OS support for one Appium template, read off its body.
38
+ *
39
+ * @throws when the template branches on `driver.isIOS` in an unrecognised shape — deliberately, so
40
+ * the drift gate goes red and a human teaches this file the new shape, rather than the
41
+ * matrix quietly claiming the step works on both.
42
+ */
43
+ export declare function osSupportOf(name: string, src: string): OsPair;
44
+ /**
45
+ * Per-OS support for a template BY NAME, memoized — the compile-time `@platform:ios` gate asks this
46
+ * once per distinct template per run.
47
+ *
48
+ * Returns null when the appium adapter ships no such template: that is a different failure (the
49
+ * step is not a mobile step at all) which the existing template-resolution path already reports, so
50
+ * answering "unsupported on iOS" here would be a second, misleading message for one cause.
51
+ */
52
+ export declare function osSupportOfTemplate(name: string): OsPair | null;
53
+ //# sourceMappingURL=os-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"os-support.d.ts","sourceRoot":"","sources":["../../../../../src/generators/test-generator/adapters/appium/os-support.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,MAC+B,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,MAAM;IAAG,OAAO,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,SAAS,CAAA;CAAE;AAqE9D;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAqB7D;AAqBD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW/D"}
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.stripComments = void 0;
37
+ exports.osSupportOf = osSupportOf;
38
+ exports.osSupportOfTemplate = osSupportOfTemplate;
39
+ const fs = __importStar(require("node:fs"));
40
+ const path = __importStar(require("node:path"));
41
+ /**
42
+ * The per-OS axis of the step-support matrix, DERIVED from each Appium template's own body.
43
+ *
44
+ * The Web|Mobile columns answer "does a template exist". They cannot answer the question that
45
+ * actually bites: a template can ship, compile, and still do nothing on one of the two mobile
46
+ * runtimes. `hide-keyboard-action` is guarded `if (!driver.isIOS && …)` — on iOS the step compiles,
47
+ * runs, and silently skips. Nothing in the matrix showed that, so nobody could see iOS drifting
48
+ * behind Android, which is exactly what the Android-first decision needs to be able to see.
49
+ *
50
+ * Derived, never declared. A hand-written per-OS column is the same mistake the spec made when it
51
+ * claimed capabilities the code did not have: two sources of truth, one of them wrong, no gate to
52
+ * catch it. Reading the template body means the column cannot lie for longer than a regenerate.
53
+ *
54
+ * A template mentioning `driver.isIOS` in a shape this file does not recognise is a THROW, never a
55
+ * default. Defaulting to 'yes' would let a new one-sided template enter the matrix reported as
56
+ * working on both — the precise failure the axis exists to prevent.
57
+ */
58
+ /**
59
+ * Strip handlebars comments so a body is judged by what it EXECUTES, never by prose ABOUT iOS.
60
+ * Several templates explain their per-OS reasoning at length in a `{{!-- … --}}` block; counting
61
+ * that as code would classify half the adapter wrongly.
62
+ */
63
+ const stripComments = (src) => src.replace(/\{\{!--[\s\S]*?--\}\}/g, '').replace(/\{\{![^}]*?\}\}/g, '');
64
+ exports.stripComments = stripComments;
65
+ /** Worse wins: a template with both a per-OS read and an iOS refusal is an iOS refusal. */
66
+ const RANK = { inherit: 0, yes: 1, noop: 2, refuses: 3 };
67
+ const worse = (a, b) => (RANK[b] > RANK[a] ? b : a);
68
+ /**
69
+ * The statement (or block) an `if (…)` condition guards.
70
+ *
71
+ * Brace-matched rather than regex-matched because the distinction that matters is whether a `throw`
72
+ * sits INSIDE the OS branch. `swipe-action` throws for a not-found element and implements iOS fully;
73
+ * a file-level `/throw/` test would read that as an iOS refusal and put a lie in the table.
74
+ */
75
+ function guardedBody(code, from) {
76
+ let i = from;
77
+ while (i < code.length && /\s/.test(code[i]))
78
+ i++;
79
+ if (code[i] !== '{') {
80
+ // Braceless form — `if (driver.isIOS) await x(); else await y();` (double-click-action).
81
+ const end = code.indexOf(';', i);
82
+ return code.slice(i, end === -1 ? code.length : end);
83
+ }
84
+ let depth = 0;
85
+ for (let j = i; j < code.length; j++) {
86
+ if (code[j] === '{')
87
+ depth++;
88
+ else if (code[j] === '}' && --depth === 0)
89
+ return code.slice(i + 1, j);
90
+ }
91
+ return code.slice(i); // unbalanced source — the caller's fail-loud path reports it
92
+ }
93
+ const startsWithThrow = (body) => /^\s*throw\b/.test(body);
94
+ /**
95
+ * Classify one `driver.isIOS` occurrence. Returns null when the shape is unrecognised, which the
96
+ * caller turns into a throw.
97
+ */
98
+ function classifyOccurrence(code, at) {
99
+ const before = code.slice(0, at).replace(/\s+$/, '');
100
+ const negated = before.endsWith('!');
101
+ const after = code.slice(at + 'driver.isIOS'.length);
102
+ // `driver.isIOS ? <ios> : <android>` — a per-OS read, both arms real. The `?` may sit on the
103
+ // NEXT line: every assertion template formats the ternary across three lines, so a same-line
104
+ // test would miss twenty templates and report them unrecognised.
105
+ if (!negated && /^\s*\?/.test(after))
106
+ return { android: 'yes', ios: 'yes' };
107
+ // Condition forms. `)` closes the `if (`, so the guarded body starts after it.
108
+ const closeParen = after.indexOf(')');
109
+ if (closeParen === -1)
110
+ return null;
111
+ // Anything other than whitespace/`&&`-chained conditions between the flag and the `)` means a
112
+ // shape this file has not been taught to read.
113
+ const between = after.slice(0, closeParen);
114
+ if (!/^[\s)]*$/.test(between) && !/^\s*&&/.test(between))
115
+ return null;
116
+ const body = guardedBody(after, closeParen + 1);
117
+ if (negated) {
118
+ // `!driver.isIOS` guards the ANDROID path.
119
+ // with a throw → Android refuses (the mirror case; none exists today, and if one is added
120
+ // it must not be silently reported as an iOS no-op)
121
+ // without → iOS is skipped with no signal at all: 'noop'
122
+ return startsWithThrow(body)
123
+ ? { android: 'refuses', ios: 'yes' }
124
+ : { android: 'yes', ios: 'noop' };
125
+ }
126
+ // `driver.isIOS` guards the iOS path: a leading throw is a refusal, anything else is real code
127
+ // (the `else` arm carries Android either way).
128
+ return startsWithThrow(body) ? { android: 'yes', ios: 'refuses' } : { android: 'yes', ios: 'yes' };
129
+ }
130
+ /**
131
+ * Per-OS support for one Appium template, read off its body.
132
+ *
133
+ * @throws when the template branches on `driver.isIOS` in an unrecognised shape — deliberately, so
134
+ * the drift gate goes red and a human teaches this file the new shape, rather than the
135
+ * matrix quietly claiming the step works on both.
136
+ */
137
+ function osSupportOf(name, src) {
138
+ const code = (0, exports.stripComments)(src);
139
+ if (!code.includes('driver.isIOS'))
140
+ return { android: 'inherit', ios: 'inherit' };
141
+ let pair = { android: 'yes', ios: 'yes' };
142
+ let seen = 0;
143
+ for (let i = code.indexOf('driver.isIOS'); i !== -1; i = code.indexOf('driver.isIOS', i + 1)) {
144
+ const one = classifyOccurrence(code, i);
145
+ if (!one) {
146
+ throw new Error(`[step-support-matrix] ${name}.hbs branches on driver.isIOS in a shape os-support.ts cannot read ` +
147
+ `(at offset ${i}). Teach classifyOccurrence() the new shape — do NOT let it default, or the ` +
148
+ `matrix will report a one-sided template as working on both.\n` +
149
+ ` context: ${JSON.stringify(code.slice(Math.max(0, i - 40), i + 80))}`);
150
+ }
151
+ seen++;
152
+ pair = { android: worse(pair.android, one.android), ios: worse(pair.ios, one.ios) };
153
+ }
154
+ if (!seen)
155
+ throw new Error(`[step-support-matrix] ${name}.hbs mentions driver.isIOS but no occurrence classified`);
156
+ return pair;
157
+ }
158
+ /** Appium step templates, the same tree `renderStep` searches. */
159
+ const TEMPLATES_DIR = path.join(__dirname, 'templates', 'steps');
160
+ const cache = new Map();
161
+ /** Locate `<name>.hbs` anywhere under the appium step tree (excluding `partials/`). */
162
+ function findTemplate(dir, file) {
163
+ for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
164
+ if (e.isDirectory()) {
165
+ if (e.name === 'partials')
166
+ continue;
167
+ const hit = findTemplate(path.join(dir, e.name), file);
168
+ if (hit)
169
+ return hit;
170
+ }
171
+ else if (e.name === file) {
172
+ return path.join(dir, e.name);
173
+ }
174
+ }
175
+ return null;
176
+ }
177
+ /**
178
+ * Per-OS support for a template BY NAME, memoized — the compile-time `@platform:ios` gate asks this
179
+ * once per distinct template per run.
180
+ *
181
+ * Returns null when the appium adapter ships no such template: that is a different failure (the
182
+ * step is not a mobile step at all) which the existing template-resolution path already reports, so
183
+ * answering "unsupported on iOS" here would be a second, misleading message for one cause.
184
+ */
185
+ function osSupportOfTemplate(name) {
186
+ if (cache.has(name))
187
+ return cache.get(name) ?? null;
188
+ let pair = null;
189
+ try {
190
+ const file = findTemplate(TEMPLATES_DIR, `${name}.hbs`);
191
+ if (file)
192
+ pair = osSupportOf(name, fs.readFileSync(file, 'utf-8'));
193
+ }
194
+ catch {
195
+ pair = null; // an unreadable tree must not break codegen; the matrix gate reports it instead
196
+ }
197
+ cache.set(name, pair);
198
+ return pair;
199
+ }
200
+ //# sourceMappingURL=os-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"os-support.js","sourceRoot":"","sources":["../../../../../src/generators/test-generator/adapters/appium/os-support.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,kCAqBC;AA6BD,kDAWC;AA/KD,4CAA8B;AAC9B,gDAAkC;AAElC;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,GAAW,EAAU,EAAE,CACnD,GAAG,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAD/D,QAAA,aAAa,iBACkD;AAa5E,2FAA2F;AAC3F,MAAM,IAAI,GAA8B,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AACpF,MAAM,KAAK,GAAG,CAAC,CAAY,EAAE,CAAY,EAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAErF;;;;;;GAMG;AACH,SAAS,WAAW,CAAC,IAAY,EAAE,IAAY;IAC7C,IAAI,CAAC,GAAG,IAAI,CAAC;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AE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,IAAI,CAAC,CAAC,gFAAgF;IAC/F,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,8 +1,26 @@
1
1
  after(async () => {
2
+ {{#if collect}}
3
+ // Hook checks are collected: every failed step is recorded and the hook fails ONCE with the full list
4
+ const __hookFailures: string[] = [];
5
+ {{/if}}
2
6
  {{#each steps}}
3
7
  {{#if comment}}
4
8
  // {{comment}}
5
9
  {{/if}}
10
+ {{#if wrap}}
11
+ try {
12
+ {{code}}
13
+ } catch (e) {
14
+ __hookFailures.push({{label}} + ': ' + String((e as Error).message).split('\n')[0]);
15
+ {{#if stopOnFailure}}
16
+ if (__hookFailures.length) throw new Error('[sungen] hook preconditions not met:\n' + __hookFailures.join('\n'));
17
+ {{/if}}
18
+ }
19
+ {{else}}
6
20
  {{code}}
21
+ {{/if}}
7
22
  {{/each}}
23
+ {{#if collect}}
24
+ if (__hookFailures.length) throw new Error('[sungen] hook preconditions not met:\n' + __hookFailures.join('\n'));
25
+ {{/if}}
8
26
  });
@@ -1,8 +1,26 @@
1
1
  afterEach(async () => {
2
+ {{#if collect}}
3
+ // Hook checks are collected: every failed step is recorded and the hook fails ONCE with the full list
4
+ const __hookFailures: string[] = [];
5
+ {{/if}}
2
6
  {{#each steps}}
3
7
  {{#if comment}}
4
8
  // {{comment}}
5
9
  {{/if}}
10
+ {{#if wrap}}
11
+ try {
12
+ {{code}}
13
+ } catch (e) {
14
+ __hookFailures.push({{label}} + ': ' + String((e as Error).message).split('\n')[0]);
15
+ {{#if stopOnFailure}}
16
+ if (__hookFailures.length) throw new Error('[sungen] hook preconditions not met:\n' + __hookFailures.join('\n'));
17
+ {{/if}}
18
+ }
19
+ {{else}}
6
20
  {{code}}
21
+ {{/if}}
7
22
  {{/each}}
23
+ {{#if collect}}
24
+ if (__hookFailures.length) throw new Error('[sungen] hook preconditions not met:\n' + __hookFailures.join('\n'));
25
+ {{/if}}
8
26
  });