doc-detective-common 3.6.1 → 4.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/.c8rc.json +8 -0
  2. package/.claude/settings.local.json +11 -0
  3. package/.claude/skills/tdd-coverage/SKILL.md +161 -0
  4. package/AGENTS.md +332 -285
  5. package/CLAUDE.md +38 -0
  6. package/LICENSE +661 -661
  7. package/README.md +78 -48
  8. package/coverage-thresholds.json +8 -0
  9. package/dist/detectTests.d.ts +106 -0
  10. package/dist/detectTests.d.ts.map +1 -0
  11. package/dist/detectTests.js +530 -0
  12. package/dist/detectTests.js.map +1 -0
  13. package/dist/files.d.ts +16 -0
  14. package/dist/files.d.ts.map +1 -0
  15. package/dist/files.js +123 -0
  16. package/dist/files.js.map +1 -0
  17. package/dist/index.cjs +122283 -0
  18. package/dist/index.d.cts +4 -0
  19. package/dist/index.d.ts +4 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +4 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/index.mjs +4 -0
  24. package/dist/resolvePaths.d.ts +28 -0
  25. package/dist/resolvePaths.d.ts.map +1 -0
  26. package/dist/resolvePaths.js +236 -0
  27. package/dist/resolvePaths.js.map +1 -0
  28. package/dist/schemas/index.d.ts +5 -0
  29. package/dist/schemas/index.d.ts.map +1 -0
  30. package/dist/schemas/index.js +3 -0
  31. package/dist/schemas/index.js.map +1 -0
  32. package/dist/schemas/schemas.json +121359 -0
  33. package/dist/types/generated/checkLink_v3.d.ts +27 -0
  34. package/dist/types/generated/checkLink_v3.d.ts.map +1 -0
  35. package/dist/types/generated/checkLink_v3.js +7 -0
  36. package/dist/types/generated/checkLink_v3.js.map +1 -0
  37. package/dist/types/generated/click_v3.d.ts +16 -0
  38. package/dist/types/generated/click_v3.d.ts.map +1 -0
  39. package/dist/types/generated/click_v3.js +7 -0
  40. package/dist/types/generated/click_v3.js.map +1 -0
  41. package/dist/types/generated/config_v3.d.ts +398 -0
  42. package/dist/types/generated/config_v3.d.ts.map +1 -0
  43. package/dist/types/generated/config_v3.js +7 -0
  44. package/dist/types/generated/config_v3.js.map +1 -0
  45. package/dist/types/generated/context_v3.d.ts +108 -0
  46. package/dist/types/generated/context_v3.d.ts.map +1 -0
  47. package/dist/types/generated/context_v3.js +7 -0
  48. package/dist/types/generated/context_v3.js.map +1 -0
  49. package/dist/types/generated/dragAndDrop_v3.d.ts +37 -0
  50. package/dist/types/generated/dragAndDrop_v3.d.ts.map +1 -0
  51. package/dist/types/generated/dragAndDrop_v3.js +7 -0
  52. package/dist/types/generated/dragAndDrop_v3.js.map +1 -0
  53. package/dist/types/generated/endRecord_v3.d.ts +9 -0
  54. package/dist/types/generated/endRecord_v3.d.ts.map +1 -0
  55. package/dist/types/generated/endRecord_v3.js +7 -0
  56. package/dist/types/generated/endRecord_v3.js.map +1 -0
  57. package/dist/types/generated/find_v3.d.ts +16 -0
  58. package/dist/types/generated/find_v3.d.ts.map +1 -0
  59. package/dist/types/generated/find_v3.js +7 -0
  60. package/dist/types/generated/find_v3.js.map +1 -0
  61. package/dist/types/generated/goTo_v3.d.ts +46 -0
  62. package/dist/types/generated/goTo_v3.d.ts.map +1 -0
  63. package/dist/types/generated/goTo_v3.js +7 -0
  64. package/dist/types/generated/goTo_v3.js.map +1 -0
  65. package/dist/types/generated/httpRequest_v3.d.ts +16 -0
  66. package/dist/types/generated/httpRequest_v3.d.ts.map +1 -0
  67. package/dist/types/generated/httpRequest_v3.js +7 -0
  68. package/dist/types/generated/httpRequest_v3.js.map +1 -0
  69. package/dist/types/generated/loadCookie_v3.d.ts +16 -0
  70. package/dist/types/generated/loadCookie_v3.d.ts.map +1 -0
  71. package/dist/types/generated/loadCookie_v3.js +7 -0
  72. package/dist/types/generated/loadCookie_v3.js.map +1 -0
  73. package/dist/types/generated/loadVariables_v3.d.ts +9 -0
  74. package/dist/types/generated/loadVariables_v3.d.ts.map +1 -0
  75. package/dist/types/generated/loadVariables_v3.js +7 -0
  76. package/dist/types/generated/loadVariables_v3.js.map +1 -0
  77. package/dist/types/generated/openApi_v3.d.ts +62 -0
  78. package/dist/types/generated/openApi_v3.d.ts.map +1 -0
  79. package/dist/types/generated/openApi_v3.js +7 -0
  80. package/dist/types/generated/openApi_v3.js.map +1 -0
  81. package/dist/types/generated/record_v3.d.ts +32 -0
  82. package/dist/types/generated/record_v3.d.ts.map +1 -0
  83. package/dist/types/generated/record_v3.js +7 -0
  84. package/dist/types/generated/record_v3.js.map +1 -0
  85. package/dist/types/generated/report_v3.d.ts +174 -0
  86. package/dist/types/generated/report_v3.d.ts.map +1 -0
  87. package/dist/types/generated/report_v3.js +7 -0
  88. package/dist/types/generated/report_v3.js.map +1 -0
  89. package/dist/types/generated/resolvedTests_v3.d.ts +571 -0
  90. package/dist/types/generated/resolvedTests_v3.d.ts.map +1 -0
  91. package/dist/types/generated/resolvedTests_v3.js +7 -0
  92. package/dist/types/generated/resolvedTests_v3.js.map +1 -0
  93. package/dist/types/generated/runCode_v3.d.ts +57 -0
  94. package/dist/types/generated/runCode_v3.d.ts.map +1 -0
  95. package/dist/types/generated/runCode_v3.js +7 -0
  96. package/dist/types/generated/runCode_v3.js.map +1 -0
  97. package/dist/types/generated/runShell_v3.d.ts +56 -0
  98. package/dist/types/generated/runShell_v3.d.ts.map +1 -0
  99. package/dist/types/generated/runShell_v3.js +7 -0
  100. package/dist/types/generated/runShell_v3.js.map +1 -0
  101. package/dist/types/generated/saveCookie_v3.d.ts +16 -0
  102. package/dist/types/generated/saveCookie_v3.d.ts.map +1 -0
  103. package/dist/types/generated/saveCookie_v3.js +7 -0
  104. package/dist/types/generated/saveCookie_v3.js.map +1 -0
  105. package/dist/types/generated/screenshot_v3.d.ts +74 -0
  106. package/dist/types/generated/screenshot_v3.d.ts.map +1 -0
  107. package/dist/types/generated/screenshot_v3.js +7 -0
  108. package/dist/types/generated/screenshot_v3.js.map +1 -0
  109. package/dist/types/generated/sourceIntegration_v3.d.ts +30 -0
  110. package/dist/types/generated/sourceIntegration_v3.d.ts.map +1 -0
  111. package/dist/types/generated/sourceIntegration_v3.js +7 -0
  112. package/dist/types/generated/sourceIntegration_v3.js.map +1 -0
  113. package/dist/types/generated/spec_v3.d.ts +159 -0
  114. package/dist/types/generated/spec_v3.d.ts.map +1 -0
  115. package/dist/types/generated/spec_v3.js +7 -0
  116. package/dist/types/generated/spec_v3.js.map +1 -0
  117. package/dist/types/generated/step_v3.d.ts +1270 -0
  118. package/dist/types/generated/step_v3.d.ts.map +1 -0
  119. package/dist/types/generated/step_v3.js +7 -0
  120. package/dist/types/generated/step_v3.js.map +1 -0
  121. package/dist/types/generated/stopRecord_v3.d.ts +9 -0
  122. package/dist/types/generated/stopRecord_v3.d.ts.map +1 -0
  123. package/dist/types/generated/stopRecord_v3.js +7 -0
  124. package/dist/types/generated/stopRecord_v3.js.map +1 -0
  125. package/dist/types/generated/test_v3.d.ts +2915 -0
  126. package/dist/types/generated/test_v3.d.ts.map +1 -0
  127. package/dist/types/generated/test_v3.js +7 -0
  128. package/dist/types/generated/test_v3.js.map +1 -0
  129. package/dist/types/generated/type_v3.d.ts +54 -0
  130. package/dist/types/generated/type_v3.d.ts.map +1 -0
  131. package/dist/types/generated/type_v3.js +7 -0
  132. package/dist/types/generated/type_v3.js.map +1 -0
  133. package/dist/types/generated/wait_v3.d.ts +12 -0
  134. package/dist/types/generated/wait_v3.d.ts.map +1 -0
  135. package/dist/types/generated/wait_v3.js +7 -0
  136. package/dist/types/generated/wait_v3.js.map +1 -0
  137. package/dist/validate.d.ts +41 -0
  138. package/dist/validate.d.ts.map +1 -0
  139. package/dist/validate.js +557 -0
  140. package/dist/validate.js.map +1 -0
  141. package/package.json +60 -36
  142. package/plans/plan-typescriptMigration.prompt.md +25 -0
  143. package/scripts/check-coverage-ratchet.cjs +118 -0
  144. package/scripts/createCjsWrapper.js +25 -0
  145. package/scripts/generateTypes.cjs +54 -0
  146. package/src/detectTests.ts +616 -0
  147. package/src/index.ts +3 -0
  148. package/src/schemas/build/arazzo_v2.schema.json +41 -0
  149. package/src/schemas/build/checkLink_v2.schema.json +1 -1
  150. package/src/schemas/build/checkLink_v3.schema.json +1 -1
  151. package/src/schemas/build/checkLink_v3.schema.yaml +83 -0
  152. package/src/schemas/build/click_v3.schema.json +1 -1
  153. package/src/schemas/build/config_v2.schema.json +14 -14
  154. package/src/schemas/build/config_v3.schema.json +6 -6
  155. package/src/schemas/build/context_v2.schema.json +1 -1
  156. package/src/schemas/build/context_v3.schema.json +1 -1
  157. package/src/schemas/build/dragAndDrop_v3.schema.json +1 -1
  158. package/src/schemas/build/find_v2.schema.json +3 -3
  159. package/src/schemas/build/find_v3.schema.json +4 -4
  160. package/src/schemas/build/goTo_v2.schema.json +1 -1
  161. package/src/schemas/build/goTo_v3.schema.json +1 -1
  162. package/src/schemas/build/httpRequest_v2.schema.json +2 -2
  163. package/src/schemas/build/httpRequest_v3.schema.json +3 -3
  164. package/src/schemas/build/loadCookie_v3.schema.json +1 -1
  165. package/src/schemas/build/loadVariables_v3.schema.json +1 -1
  166. package/src/schemas/build/moveTo_v2.schema.json +1 -1
  167. package/src/schemas/build/openApi_v2.schema.json +1 -1
  168. package/src/schemas/build/openApi_v3.schema.json +1 -1
  169. package/src/schemas/build/record_v3.schema.json +1 -1
  170. package/src/schemas/build/report_v3.schema.json +5 -5
  171. package/src/schemas/build/resolvedTests_v3.schema.json +3 -3
  172. package/src/schemas/build/runCode_v2.schema.json +1 -1
  173. package/src/schemas/build/runCode_v3.schema.json +1 -1
  174. package/src/schemas/build/runShell_v2.schema.json +1 -1
  175. package/src/schemas/build/runShell_v3.schema.json +1 -1
  176. package/src/schemas/build/saveCookie_v3.schema.json +1 -1
  177. package/src/schemas/build/saveScreenshot_v2.schema.json +1 -1
  178. package/src/schemas/build/screenshot_v3.schema.json +2 -2
  179. package/src/schemas/build/setVariables_v2.schema.json +1 -1
  180. package/src/schemas/build/sourceIntegration_v3.schema.json +1 -1
  181. package/src/schemas/build/spec_v2.schema.json +4 -4
  182. package/src/schemas/build/spec_v3.schema.json +4 -4
  183. package/src/schemas/build/startRecording_v2.schema.json +1 -1
  184. package/src/schemas/build/step_v3.schema.json +38 -38
  185. package/src/schemas/build/stopRecord_v3.schema.json +1 -1
  186. package/src/schemas/build/stopRecording_v2.schema.json +1 -1
  187. package/src/schemas/build/terminateScope_v3.schema.json +48 -0
  188. package/src/schemas/build/test_v2.schema.json +15 -15
  189. package/src/schemas/build/test_v3.schema.json +6 -6
  190. package/src/schemas/build/typeKeys_v2.schema.json +1 -1
  191. package/src/schemas/build/type_v3.schema.json +1 -1
  192. package/src/schemas/build/wait_v2.schema.json +1 -1
  193. package/src/schemas/build/wait_v3.schema.json +1 -1
  194. package/src/schemas/{dereferenceSchemas.js → dereferenceSchemas.cjs} +206 -206
  195. package/src/schemas/index.ts +6 -0
  196. package/src/schemas/output_schemas/endRecord_v3.schema.json +13 -13
  197. package/src/schemas/src_schemas/checkLink_v2.schema.json +65 -65
  198. package/src/schemas/src_schemas/checkLink_v3.schema.json +90 -90
  199. package/src/schemas/src_schemas/click_v3.schema.json +143 -143
  200. package/src/schemas/src_schemas/config_v2.schema.json +929 -929
  201. package/src/schemas/src_schemas/config_v3.schema.json +633 -633
  202. package/src/schemas/src_schemas/context_v2.schema.json +108 -108
  203. package/src/schemas/src_schemas/context_v3.schema.json +202 -202
  204. package/src/schemas/src_schemas/dragAndDrop_v3.schema.json +184 -184
  205. package/src/schemas/src_schemas/find_v2.schema.json +155 -155
  206. package/src/schemas/src_schemas/find_v3.schema.json +209 -209
  207. package/src/schemas/src_schemas/goTo_v2.schema.json +57 -57
  208. package/src/schemas/src_schemas/goTo_v3.schema.json +232 -232
  209. package/src/schemas/src_schemas/httpRequest_v2.schema.json +284 -284
  210. package/src/schemas/src_schemas/httpRequest_v3.schema.json +402 -402
  211. package/src/schemas/src_schemas/loadCookie_v3.schema.json +113 -113
  212. package/src/schemas/src_schemas/loadVariables_v3.schema.json +8 -8
  213. package/src/schemas/src_schemas/openApi_v2.schema.json +64 -64
  214. package/src/schemas/src_schemas/openApi_v3.schema.json +160 -160
  215. package/src/schemas/src_schemas/record_v3.schema.json +68 -68
  216. package/src/schemas/src_schemas/report_v3.schema.json +51 -51
  217. package/src/schemas/src_schemas/resolvedTests_v3.schema.json +236 -236
  218. package/src/schemas/src_schemas/runCode_v2.schema.json +181 -181
  219. package/src/schemas/src_schemas/runCode_v3.schema.json +136 -136
  220. package/src/schemas/src_schemas/runShell_v2.schema.json +166 -166
  221. package/src/schemas/src_schemas/runShell_v3.schema.json +154 -154
  222. package/src/schemas/src_schemas/saveCookie_v3.schema.json +124 -124
  223. package/src/schemas/src_schemas/saveScreenshot_v2.schema.json +129 -129
  224. package/src/schemas/src_schemas/screenshot_v3.schema.json +248 -248
  225. package/src/schemas/src_schemas/setVariables_v2.schema.json +37 -37
  226. package/src/schemas/src_schemas/sourceIntegration_v3.schema.json +45 -45
  227. package/src/schemas/src_schemas/spec_v2.schema.json +175 -175
  228. package/src/schemas/src_schemas/spec_v3.schema.json +211 -211
  229. package/src/schemas/src_schemas/startRecording_v2.schema.json +54 -54
  230. package/src/schemas/src_schemas/step_v3.schema.json +632 -632
  231. package/src/schemas/src_schemas/stopRecord_v3.schema.json +13 -13
  232. package/src/schemas/src_schemas/stopRecording_v2.schema.json +31 -31
  233. package/src/schemas/src_schemas/test_v2.schema.json +200 -200
  234. package/src/schemas/src_schemas/test_v3.schema.json +268 -268
  235. package/src/schemas/src_schemas/typeKeys_v2.schema.json +63 -63
  236. package/src/schemas/src_schemas/type_v3.schema.json +118 -118
  237. package/src/schemas/src_schemas/wait_v3.schema.json +35 -35
  238. package/src/types/generated/checkLink_v3.ts +29 -0
  239. package/src/types/generated/click_v3.ts +17 -0
  240. package/src/types/generated/config_v3.ts +405 -0
  241. package/src/types/generated/context_v3.ts +112 -0
  242. package/src/types/generated/dragAndDrop_v3.ts +39 -0
  243. package/src/types/generated/endRecord_v3.ts +10 -0
  244. package/src/types/generated/find_v3.ts +17 -0
  245. package/src/types/generated/goTo_v3.ts +48 -0
  246. package/src/types/generated/httpRequest_v3.ts +17 -0
  247. package/src/types/generated/loadCookie_v3.ts +17 -0
  248. package/src/types/generated/loadVariables_v3.ts +10 -0
  249. package/src/types/generated/openApi_v3.ts +64 -0
  250. package/src/types/generated/record_v3.ts +34 -0
  251. package/src/types/generated/report_v3.ts +183 -0
  252. package/src/types/generated/resolvedTests_v3.ts +585 -0
  253. package/src/types/generated/runCode_v3.ts +59 -0
  254. package/src/types/generated/runShell_v3.ts +58 -0
  255. package/src/types/generated/saveCookie_v3.ts +17 -0
  256. package/src/types/generated/screenshot_v3.ts +76 -0
  257. package/src/types/generated/sourceIntegration_v3.ts +31 -0
  258. package/src/types/generated/spec_v3.ts +166 -0
  259. package/src/types/generated/step_v3.ts +1288 -0
  260. package/src/types/generated/stopRecord_v3.ts +10 -0
  261. package/src/types/generated/test_v3.ts +3048 -0
  262. package/src/types/generated/type_v3.ts +56 -0
  263. package/src/types/generated/wait_v3.ts +13 -0
  264. package/src/{validate.js → validate.ts} +627 -587
  265. package/tsconfig.json +22 -0
  266. package/src/files.js +0 -84
  267. package/src/index.js +0 -12
  268. package/src/resolvePaths.js +0 -252
  269. package/src/schemas/index.js +0 -6
