testeranto 0.166.0 → 0.171.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 (187) hide show
  1. package/dist/common/src/NavBar.js +45 -0
  2. package/dist/common/src/PM/main.js +81 -59
  3. package/dist/common/src/Pure.js +17 -15
  4. package/dist/common/src/ReportServer.js +48 -5
  5. package/dist/common/src/Web.js +35 -20
  6. package/dist/common/src/components/SunriseAnimation.test/implementation.js +1 -0
  7. package/dist/common/src/components/SunriseAnimation.test/index.js +1 -0
  8. package/dist/common/src/components/SunriseAnimation.test/interface.js +1 -0
  9. package/dist/common/src/components/SunriseAnimation.test/specification.js +1 -0
  10. package/dist/common/src/components/TestStatusBadge.js +55 -0
  11. package/dist/common/src/components/pure/ProjectPageView.js +204 -0
  12. package/dist/common/src/components/pure/ProjectPageView.test/adapter.js +20 -0
  13. package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +71 -0
  14. package/dist/common/src/components/pure/ProjectPageView.test/index.js +10 -0
  15. package/dist/common/src/components/pure/ProjectPageView.test/specification.js +19 -0
  16. package/dist/common/src/components/pure/ProjectPageView.test/types.js +2 -0
  17. package/dist/common/src/lib/BaseSuite.js +3 -3
  18. package/dist/common/src/lib/BaseSuite.test/test.js +1 -1
  19. package/dist/common/src/lib/abstractBase.js +41 -14
  20. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
  21. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
  22. package/dist/common/src/lib/basebuilder.js +9 -7
  23. package/dist/common/src/lib/core.test/MockCore.js +17 -15
  24. package/dist/common/src/lib/pmProxy.js +185 -64
  25. package/dist/common/testeranto.config.js +6 -0
  26. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  27. package/dist/module/src/App.js +3 -3
  28. package/dist/module/src/PM/main.js +81 -59
  29. package/dist/module/src/ProjectsPage.js +1 -110
  30. package/dist/module/src/Pure.js +17 -15
  31. package/dist/module/src/ReportServer.js +48 -5
  32. package/dist/module/src/TestPage.js +45 -16
  33. package/dist/module/src/Web.js +35 -20
  34. package/dist/module/src/components/SunriseAnimation.test/implementation.js +1 -0
  35. package/dist/module/src/components/SunriseAnimation.test/index.js +1 -0
  36. package/dist/module/src/components/SunriseAnimation.test/interface.js +1 -0
  37. package/dist/module/src/components/SunriseAnimation.test/specification.js +1 -0
  38. package/dist/module/src/components/pure/ProjectPageView.js +197 -0
  39. package/dist/module/src/components/pure/ProjectPageView.test/adapter.js +17 -0
  40. package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +68 -0
  41. package/dist/module/src/components/pure/ProjectPageView.test/index.js +5 -0
  42. package/dist/module/src/components/pure/ProjectPageView.test/specification.js +15 -0
  43. package/dist/module/src/components/pure/ProjectPageView.test/types.js +1 -0
  44. package/dist/module/src/components/pure/ProjectsPageView.js +58 -0
  45. package/dist/module/src/components/pure/TestPageView.js +136 -0
  46. package/dist/module/src/components/stateful/ProjectPage.js +63 -0
  47. package/dist/module/src/components/stateful/ProjectsPage.js +55 -0
  48. package/dist/module/src/components/stateful/TestPage.js +82 -0
  49. package/dist/module/src/lib/BaseSuite.js +3 -3
  50. package/dist/module/src/lib/BaseSuite.test/test.js +1 -1
  51. package/dist/module/src/lib/abstractBase.js +41 -14
  52. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
  53. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
  54. package/dist/module/src/lib/basebuilder.js +9 -7
  55. package/dist/module/src/lib/core.test/MockCore.js +17 -15
  56. package/dist/module/src/lib/pmProxy.js +185 -64
  57. package/dist/module/testeranto.config.js +6 -0
  58. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  59. package/dist/prebuild/App.js +541 -495
  60. package/dist/prebuild/ReportServer.mjs +44 -4
  61. package/dist/prebuild/run.mjs +67 -39
  62. package/dist/types/src/NavBar.d.ts +19 -0
  63. package/dist/types/src/PM/index.d.ts +3 -1
  64. package/dist/types/src/PM/main.d.ts +0 -4
  65. package/dist/types/src/PM/node.d.ts +2 -2
  66. package/dist/types/src/components/SunriseAnimation.test/interface.d.ts +0 -0
  67. package/dist/types/src/components/SunriseAnimation.test/specification.d.ts +0 -0
  68. package/dist/types/src/components/TestStatusBadge.d.ts +15 -0
  69. package/dist/types/src/components/pure/ProjectPageView.d.ts +14 -0
  70. package/dist/types/src/components/pure/ProjectPageView.test/adapter.d.ts +3 -0
  71. package/dist/types/src/components/pure/ProjectPageView.test/implementation.d.ts +3 -0
  72. package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +3 -0
  73. package/dist/types/src/components/pure/ProjectPageView.test/specification.d.ts +3 -0
  74. package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +39 -0
  75. package/dist/types/src/lib/BaseSuite.d.ts +2 -0
  76. package/dist/types/src/lib/abstractBase.d.ts +12 -0
  77. package/dist/types/src/lib/index.d.ts +0 -1
  78. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  79. package/package.json +3 -2
  80. package/src/App.tsx +5 -9
  81. package/src/PM/index.ts +1 -1
  82. package/src/PM/main.ts +87 -82
  83. package/src/PM/node.ts +2 -2
  84. package/src/ProjectsPage.tsx +1 -164
  85. package/src/Pure.ts +17 -17
  86. package/src/ReportServer.ts +49 -6
  87. package/src/TestPage.tsx +78 -5
  88. package/src/Web.ts +35 -35
  89. package/src/components/SunriseAnimation.test/implementation.ts +0 -0
  90. package/src/components/SunriseAnimation.test/index.ts +0 -0
  91. package/src/components/SunriseAnimation.test/interface.ts +0 -0
  92. package/src/components/SunriseAnimation.test/specification.ts +0 -0
  93. package/src/components/pure/ProjectPageView.test/adapter.ts +21 -0
  94. package/src/components/pure/ProjectPageView.test/implementation.tsx +84 -0
  95. package/src/components/pure/ProjectPageView.test/index.ts +8 -0
  96. package/src/components/pure/ProjectPageView.test/specification.ts +31 -0
  97. package/src/components/pure/ProjectPageView.test/types.ts +55 -0
  98. package/src/components/pure/ProjectPageView.tsx +332 -0
  99. package/src/components/pure/ProjectsPageView.tsx +99 -0
  100. package/src/components/pure/TestPageView.tsx +278 -0
  101. package/src/components/stateful/ProjectPage.tsx +83 -0
  102. package/src/components/stateful/ProjectsPage.tsx +73 -0
  103. package/src/components/stateful/TestPage.tsx +107 -0
  104. package/src/lib/BaseSuite.test/test.ts +1 -1
  105. package/src/lib/BaseSuite.ts +9 -4
  106. package/src/lib/abstractBase.ts +45 -14
  107. package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +1 -1
  108. package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +1 -1
  109. package/src/lib/basebuilder.ts +9 -9
  110. package/src/lib/core.test/MockCore.ts +26 -19
  111. package/src/lib/index.ts +1 -1
  112. package/src/lib/pmProxy.ts +184 -87
  113. package/testeranto/App.js +541 -495
  114. package/testeranto/bundles/node/allTests/{chunk-4ONUZRZ4.mjs → chunk-3EUGBAOM.mjs} +1 -1
  115. package/testeranto/bundles/node/allTests/{chunk-FFBRDUBH.mjs → chunk-E75CSRER.mjs} +247 -124
  116. package/testeranto/bundles/node/allTests/{chunk-NQEP7SN4.mjs → chunk-M6DO7VMB.mjs} +1 -1
  117. package/testeranto/bundles/node/allTests/metafile.json +41 -41
  118. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +4 -4
  119. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +4 -4
  120. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +3 -3
  121. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +11 -23
  122. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +2 -2
  123. package/testeranto/bundles/pure/allTests/{chunk-CSMXYJ65.mjs → chunk-KHDVEHF7.mjs} +3 -18
  124. package/testeranto/bundles/pure/allTests/{chunk-QK4IXLF6.mjs → chunk-VMUSFSZM.mjs} +247 -124
  125. package/testeranto/bundles/pure/allTests/metafile.json +77 -47
  126. package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +2 -2
  127. package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +3 -3
  128. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +3 -30
  129. package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +2283 -0
  130. package/testeranto/bundles/web/allTests/{chunk-TU3MJSSI.mjs → chunk-RLDR6LJN.mjs} +302 -127
  131. package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +997 -0
  132. package/testeranto/bundles/web/allTests/metafile.json +15065 -46
  133. package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.html +19 -0
  134. package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.mjs +37524 -0
  135. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +20 -2
  136. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +27 -3
  137. package/testeranto/reports/allTests/config.json +8 -0
  138. package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +9 -3
  139. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +1 -0
  140. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +13 -0
  141. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +50 -0
  142. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
  143. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +17 -0
  144. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +32 -0
  145. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +68 -0
  146. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -0
  147. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +6 -3
  148. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +8 -1
  149. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +6 -3
  150. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +9 -3
  151. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -0
  152. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +2 -2
  153. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +6 -3
  154. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +10 -5
  155. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -0
  156. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +18 -9
  157. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +8 -1
  158. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +10 -5
  159. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -0
  160. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +2 -2
  161. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +18 -9
  162. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +10 -5
  163. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -0
  164. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +36 -18
  165. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +8 -1
  166. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -12
  167. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +2 -2
  168. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +11 -8
  169. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -0
  170. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +28 -14
  171. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +8 -1
  172. package/testeranto/reports/allTests/summary.json +16 -9
  173. package/testeranto/reportsweb_build_errors +25 -0
  174. package/testeranto.config.ts +7 -0
  175. package/tsc.log +313 -237
  176. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test/manifest.json +0 -1
  177. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/manifest.json +0 -1
  178. package/testeranto/reports/allTests/src/Pure.test/pure/manifest.json +0 -1
  179. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/manifest.json +0 -1
  180. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/manifest.json +0 -1
  181. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/manifest.json +0 -1
  182. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/manifest.json +0 -1
  183. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/manifest.json +0 -1
  184. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/manifest.json +0 -1
  185. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/manifest.json +0 -1
  186. /package/{testeranto/reports/allTests/src/Pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/implementation.d.ts} +0 -0
  187. /package/{testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/index.d.ts} +0 -0