@@ -1,249 +1,249 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "screenshot",
4
- "description": "Takes a screenshot in PNG format.",
5
- "anyOf": [
6
- {
7
- "$ref": "#/components/schemas/path"
8
- },
9
- {
10
- "$ref": "#/components/schemas/object"
11
- },
12
- {
13
- "type": "boolean",
14
- "title": "Capture screenshot",
15
- "description": "If `true`, captures a screenshot. If `false`, doesn't capture a screenshot."
16
- }
17
- ],
18
- "components": {
19
- "schemas": {
20
- "path": {
21
- "title": "Screenshot (simple)",
22
- "description": "File path of the PNG file. Accepts absolute paths. If not specified, the file name is the ID of the step.",
23
- "type": "string",
24
- "pattern": "([A-Za-z0-9_-]*\\.(png|PNG)$|\\$[A-Za-z0-9_]+)",
25
- "transform": [
26
- "trim"
27
- ]
28
- },
29
- "object": {
30
- "type": "object",
31
- "additionalProperties": false,
32
- "properties": {
33
- "path": {
34
- "$ref": "#/components/schemas/path"
35
- },
36
- "directory": {
37
- "type": "string",
38
- "description": "Directory of the PNG file. If the directory doesn't exist, creates the directory.",
39
- "transform": [
40
- "trim"
41
- ]
42
- },
43
- "maxVariation": {
44
- "type": "number",
45
- "description": "Allowed variation in percentage of pixels between the new screenshot and the existing screenshot at `path`. If the difference between the new screenshot and the existing screenshot is greater than `maxVariation`, the step fails. If a screenshot doesn't exist at `path`, this value is ignored.",
46
- "default": 0.05,
47
- "minimum": 0,
48
- "maximum": 1
49
- },
50
- "overwrite": {
51
- "type": "string",
52
- "description": "If `true`, overwrites the existing screenshot at `path` if it exists.\nIf `aboveVariation`, overwrites the existing screenshot at `path` if the difference between the new screenshot and the existing screenshot is greater than `maxVariation`.",
53
- "enum": [
54
- "true",
55
- "false",
56
- "aboveVariation"
57
- ],
58
- "default": "aboveVariation"
59
- },
60
- "crop": {
61
- "anyOf": [
62
- {
63
- "title": "Crop by element (simple)",
64
- "type": "string",
65
- "description": "Display text or selector of the element to screenshot."
66
- },
67
- {
68
- "$ref": "#/components/schemas/crop_element"
69
- }
70
- ]
71
- },
72
- "sourceIntegration": {
73
- "description": "Information about the source integration for this screenshot, enabling upload of changed files back to the source CMS. Set automatically during test resolution for files from integrations.",
74
- "$ref": "sourceIntegration_v3.schema.json#"
75
- }
76
- },
77
- "title": "Capture screenshot (detailed)"
78
- },
79
- "crop_element": {
80
- "title": "Crop by element (detailed)",
81
- "type": "object",
82
- "description": "Crop the screenshot to a specific element.",
83
- "additionalProperties": false,
84
- "anyOf": [
85
- {
86
- "required": [
87
- "selector"
88
- ]
89
- },
90
- {
91
- "required": [
92
- "elementText"
93
- ]
94
- },
95
- {
96
- "required": [
97
- "elementId"
98
- ]
99
- },
100
- {
101
- "required": [
102
- "elementTestId"
103
- ]
104
- },
105
- {
106
- "required": [
107
- "elementClass"
108
- ]
109
- },
110
- {
111
- "required": [
112
- "elementAttribute"
113
- ]
114
- },
115
- {
116
- "required": [
117
- "elementAria"
118
- ]
119
- }
120
- ],
121
- "properties": {
122
- "elementText": {
123
- "type": "string",
124
- "description": "Display text of the element to screenshot."
125
- },
126
- "selector": {
127
- "type": "string",
128
- "description": "Selector of the element to screenshot."
129
- },
130
- "elementId": {
131
- "type": "string",
132
- "description": "ID attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax."
133
- },
134
- "elementTestId": {
135
- "type": "string",
136
- "description": "data-testid attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax."
137
- },
138
- "elementClass": {
139
- "anyOf": [
140
- {
141
- "type": "string"
142
- },
143
- {
144
- "type": "array",
145
- "items": {
146
- "type": "string"
147
- }
148
- }
149
- ],
150
- "description": "Class or array of classes that the element must have. Each class supports exact match or regex pattern using /pattern/ syntax. Element must have all specified classes."
151
- },
152
- "elementAttribute": {
153
- "type": "object",
154
- "description": "Object of attribute key-value pairs that the element must have. Values can be strings (supporting /pattern/ regex), numbers, or booleans. Boolean true matches attribute presence, false matches absence.",
155
- "additionalProperties": {
156
- "anyOf": [
157
- {
158
- "type": "string"
159
- },
160
- {
161
- "type": "number"
162
- },
163
- {
164
- "type": "boolean"
165
- }
166
- ]
167
- }
168
- },
169
- "elementAria": {
170
- "type": "string",
171
- "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax."
172
- },
173
- "padding": {
174
- "anyOf": [
175
- {
176
- "title": "Padding (simple)",
177
- "type": "number",
178
- "description": "Padding in pixels to add to the bounds of the element.",
179
- "minimum": 0
180
- },
181
- {
182
- "$ref": "#/components/schemas/padding"
183
- }
184
- ]
185
- }
186
- }
187
- },
188
- "padding": {
189
- "type": "object",
190
- "additionalProperties": false,
191
- "properties": {
192
- "top": {
193
- "type": "number",
194
- "minimum": 0
195
- },
196
- "right": {
197
- "type": "number",
198
- "minimum": 0
199
- },
200
- "bottom": {
201
- "type": "number",
202
- "minimum": 0
203
- },
204
- "left": {
205
- "type": "number",
206
- "minimum": 0
207
- }
208
- },
209
- "title": "Padding (detailed)",
210
- "description": "Padding in pixels to add to the bounds of the element."
211
- }
212
- }
213
- },
214
- "examples": [
215
- true,
216
- "image.png",
217
- "static/images/image.png",
218
- "/User/manny/projects/doc-detective/static/images/image.png",
219
- {
220
- "path": "image.png",
221
- "directory": "static/images",
222
- "maxVariation": 0.1,
223
- "overwrite": "aboveVariation",
224
- "crop": "#elementToScreenshot"
225
- },
226
- {
227
- "path": "image.png",
228
- "directory": "static/images",
229
- "maxVariation": 0.1,
230
- "overwrite": "aboveVariation"
231
- },
232
- {
233
- "path": "image.png",
234
- "directory": "static/images",
235
- "maxVariation": 0.1,
236
- "overwrite": "aboveVariation",
237
- "crop": {
238
- "selector": "#elementToScreenshot",
239
- "elementText": "Element text",
240
- "padding": {
241
- "top": 0,
242
- "right": 0,
243
- "bottom": 0,
244
- "left": 0
245
- }
246
- }
247
- }
248
- ]
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "screenshot",
4
+ "description": "Takes a screenshot in PNG format.",
5
+ "anyOf": [
6
+ {
7
+ "$ref": "#/components/schemas/path"
8
+ },
9
+ {
10
+ "$ref": "#/components/schemas/object"
11
+ },
12
+ {
13
+ "type": "boolean",
14
+ "title": "Capture screenshot",
15
+ "description": "If `true`, captures a screenshot. If `false`, doesn't capture a screenshot."
16
+ }
17
+ ],
18
+ "components": {
19
+ "schemas": {
20
+ "path": {
21
+ "title": "Screenshot (simple)",
22
+ "description": "File path of the PNG file. Accepts absolute paths. If not specified, the file name is the ID of the step.",
23
+ "type": "string",
24
+ "pattern": "([A-Za-z0-9_-]*\\.(png|PNG)$|\\$[A-Za-z0-9_]+)",
25
+ "transform": [
26
+ "trim"
27
+ ]
28
+ },
29
+ "object": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "properties": {
33
+ "path": {
34
+ "$ref": "#/components/schemas/path"
35
+ },
36
+ "directory": {
37
+ "type": "string",
38
+ "description": "Directory of the PNG file. If the directory doesn't exist, creates the directory.",
39
+ "transform": [
40
+ "trim"
41
+ ]
42
+ },
43
+ "maxVariation": {
44
+ "type": "number",
45
+ "description": "Allowed variation in percentage of pixels between the new screenshot and the existing screenshot at `path`. If the difference between the new screenshot and the existing screenshot is greater than `maxVariation`, the step fails. If a screenshot doesn't exist at `path`, this value is ignored.",
46
+ "default": 0.05,
47
+ "minimum": 0,
48
+ "maximum": 1
49
+ },
50
+ "overwrite": {
51
+ "type": "string",
52
+ "description": "If `true`, overwrites the existing screenshot at `path` if it exists.\nIf `aboveVariation`, overwrites the existing screenshot at `path` if the difference between the new screenshot and the existing screenshot is greater than `maxVariation`.",
53
+ "enum": [
54
+ "true",
55
+ "false",
56
+ "aboveVariation"
57
+ ],
58
+ "default": "aboveVariation"
59
+ },
60
+ "crop": {
61
+ "anyOf": [
62
+ {
63
+ "title": "Crop by element (simple)",
64
+ "type": "string",
65
+ "description": "Display text or selector of the element to screenshot."
66
+ },
67
+ {
68
+ "$ref": "#/components/schemas/crop_element"
69
+ }
70
+ ]
71
+ },
72
+ "sourceIntegration": {
73
+ "description": "Information about the source integration for this screenshot, enabling upload of changed files back to the source CMS. Set automatically during test resolution for files from integrations.",
74
+ "$ref": "sourceIntegration_v3.schema.json#"
75
+ }
76
+ },
77
+ "title": "Capture screenshot (detailed)"
78
+ },
79
+ "crop_element": {
80
+ "title": "Crop by element (detailed)",
81
+ "type": "object",
82
+ "description": "Crop the screenshot to a specific element.",
83
+ "additionalProperties": false,
84
+ "anyOf": [
85
+ {
86
+ "required": [
87
+ "selector"
88
+ ]
89
+ },
90
+ {
91
+ "required": [
92
+ "elementText"
93
+ ]
94
+ },
95
+ {
96
+ "required": [
97
+ "elementId"
98
+ ]
99
+ },
100
+ {
101
+ "required": [
102
+ "elementTestId"
103
+ ]
104
+ },
105
+ {
106
+ "required": [
107
+ "elementClass"
108
+ ]
109
+ },
110
+ {
111
+ "required": [
112
+ "elementAttribute"
113
+ ]
114
+ },
115
+ {
116
+ "required": [
117
+ "elementAria"
118
+ ]
119
+ }
120
+ ],
121
+ "properties": {
122
+ "elementText": {
123
+ "type": "string",
124
+ "description": "Display text of the element to screenshot."
125
+ },
126
+ "selector": {
127
+ "type": "string",
128
+ "description": "Selector of the element to screenshot."
129
+ },
130
+ "elementId": {
131
+ "type": "string",
132
+ "description": "ID attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax."
133
+ },
134
+ "elementTestId": {
135
+ "type": "string",
136
+ "description": "data-testid attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax."
137
+ },
138
+ "elementClass": {
139
+ "anyOf": [
140
+ {
141
+ "type": "string"
142
+ },
143
+ {
144
+ "type": "array",
145
+ "items": {
146
+ "type": "string"
147
+ }
148
+ }
149
+ ],
150
+ "description": "Class or array of classes that the element must have. Each class supports exact match or regex pattern using /pattern/ syntax. Element must have all specified classes."
151
+ },
152
+ "elementAttribute": {
153
+ "type": "object",
154
+ "description": "Object of attribute key-value pairs that the element must have. Values can be strings (supporting /pattern/ regex), numbers, or booleans. Boolean true matches attribute presence, false matches absence.",
155
+ "additionalProperties": {
156
+ "anyOf": [
157
+ {
158
+ "type": "string"
159
+ },
160
+ {
161
+ "type": "number"
162
+ },
163
+ {
164
+ "type": "boolean"
165
+ }
166
+ ]
167
+ }
168
+ },
169
+ "elementAria": {
170
+ "type": "string",
171
+ "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax."
172
+ },
173
+ "padding": {
174
+ "anyOf": [
175
+ {
176
+ "title": "Padding (simple)",
177
+ "type": "number",
178
+ "description": "Padding in pixels to add to the bounds of the element.",
179
+ "minimum": 0
180
+ },
181
+ {
182
+ "$ref": "#/components/schemas/padding"
183
+ }
184
+ ]
185
+ }
186
+ }
187
+ },
188
+ "padding": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "properties": {
192
+ "top": {
193
+ "type": "number",
194
+ "minimum": 0
195
+ },
196
+ "right": {
197
+ "type": "number",
198
+ "minimum": 0
199
+ },
200
+ "bottom": {
201
+ "type": "number",
202
+ "minimum": 0
203
+ },
204
+ "left": {
205
+ "type": "number",
206
+ "minimum": 0
207
+ }
208
+ },
209
+ "title": "Padding (detailed)",
210
+ "description": "Padding in pixels to add to the bounds of the element."
211
+ }
212
+ }
213
+ },
214
+ "examples": [
215
+ true,
216
+ "image.png",
217
+ "static/images/image.png",
218
+ "/User/manny/projects/doc-detective/static/images/image.png",
219
+ {
220
+ "path": "image.png",
221
+ "directory": "static/images",
222
+ "maxVariation": 0.1,
223
+ "overwrite": "aboveVariation",
224
+ "crop": "#elementToScreenshot"
225
+ },
226
+ {
227
+ "path": "image.png",
228
+ "directory": "static/images",
229
+ "maxVariation": 0.1,
230
+ "overwrite": "aboveVariation"
231
+ },
232
+ {
233
+ "path": "image.png",
234
+ "directory": "static/images",
235
+ "maxVariation": 0.1,
236
+ "overwrite": "aboveVariation",
237
+ "crop": {
238
+ "selector": "#elementToScreenshot",
239
+ "elementText": "Element text",
240
+ "padding": {
241
+ "top": 0,
242
+ "right": 0,
243
+ "bottom": 0,
244
+ "left": 0
245
+ }
246
+ }
247
+ }
248
+ ]
249
249
  }