@@ -0,0 +1,997 @@
1
+ import {
2
+ init_buffer,
3
+ init_dirname,
4
+ init_process
5
+ } from "./chunk-HPYA4YZC.mjs";
6
+
7
+ // src/lib/BaseSuite.ts
8
+ init_dirname();
9
+ init_buffer();
10
+ init_process();
11
+
12
+ // src/lib/pmProxy.ts
13
+ init_dirname();
14
+ init_buffer();
15
+ init_process();
16
+ var baseProxy = function(pm, mappings) {
17
+ return new Proxy(pm, {
18
+ get: (target, prop, receiver) => {
19
+ for (const mapping of mappings) {
20
+ const method = mapping[0];
21
+ const arger = mapping[1];
22
+ if (prop === method) {
23
+ return (...x) => target[prop](arger(...x));
24
+ }
25
+ }
26
+ return (...x) => target[prop](...x);
27
+ }
28
+ });
29
+ };
30
+ var butThenProxy = (pm, filepath) => {
31
+ return baseProxy(pm, [
32
+ [
33
+ "screencast",
34
+ (opts2, p) => {
35
+ const path = `${filepath}/butThen/${opts2.path}`;
36
+ console.log(`[Proxy] Captured artifact path for butThen:`, path);
37
+ if (pm.currentStep?.addArtifact) {
38
+ pm.currentStep.addArtifact(path);
39
+ } else {
40
+ console.warn("No currentStep or addArtifact method found");
41
+ }
42
+ return [
43
+ {
44
+ ...opts2,
45
+ path
46
+ },
47
+ p
48
+ ];
49
+ }
50
+ ],
51
+ ["createWriteStream", (fp) => {
52
+ const path = `${filepath}/butThen/${fp}`;
53
+ console.log(`[Proxy] Captured artifact path for butThen:`, path);
54
+ if (pm.currentStep?.addArtifact) {
55
+ pm.currentStep.addArtifact(path);
56
+ } else {
57
+ console.warn("No currentStep or addArtifact method found");
58
+ }
59
+ return [path];
60
+ }],
61
+ [
62
+ "writeFileSync",
63
+ (fp, contents) => {
64
+ const path = `${filepath}/butThen/${fp}`;
65
+ pm.currentStep?.artifacts?.push(path);
66
+ return [path, contents];
67
+ }
68
+ ],
69
+ [
70
+ "customScreenShot",
71
+ (opts2, p) => {
72
+ const path = `${filepath}/butThen/${opts2.path}`;
73
+ pm.currentStep?.artifacts?.push(path);
74
+ return [
75
+ {
76
+ ...opts2,
77
+ path
78
+ },
79
+ p
80
+ ];
81
+ }
82
+ ]
83
+ ]);
84
+ };
85
+ var andWhenProxy = (pm, filepath) => baseProxy(pm, [
86
+ [
87
+ "screencast",
88
+ (opts2, p) => {
89
+ const path = `${filepath}/andWhen/${opts2.path}`;
90
+ pm.currentStep?.artifacts?.push(path);
91
+ return [
92
+ {
93
+ ...opts2,
94
+ path
95
+ },
96
+ p
97
+ ];
98
+ }
99
+ ],
100
+ ["createWriteStream", (fp) => {
101
+ const path = `${filepath}/andWhen/${fp}`;
102
+ pm.currentStep?.artifacts?.push(path);
103
+ return [path];
104
+ }],
105
+ ["writeFileSync", (fp, contents) => {
106
+ const path = `${filepath}/andWhen/${fp}`;
107
+ pm.currentStep?.artifacts?.push(path);
108
+ return [path, contents];
109
+ }],
110
+ [
111
+ "customScreenShot",
112
+ (opts2, p) => {
113
+ const path = `${filepath}/andWhen/${opts2.path}`;
114
+ pm.currentStep?.artifacts?.push(path);
115
+ return [
116
+ {
117
+ ...opts2,
118
+ path
119
+ },
120
+ p
121
+ ];
122
+ }
123
+ ]
124
+ ]);
125
+ var afterEachProxy = (pm, suite, given) => baseProxy(pm, [
126
+ [
127
+ "screencast",
128
+ (opts2, p) => {
129
+ const path = `suite-${suite}/given-${given}/afterEach/${opts2.path}`;
130
+ pm.currentStep?.artifacts?.push(path);
131
+ return [
132
+ {
133
+ ...opts2,
134
+ path
135
+ },
136
+ p
137
+ ];
138
+ }
139
+ ],
140
+ ["createWriteStream", (fp) => {
141
+ const path = `suite-${suite}/afterEach/${fp}`;
142
+ pm.currentStep?.artifacts?.push(path);
143
+ return [path];
144
+ }],
145
+ [
146
+ "writeFileSync",
147
+ (fp, contents) => {
148
+ const path = `suite-${suite}/given-${given}/afterEach/${fp}`;
149
+ pm.currentStep?.artifacts?.push(path);
150
+ return [path, contents];
151
+ }
152
+ ],
153
+ [
154
+ "customScreenShot",
155
+ (opts2, p) => {
156
+ const path = `suite-${suite}/given-${given}/afterEach/${opts2.path}`;
157
+ pm.currentStep?.artifacts?.push(path);
158
+ return [
159
+ {
160
+ ...opts2,
161
+ path
162
+ },
163
+ p
164
+ ];
165
+ }
166
+ ]
167
+ ]);
168
+ var beforeEachProxy = (pm, suite) => baseProxy(pm, [
169
+ [
170
+ "screencast",
171
+ (opts2, p) => {
172
+ const path = `suite-${suite}/beforeEach/${opts2.path}`;
173
+ pm.currentStep?.artifacts?.push(path);
174
+ return [
175
+ {
176
+ ...opts2,
177
+ path
178
+ },
179
+ p
180
+ ];
181
+ }
182
+ ],
183
+ [
184
+ "writeFileSync",
185
+ (fp, contents) => {
186
+ const path = `suite-${suite}/beforeEach/${fp}`;
187
+ pm.currentStep?.artifacts?.push(path);
188
+ return [path, contents];
189
+ }
190
+ ],
191
+ [
192
+ "customScreenShot",
193
+ (opts2, p) => {
194
+ const path = `suite-${suite}/beforeEach/${opts2.path}`;
195
+ pm.currentStep?.artifacts?.push(path);
196
+ return [
197
+ {
198
+ ...opts2,
199
+ path
200
+ },
201
+ p
202
+ ];
203
+ }
204
+ ],
205
+ ["createWriteStream", (fp) => {
206
+ const path = `suite-${suite}/beforeEach/${fp}`;
207
+ pm.currentStep?.artifacts?.push(path);
208
+ return [path];
209
+ }]
210
+ ]);
211
+ var beforeAllProxy = (pm, suite) => baseProxy(pm, [
212
+ [
213
+ "writeFileSync",
214
+ (fp, contents) => {
215
+ const path = `suite-${suite}/beforeAll/${fp}`;
216
+ pm.currentStep?.artifacts?.push(path);
217
+ return [path, contents];
218
+ }
219
+ ],
220
+ [
221
+ "customScreenShot",
222
+ (opts2, p) => {
223
+ const path = `suite-${suite}/beforeAll/${opts2.path}`;
224
+ pm.currentStep?.artifacts?.push(path);
225
+ return [
226
+ {
227
+ ...opts2,
228
+ path
229
+ },
230
+ p
231
+ ];
232
+ }
233
+ ],
234
+ ["createWriteStream", (fp) => {
235
+ const path = `suite-${suite}/beforeAll/${fp}`;
236
+ pm.currentStep?.artifacts?.push(path);
237
+ return [path];
238
+ }]
239
+ ]);
240
+ var afterAllProxy = (pm, suite) => baseProxy(pm, [
241
+ ["createWriteStream", (fp) => {
242
+ const path = `suite-${suite}/afterAll/${fp}`;
243
+ pm.currentStep?.artifacts?.push(path);
244
+ return [path];
245
+ }],
246
+ [
247
+ "writeFileSync",
248
+ (fp, contents) => {
249
+ const path = `suite-${suite}/afterAll/${fp}`;
250
+ pm.currentStep?.artifacts?.push(path);
251
+ return [path, contents];
252
+ }
253
+ ],
254
+ [
255
+ "customScreenShot",
256
+ (opts2, p) => {
257
+ const path = `suite-${suite}/afterAll/${opts2.path}`;
258
+ pm.currentStep?.artifacts?.push(path);
259
+ return [
260
+ {
261
+ ...opts2,
262
+ path
263
+ },
264
+ p
265
+ ];
266
+ }
267
+ ]
268
+ ]);
269
+
270
+ // src/lib/BaseSuite.ts
271
+ var BaseSuite = class {
272
+ constructor(name, index, givens = {}) {
273
+ const suiteName = name || "testSuite";
274
+ if (!suiteName) {
275
+ throw new Error("BaseSuite requires a non-empty name");
276
+ }
277
+ console.log(
278
+ "[DEBUG] BaseSuite constructor - name:",
279
+ suiteName,
280
+ "index:",
281
+ index
282
+ );
283
+ this.name = suiteName;
284
+ this.index = index;
285
+ this.givens = givens;
286
+ this.fails = 0;
287
+ console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
288
+ console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
289
+ }
290
+ features() {
291
+ try {
292
+ const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
293
+ return array.indexOf(value) === index;
294
+ });
295
+ console.debug("[DEBUG] Features extracted:", features.toString());
296
+ return features || [];
297
+ } catch (e) {
298
+ console.error("[ERROR] Failed to extract features:", e);
299
+ return [];
300
+ }
301
+ }
302
+ toObj() {
303
+ const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
304
+ return {
305
+ name: this.name,
306
+ givens,
307
+ fails: this.fails,
308
+ failed: this.failed,
309
+ features: this.features()
310
+ };
311
+ }
312
+ setup(s, artifactory, tr, pm) {
313
+ return new Promise((res) => res(s));
314
+ }
315
+ assertThat(t) {
316
+ return !!t;
317
+ }
318
+ afterAll(store, artifactory, pm) {
319
+ return store;
320
+ }
321
+ async run(input, testResourceConfiguration, artifactory, tLog, pm) {
322
+ this.testResourceConfiguration = testResourceConfiguration;
323
+ const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
324
+ tLog("\nSuite:", this.index, this.name);
325
+ const sNdx = this.index;
326
+ const subject = await this.setup(
327
+ input,
328
+ suiteArtifactory,
329
+ testResourceConfiguration,
330
+ beforeAllProxy(pm, sNdx.toString())
331
+ );
332
+ for (const [gKey, g] of Object.entries(this.givens)) {
333
+ const giver = this.givens[gKey];
334
+ this.store = await giver.give(
335
+ subject,
336
+ gKey,
337
+ testResourceConfiguration,
338
+ this.assertThat,
339
+ suiteArtifactory,
340
+ tLog,
341
+ pm,
342
+ sNdx
343
+ ).catch((e) => {
344
+ this.failed = true;
345
+ this.fails = this.fails + 1;
346
+ throw e;
347
+ });
348
+ }
349
+ try {
350
+ this.afterAll(
351
+ this.store,
352
+ artifactory,
353
+ afterAllProxy(pm, sNdx.toString())
354
+ );
355
+ } catch (e) {
356
+ console.error(e);
357
+ }
358
+ return this;
359
+ }
360
+ };
361
+
362
+ // src/Web.ts
363
+ init_dirname();
364
+ init_buffer();
365
+ init_process();
366
+
367
+ // src/PM/web.ts
368
+ init_dirname();
369
+ init_buffer();
370
+ init_process();
371
+
372
+ // src/PM/index.ts
373
+ init_dirname();
374
+ init_buffer();
375
+ init_process();
376
+ var PM = class {
377
+ };
378
+
379
+ // src/PM/web.ts
380
+ var PM_Web = class extends PM {
381
+ constructor(t) {
382
+ super();
383
+ this.testResourceConfiguration = t;
384
+ }
385
+ start() {
386
+ return new Promise((r) => r());
387
+ }
388
+ stop() {
389
+ return new Promise((r) => r());
390
+ }
391
+ getInnerHtml(selector, page2) {
392
+ throw new Error("web.ts getInnHtml not implemented");
393
+ }
394
+ pages() {
395
+ throw new Error("Method not implemented.");
396
+ }
397
+ stopSideCar(n) {
398
+ return window["stopSideCar"](n, this.testResourceConfiguration.name);
399
+ }
400
+ launchSideCar(n) {
401
+ return window["launchSideCar"](n, this.testResourceConfiguration.name);
402
+ }
403
+ waitForSelector(p, s) {
404
+ return window["waitForSelector"](p, s);
405
+ }
406
+ screencast(o, p) {
407
+ return window["screencast"](
408
+ {
409
+ ...opts,
410
+ path: this.testResourceConfiguration.fs + "/" + opts.path
411
+ },
412
+ page.mainFrame()._id,
413
+ this.testResourceConfiguration.name
414
+ );
415
+ }
416
+ screencastStop(recorder) {
417
+ return window["screencastStop"](recorder);
418
+ }
419
+ closePage(p) {
420
+ return window["closePage"](p);
421
+ }
422
+ goto(p, url) {
423
+ return window["goto"](p, url);
424
+ }
425
+ newPage() {
426
+ return window["newPage"]();
427
+ }
428
+ $(selector) {
429
+ return window["$"](selector);
430
+ }
431
+ isDisabled(selector) {
432
+ return window["isDisabled"](selector);
433
+ }
434
+ getAttribute(selector, attribute) {
435
+ return window["getAttribute"](selector, attribute);
436
+ }
437
+ getValue(selector) {
438
+ return window["getValue"](selector);
439
+ }
440
+ focusOn(selector) {
441
+ return window["focusOn"](selector);
442
+ }
443
+ typeInto(value) {
444
+ return window["typeInto"](value);
445
+ }
446
+ async page(x) {
447
+ return window["page"](x);
448
+ }
449
+ click(selector) {
450
+ return window["click"](selector);
451
+ }
452
+ customScreenShot(x, y) {
453
+ const opts2 = x[0];
454
+ const page2 = x[1];
455
+ console.log("customScreenShot 2 opts", opts2);
456
+ console.log("customScreenShot 2 page", page2);
457
+ return window["customScreenShot"](
458
+ {
459
+ ...opts2,
460
+ path: this.testResourceConfiguration.fs + "/" + opts2.path
461
+ },
462
+ this.testResourceConfiguration.name,
463
+ page2
464
+ );
465
+ }
466
+ existsSync(destFolder) {
467
+ return window["existsSync"](destFolder);
468
+ }
469
+ mkdirSync(x) {
470
+ return window["mkdirSync"](this.testResourceConfiguration.fs + "/");
471
+ }
472
+ write(uid, contents) {
473
+ return window["write"](uid, contents);
474
+ }
475
+ writeFileSync(filepath, contents) {
476
+ return window["writeFileSync"](
477
+ this.testResourceConfiguration.fs + "/" + filepath,
478
+ contents,
479
+ this.testResourceConfiguration.name
480
+ );
481
+ }
482
+ createWriteStream(filepath) {
483
+ return window["createWriteStream"](
484
+ this.testResourceConfiguration.fs + "/" + filepath,
485
+ this.testResourceConfiguration.name
486
+ );
487
+ }
488
+ end(uid) {
489
+ return window["end"](uid);
490
+ }
491
+ customclose() {
492
+ window["customclose"](
493
+ this.testResourceConfiguration.fs,
494
+ this.testResourceConfiguration.name
495
+ );
496
+ }
497
+ testArtiFactoryfileWriter(tLog, callback) {
498
+ return (fPath, value) => {
499
+ callback(
500
+ new Promise((res, rej) => {
501
+ tLog("testArtiFactory =>", fPath);
502
+ })
503
+ );
504
+ };
505
+ }
506
+ };
507
+
508
+ // src/lib/core.ts
509
+ init_dirname();
510
+ init_buffer();
511
+ init_process();
512
+
513
+ // src/lib/index.ts
514
+ init_dirname();
515
+ init_buffer();
516
+ init_process();
517
+ var BaseAdapter = () => ({
518
+ beforeAll: async (s) => s,
519
+ beforeEach: async function(subject, initialValues, x, testResource, pm) {
520
+ return subject;
521
+ },
522
+ afterEach: async (s) => s,
523
+ afterAll: (store) => void 0,
524
+ butThen: async (store, thenCb) => {
525
+ return thenCb(store);
526
+ },
527
+ andWhen: async (store, whenCB, testResource, pm) => {
528
+ try {
529
+ await whenCB(store, testResource, pm);
530
+ } catch (error) {
531
+ console.error("Error in andWhen:", error);
532
+ throw error;
533
+ }
534
+ },
535
+ assertThis: (x) => x
536
+ });
537
+ var DefaultAdapter = (p) => {
538
+ return {
539
+ ...BaseAdapter,
540
+ ...p
541
+ };
542
+ };
543
+ var defaultTestResourceRequirement = {
544
+ ports: 0
545
+ };
546
+
547
+ // src/lib/abstractBase.ts
548
+ init_dirname();
549
+ init_buffer();
550
+ init_process();
551
+ var BaseGiven = class {
552
+ constructor(name, features, whens, thens, givenCB, initialValues) {
553
+ this.artifacts = [];
554
+ this.name = name;
555
+ this.features = features;
556
+ this.whens = whens;
557
+ this.thens = thens;
558
+ this.givenCB = givenCB;
559
+ this.initialValues = initialValues;
560
+ }
561
+ addArtifact(path) {
562
+ console.log(`[Artifact] Adding to ${this.constructor.name}:`, path);
563
+ this.artifacts.push(path);
564
+ }
565
+ beforeAll(store) {
566
+ return store;
567
+ }
568
+ toObj() {
569
+ return {
570
+ key: this.key,
571
+ name: this.name,
572
+ whens: this.whens.map((w) => {
573
+ if (w && w.toObj)
574
+ return w.toObj();
575
+ console.error("w is not as expected!", w.toString());
576
+ return {};
577
+ }),
578
+ thens: this.thens.map((t) => t.toObj()),
579
+ error: this.error ? [this.error, this.error.stack] : null,
580
+ failed: this.failed,
581
+ features: this.features,
582
+ artifacts: this.artifacts
583
+ };
584
+ }
585
+ async afterEach(store, key, artifactory, pm) {
586
+ return store;
587
+ }
588
+ async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
589
+ this.key = key;
590
+ tLog(`
591
+ ${this.key}`);
592
+ tLog(`
593
+ Given: ${this.name}`);
594
+ const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
595
+ this.uberCatcher((e) => {
596
+ console.error(e.toString());
597
+ this.error = e.error;
598
+ tLog(e.stack);
599
+ });
600
+ try {
601
+ const proxiedPm = beforeEachProxy(pm, suiteNdx.toString());
602
+ console.log(`[Given] Setting currentStep for beforeEach:`, this.name);
603
+ proxiedPm.currentStep = this;
604
+ this.store = await this.givenThat(
605
+ subject,
606
+ testResourceConfiguration,
607
+ givenArtifactory,
608
+ this.givenCB,
609
+ this.initialValues,
610
+ proxiedPm
611
+ );
612
+ } catch (e) {
613
+ console.error("Given failure: ", e.toString());
614
+ this.error = e;
615
+ throw e;
616
+ }
617
+ try {
618
+ for (const [whenNdx, whenStep] of this.whens.entries()) {
619
+ await whenStep.test(
620
+ this.store,
621
+ testResourceConfiguration,
622
+ tLog,
623
+ pm,
624
+ `suite-${suiteNdx}/given-${key}/when/${whenNdx}`
625
+ );
626
+ }
627
+ for (const [thenNdx, thenStep] of this.thens.entries()) {
628
+ const t = await thenStep.test(
629
+ this.store,
630
+ testResourceConfiguration,
631
+ tLog,
632
+ pm,
633
+ `suite-${suiteNdx}/given-${key}/then-${thenNdx}`
634
+ );
635
+ tester(t);
636
+ }
637
+ } catch (e) {
638
+ this.failed = true;
639
+ tLog(e.stack);
640
+ throw e;
641
+ } finally {
642
+ try {
643
+ await this.afterEach(
644
+ this.store,
645
+ this.key,
646
+ givenArtifactory,
647
+ afterEachProxy(pm, suiteNdx.toString(), key)
648
+ );
649
+ } catch (e) {
650
+ console.error("afterEach failed!", e.toString());
651
+ this.failed = e;
652
+ throw e;
653
+ }
654
+ }
655
+ return this.store;
656
+ }
657
+ };
658
+ var BaseWhen = class {
659
+ constructor(name, whenCB) {
660
+ this.artifacts = [];
661
+ this.name = name;
662
+ this.whenCB = whenCB;
663
+ }
664
+ toObj() {
665
+ console.log("toObj error", this.error);
666
+ if (this.error) {
667
+ return {
668
+ name: this.name,
669
+ error: this.error && this.error.name + this.error.stack,
670
+ artifacts: this.artifacts
671
+ };
672
+ } else {
673
+ return {
674
+ name: this.name,
675
+ artifacts: this.artifacts
676
+ };
677
+ }
678
+ }
679
+ async test(store, testResourceConfiguration, tLog, pm, filepath) {
680
+ try {
681
+ tLog(" When:", this.name);
682
+ console.debug("[DEBUG] Executing When step:", this.name.toString());
683
+ const proxiedPm = andWhenProxy(pm, filepath);
684
+ console.log(`[When] Setting currentStep for andWhen:`, this.name);
685
+ proxiedPm.currentStep = this;
686
+ const result = await this.andWhen(
687
+ store,
688
+ this.whenCB,
689
+ testResourceConfiguration,
690
+ proxiedPm
691
+ );
692
+ console.debug("[DEBUG] When step completed:", this.name.toString());
693
+ return result;
694
+ } catch (e) {
695
+ console.error(
696
+ "[ERROR] When step failed:",
697
+ this.name.toString(),
698
+ e.toString()
699
+ );
700
+ this.error = e;
701
+ throw e;
702
+ }
703
+ }
704
+ };
705
+ var BaseThen = class {
706
+ constructor(name, thenCB) {
707
+ this.artifacts = [];
708
+ this.name = name;
709
+ this.thenCB = thenCB;
710
+ this.error = false;
711
+ }
712
+ toObj() {
713
+ return {
714
+ name: this.name,
715
+ error: this.error,
716
+ artifacts: this.artifacts
717
+ };
718
+ }
719
+ async test(store, testResourceConfiguration, tLog, pm, filepath) {
720
+ const proxiedPm = butThenProxy(pm, filepath);
721
+ console.log(`[Then] Setting currentStep for butThen:`, this.name);
722
+ proxiedPm.currentStep = this;
723
+ return this.butThen(
724
+ store,
725
+ async (s) => {
726
+ if (typeof this.thenCB === "function") {
727
+ return await this.thenCB(s, proxiedPm);
728
+ } else {
729
+ return this.thenCB;
730
+ }
731
+ },
732
+ testResourceConfiguration,
733
+ butThenProxy(pm, filepath)
734
+ ).catch((e) => {
735
+ this.error = e.toString();
736
+ });
737
+ }
738
+ };
739
+
740
+ // src/lib/classBuilder.ts
741
+ init_dirname();
742
+ init_buffer();
743
+ init_process();
744
+
745
+ // src/lib/basebuilder.ts
746
+ init_dirname();
747
+ init_buffer();
748
+ init_process();
749
+ var BaseBuilder = class {
750
+ constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, testResourceRequirement, testSpecification) {
751
+ this.artifacts = [];
752
+ this.artifacts = [];
753
+ this.testResourceRequirement = testResourceRequirement;
754
+ this.suitesOverrides = suitesOverrides;
755
+ this.givenOverides = givenOverides;
756
+ this.whenOverides = whenOverides;
757
+ this.thenOverides = thenOverides;
758
+ this.testSpecification = testSpecification;
759
+ this.specs = testSpecification(
760
+ this.Suites(),
761
+ this.Given(),
762
+ this.When(),
763
+ this.Then()
764
+ );
765
+ this.testJobs = this.specs.map((suite) => {
766
+ const suiteRunner = (suite2) => async (puppetMaster, tLog) => {
767
+ const x = await suite2.run(
768
+ input,
769
+ puppetMaster.testResourceConfiguration,
770
+ (fPath, value) => puppetMaster.testArtiFactoryfileWriter(
771
+ tLog,
772
+ (p) => {
773
+ this.artifacts.push(p);
774
+ }
775
+ )(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
776
+ tLog,
777
+ puppetMaster
778
+ );
779
+ return x;
780
+ };
781
+ const runner = suiteRunner(suite);
782
+ return {
783
+ test: suite,
784
+ toObj: () => {
785
+ return suite.toObj();
786
+ },
787
+ runner,
788
+ receiveTestResourceConfig: async function(puppetMaster) {
789
+ const tLog = async (...l) => {
790
+ };
791
+ const suiteDone = await runner(puppetMaster, tLog);
792
+ const fails = suiteDone.fails;
793
+ await puppetMaster.writeFileSync(`bdd_errors.txt`, fails.toString());
794
+ await puppetMaster.writeFileSync(
795
+ `tests.json`,
796
+ JSON.stringify(this.toObj(), null, 2)
797
+ );
798
+ return {
799
+ failed: fails > 0,
800
+ fails,
801
+ artifacts: this.artifacts || [],
802
+ // logPromise,
803
+ features: suiteDone.features()
804
+ };
805
+ }
806
+ };
807
+ });
808
+ }
809
+ // testsJson() {
810
+ // puppetMaster.writeFileSync(
811
+ // `tests.json`,
812
+ // JSON.stringify({ features: suiteDone.features() }, null, 2)
813
+ // );
814
+ // }
815
+ Specs() {
816
+ return this.specs;
817
+ }
818
+ Suites() {
819
+ return this.suitesOverrides;
820
+ }
821
+ Given() {
822
+ return this.givenOverides;
823
+ }
824
+ When() {
825
+ return this.whenOverides;
826
+ }
827
+ Then() {
828
+ return this.thenOverides;
829
+ }
830
+ };
831
+
832
+ // src/lib/classBuilder.ts
833
+ var ClassBuilder = class extends BaseBuilder {
834
+ constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, testResourceRequirement) {
835
+ const classySuites = Object.entries(testImplementation.suites).reduce(
836
+ (a, [key], index) => {
837
+ a[key] = (somestring, givens) => {
838
+ return new suiteKlasser.prototype.constructor(
839
+ somestring,
840
+ index,
841
+ givens
842
+ );
843
+ };
844
+ return a;
845
+ },
846
+ {}
847
+ );
848
+ const classyGivens = Object.entries(testImplementation.givens).reduce(
849
+ (a, [key, g]) => {
850
+ a[key] = (features, whens, thens, ...initialValues) => {
851
+ return new givenKlasser.prototype.constructor(
852
+ key,
853
+ features,
854
+ whens,
855
+ thens,
856
+ testImplementation.givens[key],
857
+ initialValues
858
+ );
859
+ };
860
+ return a;
861
+ },
862
+ {}
863
+ );
864
+ const classyWhens = Object.entries(testImplementation.whens).reduce(
865
+ (a, [key, whEn]) => {
866
+ a[key] = (...payload) => {
867
+ return new whenKlasser.prototype.constructor(
868
+ `${whEn.name}: ${payload && payload.toString()}`,
869
+ whEn(...payload)
870
+ );
871
+ };
872
+ return a;
873
+ },
874
+ {}
875
+ );
876
+ const classyThens = Object.entries(
877
+ testImplementation.thens
878
+ ).reduce(
879
+ (a, [key, thEn]) => {
880
+ a[key] = (expected, ...x) => {
881
+ return new thenKlasser.prototype.constructor(
882
+ `${thEn.name}: ${expected && expected.toString()}`,
883
+ thEn(expected, ...x)
884
+ );
885
+ };
886
+ return a;
887
+ },
888
+ {}
889
+ );
890
+ super(
891
+ input,
892
+ classySuites,
893
+ classyGivens,
894
+ classyWhens,
895
+ classyThens,
896
+ testResourceRequirement,
897
+ testSpecification
898
+ );
899
+ }
900
+ };
901
+
902
+ // src/lib/core.ts
903
+ var TesterantoCore = class extends ClassBuilder {
904
+ constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter, uberCatcher) {
905
+ const fullAdapter = DefaultAdapter(testAdapter);
906
+ super(
907
+ testImplementation,
908
+ testSpecification,
909
+ input,
910
+ class extends BaseSuite {
911
+ afterAll(store, artifactory, pm) {
912
+ return fullAdapter.afterAll(store, pm);
913
+ }
914
+ assertThat(t) {
915
+ return fullAdapter.assertThis(t);
916
+ }
917
+ async setup(s, artifactory, tr, pm) {
918
+ return (fullAdapter.beforeAll || (async (input2, artifactory2, tr2, pm2) => input2))(
919
+ s,
920
+ this.testResourceConfiguration,
921
+ // artifactory,
922
+ pm
923
+ );
924
+ }
925
+ },
926
+ class Given extends BaseGiven {
927
+ constructor() {
928
+ super(...arguments);
929
+ this.uberCatcher = uberCatcher;
930
+ }
931
+ async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
932
+ return fullAdapter.beforeEach(
933
+ subject,
934
+ initializer,
935
+ testResource,
936
+ initialValues,
937
+ pm
938
+ );
939
+ }
940
+ afterEach(store, key, artifactory, pm) {
941
+ return new Promise(
942
+ (res) => res(fullAdapter.afterEach(store, key, pm))
943
+ );
944
+ }
945
+ },
946
+ class When extends BaseWhen {
947
+ async andWhen(store, whenCB, testResource, pm) {
948
+ return await fullAdapter.andWhen(store, whenCB, testResource, pm);
949
+ }
950
+ },
951
+ class Then extends BaseThen {
952
+ async butThen(store, thenCB, testResource, pm) {
953
+ return await fullAdapter.butThen(store, thenCB, testResource, pm);
954
+ }
955
+ },
956
+ testResourceRequirement
957
+ );
958
+ }
959
+ };
960
+
961
+ // src/Web.ts
962
+ var WebTesteranto = class extends TesterantoCore {
963
+ constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
964
+ super(
965
+ input,
966
+ testSpecification,
967
+ testImplementation,
968
+ testResourceRequirement,
969
+ testAdapter,
970
+ (cb) => {
971
+ }
972
+ );
973
+ }
974
+ async receiveTestResourceConfig(partialTestResource) {
975
+ const t = partialTestResource;
976
+ const pm = new PM_Web(t);
977
+ return await this.testJobs[0].receiveTestResourceConfig(pm);
978
+ }
979
+ };
980
+ var Web_default = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) => {
981
+ return new WebTesteranto(
982
+ input,
983
+ testSpecification,
984
+ testImplementation,
985
+ testResourceRequirement,
986
+ testAdapter
987
+ );
988
+ };
989
+
990
+ export {
991
+ BaseGiven,
992
+ BaseWhen,
993
+ BaseThen,
994
+ BaseBuilder,
995
+ BaseSuite,
996
+ Web_default
997
+ };