@@ -1,38 +1,38 @@
1
- {
2
- "title": "setVariables",
3
- "type": "object",
4
- "description": "Load environment variables from a `.env` file.",
5
- "properties": {
6
- "id": {
7
- "type": "string",
8
- "description": "ID of the step."
9
- },
10
- "description": {
11
- "type": "string",
12
- "description": "Description of the step."
13
- },
14
- "action": {
15
- "type": "string",
16
- "const": "setVariables",
17
- "description": "Action to perform."
18
- },
19
- "path": {
20
- "type": "string",
21
- "description": "Path to the `.env` file."
22
- }
23
- },
24
- "dynamicDefaults": {
25
- "id": "uuid"
26
- },
27
- "required": [
28
- "action",
29
- "path"
30
- ],
31
- "additionalProperties": false,
32
- "examples": [
33
- {
34
- "action": "setVariables",
35
- "path": ".env"
36
- }
37
- ]
1
+ {
2
+ "title": "setVariables",
3
+ "type": "object",
4
+ "description": "Load environment variables from a `.env` file.",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "description": "ID of the step."
9
+ },
10
+ "description": {
11
+ "type": "string",
12
+ "description": "Description of the step."
13
+ },
14
+ "action": {
15
+ "type": "string",
16
+ "const": "setVariables",
17
+ "description": "Action to perform."
18
+ },
19
+ "path": {
20
+ "type": "string",
21
+ "description": "Path to the `.env` file."
22
+ }
23
+ },
24
+ "dynamicDefaults": {
25
+ "id": "uuid"
26
+ },
27
+ "required": [
28
+ "action",
29
+ "path"
30
+ ],
31
+ "additionalProperties": false,
32
+ "examples": [
33
+ {
34
+ "action": "setVariables",
35
+ "path": ".env"
36
+ }
37
+ ]
38
38
  }
@@ -1,45 +1,45 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "sourceIntegration",
4
- "description": "Information about the source integration for a file, enabling upload of changed files back to the source CMS.",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": ["type", "integrationName"],
8
- "properties": {
9
- "type": {
10
- "type": "string",
11
- "description": "The type of integration. Currently supported: 'heretto'. Additional types may be added in the future.",
12
- "enum": ["heretto"]
13
- },
14
- "integrationName": {
15
- "type": "string",
16
- "description": "The name of the integration configuration in the config file. Used to look up authentication credentials."
17
- },
18
- "fileId": {
19
- "type": "string",
20
- "description": "The unique identifier (UUID) of the file in the source CMS. If not provided, the file will be looked up by path."
21
- },
22
- "filePath": {
23
- "type": "string",
24
- "description": "The path of the file in the source CMS. Used for lookup if fileId is not available."
25
- },
26
- "contentPath": {
27
- "type": "string",
28
- "description": "The local path to the file that references this source. Used for resolving relative paths."
29
- }
30
- },
31
- "examples": [
32
- {
33
- "type": "heretto",
34
- "integrationName": "my-heretto",
35
- "fileId": "8f3ed200-cbba-11e1-ac51-c82a1446d15c",
36
- "filePath": "/db/organizations/example/repositories/docs/images/screenshot.png"
37
- },
38
- {
39
- "type": "heretto",
40
- "integrationName": "my-heretto",
41
- "filePath": "images/screenshot.png",
42
- "contentPath": "/tmp/doc-detective/heretto_abc123/topic.dita"
43
- }
44
- ]
45
- }
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "sourceIntegration",
4
+ "description": "Information about the source integration for a file, enabling upload of changed files back to the source CMS.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["type", "integrationName"],
8
+ "properties": {
9
+ "type": {
10
+ "type": "string",
11
+ "description": "The type of integration. Currently supported: 'heretto'. Additional types may be added in the future.",
12
+ "enum": ["heretto"]
13
+ },
14
+ "integrationName": {
15
+ "type": "string",
16
+ "description": "The name of the integration configuration in the config file. Used to look up authentication credentials."
17
+ },
18
+ "fileId": {
19
+ "type": "string",
20
+ "description": "The unique identifier (UUID) of the file in the source CMS. If not provided, the file will be looked up by path."
21
+ },
22
+ "filePath": {
23
+ "type": "string",
24
+ "description": "The path of the file in the source CMS. Used for lookup if fileId is not available."
25
+ },
26
+ "contentPath": {
27
+ "type": "string",
28
+ "description": "The local path to the file that references this source. Used for resolving relative paths."
29
+ }
30
+ },
31
+ "examples": [
32
+ {
33
+ "type": "heretto",
34
+ "integrationName": "my-heretto",
35
+ "fileId": "8f3ed200-cbba-11e1-ac51-c82a1446d15c",
36
+ "filePath": "/db/organizations/example/repositories/docs/images/screenshot.png"
37
+ },
38
+ {
39
+ "type": "heretto",
40
+ "integrationName": "my-heretto",
41
+ "filePath": "images/screenshot.png",
42
+ "contentPath": "/tmp/doc-detective/heretto_abc123/topic.dita"
43
+ }
44
+ ]
45
+ }