testeranto 0.74.0 → 0.79.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 (257) hide show
  1. package/.eslintrc.js +5 -2
  2. package/Bundle.Dockerfile +52 -0
  3. package/README.md +25 -24
  4. package/build-tests.ts +16 -0
  5. package/dist/common/build-tests.js +38 -0
  6. package/dist/common/init-docs.js +8 -0
  7. package/dist/common/run-tests.js +34 -0
  8. package/dist/common/src/Aider.js +96 -0
  9. package/dist/common/src/Init.js +10 -0
  10. package/dist/common/{Node.js → src/Node.js} +1 -0
  11. package/dist/common/src/PM/index.js +7 -0
  12. package/dist/common/{PM → src/PM}/main.js +287 -10
  13. package/dist/common/{PM → src/PM}/node.js +4 -0
  14. package/dist/common/{PM → src/PM}/web.js +3 -0
  15. package/dist/common/{Project.js → src/Project.js} +15 -57
  16. package/dist/common/{Puppeteer.js → src/Puppeteer.js} +65 -26
  17. package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
  18. package/dist/common/src/SubPackages/react-dom/jsx/web.js +117 -0
  19. package/dist/common/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
  20. package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +2 -2
  21. package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +2 -2
  22. package/dist/common/{Types.js → src/Types.js} +0 -2
  23. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
  24. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +52 -0
  25. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
  26. package/dist/common/src/esbuildConfigs/report.js +14 -0
  27. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
  28. package/dist/common/src/lib/abstractBase.js +581 -0
  29. package/dist/common/{lib → src/lib}/basebuilder.js +12 -38
  30. package/dist/common/{lib → src/lib}/classBuilder.js +1 -3
  31. package/dist/common/{lib → src/lib}/core.js +3 -5
  32. package/dist/common/src/lib/types.js +2 -0
  33. package/dist/common/src/utils.js +16 -0
  34. package/dist/common/testeranto.js +15 -0
  35. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  36. package/dist/module/build-tests.js +10 -0
  37. package/dist/module/init-docs.js +3 -0
  38. package/dist/module/run-tests.js +6 -0
  39. package/dist/module/src/Aider.js +89 -0
  40. package/dist/module/src/Init.js +5 -0
  41. package/dist/module/{Node.js → src/Node.js} +1 -0
  42. package/dist/module/src/PM/index.js +3 -0
  43. package/dist/module/src/PM/main.js +617 -0
  44. package/dist/module/{PM → src/PM}/node.js +4 -0
  45. package/dist/module/{PM → src/PM}/web.js +3 -0
  46. package/dist/module/{Project.js → src/Project.js} +15 -57
  47. package/dist/module/{Puppeteer.js → src/Puppeteer.js} +65 -26
  48. package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
  49. package/dist/module/src/SubPackages/react-dom/jsx/web.js +89 -0
  50. package/dist/module/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
  51. package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +1 -1
  52. package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +1 -1
  53. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
  54. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +47 -0
  55. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
  56. package/dist/module/src/esbuildConfigs/report.js +14 -0
  57. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
  58. package/dist/module/src/lib/abstractBase.js +573 -0
  59. package/dist/module/{lib → src/lib}/basebuilder.js +12 -38
  60. package/dist/module/{lib → src/lib}/classBuilder.js +1 -3
  61. package/dist/module/{lib → src/lib}/core.js +3 -5
  62. package/dist/module/src/utils.js +9 -0
  63. package/dist/module/testeranto.js +13 -0
  64. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  65. package/dist/types/build-tests.d.ts +3 -0
  66. package/dist/types/init-docs.d.ts +2 -0
  67. package/dist/types/run-tests.d.ts +2 -0
  68. package/dist/types/src/Aider.d.ts +1 -0
  69. package/dist/types/src/Init.d.ts +2 -0
  70. package/dist/types/src/Node.d.ts +6 -0
  71. package/dist/types/{PM → src/PM}/index.d.ts +3 -2
  72. package/dist/types/{PM → src/PM}/main.d.ts +8 -3
  73. package/dist/types/{PM → src/PM}/node.d.ts +2 -0
  74. package/dist/types/{PM → src/PM}/web.d.ts +1 -0
  75. package/dist/types/{Project.d.ts → src/Project.d.ts} +1 -1
  76. package/dist/types/src/Puppeteer.d.ts +2 -0
  77. package/dist/types/src/SubPackages/puppeteer.d.ts +6 -0
  78. package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +1 -1
  79. package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +1 -1
  80. package/dist/types/src/SubPackages/react/jsx/node.d.ts +4 -0
  81. package/dist/types/src/SubPackages/react/jsx/web.d.ts +4 -0
  82. package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +2 -2
  83. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +11 -0
  84. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +6 -0
  85. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +5 -0
  86. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
  87. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -7
  88. package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
  89. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +1 -2
  90. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +3 -0
  91. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +1 -1
  92. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +1 -1
  93. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +1 -2
  94. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +1 -2
  95. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
  96. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
  97. package/dist/types/src/Types.d.ts +51 -0
  98. package/dist/types/src/Web.d.ts +6 -0
  99. package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
  100. package/dist/types/{lib → src/lib}/abstractBase.d.ts +8 -8
  101. package/dist/types/{lib → src/lib}/basebuilder.d.ts +1 -1
  102. package/dist/types/{lib → src/lib}/classBuilder.d.ts +1 -1
  103. package/dist/types/{lib → src/lib}/core.d.ts +1 -1
  104. package/dist/types/{lib → src/lib}/index.d.ts +5 -5
  105. package/dist/types/{lib → src/lib}/types.d.ts +15 -15
  106. package/dist/types/src/utils.d.ts +2 -0
  107. package/dist/types/testeranto.d.ts +16 -0
  108. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  109. package/docker-compose.yml +37 -0
  110. package/init-docs.ts +5 -0
  111. package/package.json +72 -25
  112. package/run-tests.ts +9 -0
  113. package/src/Aider.ts +125 -0
  114. package/src/Init.ts +20 -0
  115. package/src/Node.ts +31 -2
  116. package/src/PM/index.ts +7 -84
  117. package/src/PM/main.ts +400 -16
  118. package/src/PM/node.ts +6 -0
  119. package/src/PM/web.ts +4 -0
  120. package/src/Project.ts +33 -84
  121. package/src/Puppeteer.ts +115 -62
  122. package/src/SubPackages/react-dom/component/web.ts +10 -30
  123. package/src/SubPackages/react-dom/jsx/web.ts +110 -76
  124. package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
  125. package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
  126. package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
  127. package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
  128. package/src/Types.ts +138 -29
  129. package/src/Web.ts +32 -2
  130. package/src/esbuildConfigs/index.ts +1 -0
  131. package/src/esbuildConfigs/inputFilesPlugin.ts +67 -0
  132. package/src/esbuildConfigs/node.ts +4 -2
  133. package/src/esbuildConfigs/report.ts +13 -13
  134. package/src/esbuildConfigs/web.ts +4 -0
  135. package/src/lib/abstractBase.ts +366 -36
  136. package/src/lib/basebuilder.ts +26 -52
  137. package/src/lib/classBuilder.ts +14 -2
  138. package/src/lib/core.ts +18 -7
  139. package/src/lib/index.ts +115 -7
  140. package/src/lib/types.ts +143 -37
  141. package/src/utils.ts +15 -0
  142. package/testeranto.ts +13 -0
  143. package/tsconfig.common.json +12 -4
  144. package/tsconfig.json +9 -3
  145. package/tsconfig.module.json +2 -3
  146. package/tsconfig.types.json +1 -2
  147. package/dist/common/Features.js +0 -84
  148. package/dist/common/PM/index.js +0 -71
  149. package/dist/common/Reporter.js +0 -119
  150. package/dist/common/Scheduler.js +0 -1
  151. package/dist/common/SubPackages/react-dom/jsx/web.js +0 -93
  152. package/dist/common/esbuildConfigs/report.js +0 -13
  153. package/dist/common/lib/abstractBase.js +0 -348
  154. package/dist/common/preload.js +0 -15
  155. package/dist/common/report.html.js +0 -31
  156. package/dist/module/Features.js +0 -73
  157. package/dist/module/PM/index.js +0 -67
  158. package/dist/module/PM/main.js +0 -340
  159. package/dist/module/Reporter.js +0 -114
  160. package/dist/module/Scheduler.js +0 -1
  161. package/dist/module/SubPackages/react-dom/jsx/web.js +0 -65
  162. package/dist/module/Types.js +0 -3
  163. package/dist/module/esbuildConfigs/report.js +0 -11
  164. package/dist/module/lib/abstractBase.js +0 -340
  165. package/dist/module/preload.js +0 -15
  166. package/dist/module/report.html.js +0 -29
  167. package/dist/prebuild/Report.css +0 -11358
  168. package/dist/prebuild/Report.js +0 -37585
  169. package/dist/types/Features.d.ts +0 -68
  170. package/dist/types/Node.d.ts +0 -6
  171. package/dist/types/SubPackages/puppeteer.d.ts +0 -6
  172. package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
  173. package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
  174. package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -5
  175. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -6
  176. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
  177. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
  178. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
  179. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
  180. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
  181. package/dist/types/Types.d.ts +0 -50
  182. package/dist/types/Web.d.ts +0 -6
  183. package/dist/types/esbuildConfigs/report.d.ts +0 -4
  184. package/dist/types/preload.d.ts +0 -0
  185. package/dist/types/report.html.d.ts +0 -2
  186. package/electronBuild.ts +0 -32
  187. package/src/Features.ts +0 -118
  188. package/src/Report.tsx +0 -521
  189. package/src/Reporter.ts +0 -134
  190. package/src/Scheduler.ts +0 -0
  191. package/src/preload.ts +0 -17
  192. package/src/report.html.ts +0 -29
  193. package/tests/Rectangle.test.ts +0 -189
  194. /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
  195. /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
  196. /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
  197. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
  198. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
  199. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
  200. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
  201. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
  202. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
  203. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  204. /package/dist/common/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
  205. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
  206. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
  207. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
  208. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
  209. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
  210. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  211. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
  212. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  213. /package/dist/common/{Web.js → src/Web.js} +0 -0
  214. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
  215. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
  216. /package/dist/common/{lib → src/lib}/index.js +0 -0
  217. /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
  218. /package/dist/common/{web.html.js → src/web.html.js} +0 -0
  219. /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
  220. /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
  221. /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
  222. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
  223. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
  224. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
  225. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
  226. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
  227. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
  228. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  229. /package/dist/module/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
  230. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
  231. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
  232. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
  233. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
  234. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
  235. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  236. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
  237. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  238. /package/dist/{types/Puppeteer.d.ts → module/src/Types.js} +0 -0
  239. /package/dist/module/{Web.js → src/Web.js} +0 -0
  240. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
  241. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
  242. /package/dist/module/{lib → src/lib}/index.js +0 -0
  243. /package/dist/{types/Reporter.d.ts → module/src/lib/types.js} +0 -0
  244. /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
  245. /package/dist/module/{web.html.js → src/web.html.js} +0 -0
  246. /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
  247. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
  248. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
  249. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
  250. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
  251. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
  252. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
  253. /package/dist/types/{Scheduler.d.ts → src/esbuildConfigs/report.d.ts} +0 -0
  254. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
  255. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
  256. /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
  257. /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
@@ -3,6 +3,7 @@ import { BuildOptions } from "esbuild";
3
3
  import { IBaseConfig } from "../lib/types";
4
4
 
5
5
  import baseEsBuildConfig from "./index.js";
6
+ import inputFilesPlugin from "./inputFilesPlugin.js";
6
7
 
7
8
  export default (
8
9
  config: IBaseConfig,
@@ -15,8 +16,8 @@ export default (
15
16
 
16
17
  outdir: config.outdir + "/node",
17
18
 
18
- inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
19
-
19
+ // inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
20
+ metafile: true,
20
21
  supported: {
21
22
  "dynamic-import": true,
22
23
  },
@@ -42,6 +43,7 @@ export default (
42
43
  entryPoints: [...entryPoints],
43
44
  plugins: [
44
45
  ...(config.nodePlugins || []),
46
+ inputFilesPlugin("node", entryPoints),
45
47
  {
46
48
  name: "rebuild-notify",
47
49
  setup(build) {
@@ -1,15 +1,15 @@
1
- import { BuildOptions } from "esbuild";
1
+ // import { BuildOptions } from "esbuild";
2
2
 
3
- import { IBaseConfig } from "../lib/types";
3
+ // import { IBaseConfig } from "../lib/types";
4
4
 
5
- export default (config: IBaseConfig): BuildOptions => {
6
- return {
7
- bundle: true,
8
- entryPoints: ["./node_modules/testeranto/dist/module/report.js"],
9
- minify: config.minify === true,
10
- outbase: config.outbase,
11
- write: true,
12
- outfile: `${config.outdir}/report.js`,
13
- external: ["tests.json", "features.test.js"],
14
- };
15
- };
5
+ // export default (config: IBaseConfig): BuildOptions => {
6
+ // return {
7
+ // bundle: true,
8
+ // entryPoints: ["./node_modules/testeranto/dist/module/report.js"],
9
+ // minify: config.minify === true,
10
+ // outbase: config.outbase,
11
+ // write: true,
12
+ // outfile: `${config.outdir}/report.js`,
13
+ // external: ["tests.json", "features.test.js"],
14
+ // };
15
+ // };
@@ -4,6 +4,7 @@ import path from "path";
4
4
  import { IBaseConfig } from "../lib/types.js";
5
5
 
6
6
  import baseEsBuildConfig from "./index.js";
7
+ import inputFilesPlugin from "./inputFilesPlugin.js";
7
8
 
8
9
  export default (
9
10
  config: IBaseConfig,
@@ -25,6 +26,8 @@ export default (
25
26
  react: path.resolve("./node_modules/react"),
26
27
  },
27
28
 
29
+ metafile: true,
30
+
28
31
  external: [
29
32
  "testeranto.json",
30
33
  "features.test.ts",
@@ -57,6 +60,7 @@ export default (
57
60
 
58
61
  plugins: [
59
62
  ...(config.webPlugins || []),
63
+ inputFilesPlugin("web", entryPoints),
60
64
  {
61
65
  name: "rebuild-notify",
62
66
  setup(build) {
@@ -1,15 +1,41 @@
1
1
  import { IBaseTest } from "../Types";
2
-
3
- import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
4
2
  import { PM } from "../PM/index.js";
5
- // import { IUtils } from "./types";
6
3
 
7
- export type IGivens<ITestShape extends IBaseTest> = Record<
8
- string,
9
- BaseGiven<ITestShape>
10
- >;
4
+ import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
11
5
 
12
- export abstract class BaseSuite<ITestShape extends IBaseTest> {
6
+ export type IGivens<
7
+ ITestShape extends IBaseTest<
8
+ unknown,
9
+ unknown,
10
+ unknown,
11
+ unknown,
12
+ unknown,
13
+ unknown,
14
+ unknown,
15
+ Record<string, any>,
16
+ Record<string, any>,
17
+ Record<string, any>,
18
+ Record<string, any>,
19
+ Record<string, any>
20
+ >
21
+ > = Record<string, BaseGiven<ITestShape>>;
22
+
23
+ export abstract class BaseSuite<
24
+ ITestShape extends IBaseTest<
25
+ unknown,
26
+ unknown,
27
+ unknown,
28
+ unknown,
29
+ unknown,
30
+ unknown,
31
+ unknown,
32
+ Record<string, any>,
33
+ Record<string, any>,
34
+ Record<string, any>,
35
+ Record<string, any>,
36
+ Record<string, any>
37
+ >
38
+ > {
13
39
  name: string;
14
40
  givens: IGivens<ITestShape>;
15
41
  checks: BaseCheck<ITestShape>[];
@@ -75,11 +101,76 @@ export abstract class BaseSuite<ITestShape extends IBaseTest> {
75
101
  const sName = this.name;
76
102
 
77
103
  for (const [gNdx, g] of Object.entries(this.givens)) {
104
+ const beforeAllProxy = new Proxy(pm, {
105
+ get(target, prop, receiver) {
106
+ if (prop === "writeFileSync") {
107
+ return (fp, contents) =>
108
+ target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
109
+ }
110
+
111
+ if (prop === "browser") {
112
+ return new Proxy(target[prop], {
113
+ get(bTarget, bProp, bReceiver) {
114
+ if (bProp === "pages") {
115
+ return async () => {
116
+ return bTarget.pages().then((pages) => {
117
+ return pages.map((page) => {
118
+ return new Proxy(page, {
119
+ get(pTarget, pProp, pReciever) {
120
+ if (pProp === "screenshot") {
121
+ return async (x) => {
122
+ return pm.customScreenShot(
123
+ {
124
+ ...x,
125
+ path:
126
+ `${testResourceConfiguration.fs}/suite-${sNdx}/beforeAll` +
127
+ "/" +
128
+ x.path,
129
+ },
130
+ page
131
+ );
132
+ // return await window["custom-screenshot"]({
133
+ // ...x,
134
+ // path:
135
+ // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
136
+ // "/" +
137
+ // x.path,
138
+ // });
139
+ };
140
+ } else if (pProp === "mainFrame") {
141
+ return () => pTarget[pProp]();
142
+ } else if (pProp === "close") {
143
+ return () => pTarget[pProp]();
144
+ }
145
+
146
+ // else if (pProp === "mainFrame") {
147
+ // return () => target[pProp](...arguments);
148
+ // }
149
+ else {
150
+ return Reflect.get(...arguments);
151
+ }
152
+ },
153
+ });
154
+ });
155
+ });
156
+ // return (await target.pages()).map((page) => {
157
+ // return new Proxy(page, handler2);
158
+ // });
159
+ };
160
+ }
161
+ },
162
+ });
163
+ }
164
+
165
+ return Reflect.get(...arguments);
166
+ },
167
+ });
168
+
78
169
  const subject = await this.setup(
79
170
  input,
80
171
  suiteArtifactory,
81
172
  testResourceConfiguration,
82
- pm
173
+ beforeAllProxy
83
174
  );
84
175
 
85
176
  const giver = this.givens[gNdx];
@@ -119,21 +210,27 @@ export abstract class BaseSuite<ITestShape extends IBaseTest> {
119
210
  get(pTarget, pProp, pReciever) {
120
211
  if (pProp === "screenshot") {
121
212
  return async (x) => {
122
- // console.log(
123
- // "custom-screenshot-MARK-afterAllProxy",
124
- // // arguments,
125
- // // x,
126
- // window["custom-screenshot"].toString()
127
- // );
128
- return await window["custom-screenshot"]({
213
+ return pm.customScreenShot({
129
214
  ...x,
130
215
  path:
131
216
  `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
132
217
  "/" +
133
218
  x.path,
134
219
  });
220
+ // return await window["custom-screenshot"]({
221
+ // ...x,
222
+ // path:
223
+ // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
224
+ // "/" +
225
+ // x.path,
226
+ // });
135
227
  };
228
+ } else if (pProp === "mainFrame") {
229
+ return () => pTarget[pProp]();
230
+ } else if (pProp === "close") {
231
+ return () => pTarget[pProp]();
136
232
  }
233
+
137
234
  // else if (pProp === "mainFrame") {
138
235
  // return () => target[pProp](...arguments);
139
236
  // }
@@ -196,7 +293,22 @@ export abstract class BaseSuite<ITestShape extends IBaseTest> {
196
293
  }
197
294
  }
198
295
 
199
- export abstract class BaseGiven<ITestShape extends IBaseTest> {
296
+ export abstract class BaseGiven<
297
+ ITestShape extends IBaseTest<
298
+ unknown,
299
+ unknown,
300
+ unknown,
301
+ unknown,
302
+ unknown,
303
+ unknown,
304
+ unknown,
305
+ Record<string, any>,
306
+ Record<string, any>,
307
+ Record<string, any>,
308
+ Record<string, any>,
309
+ Record<string, any>
310
+ >
311
+ > {
200
312
  name: string;
201
313
  features: string[];
202
314
  whens: BaseWhen<ITestShape>[];
@@ -276,7 +388,6 @@ export abstract class BaseGiven<ITestShape extends IBaseTest> {
276
388
  const beforeEachProxy = new Proxy(pm, {
277
389
  get(target, prop, receiver) {
278
390
  if (prop === "writeFileSync") {
279
- console.log("beforeEachProx", arguments, target[prop]);
280
391
  return (fp, contents) =>
281
392
  target[prop](
282
393
  `suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`,
@@ -295,6 +406,7 @@ export abstract class BaseGiven<ITestShape extends IBaseTest> {
295
406
  this.givenCB,
296
407
  beforeEachProxy
297
408
  );
409
+ console.log("mark6", this.store);
298
410
 
299
411
  for (const [whenNdx, whenStep] of this.whens.entries()) {
300
412
  await whenStep.test(
@@ -306,19 +418,22 @@ export abstract class BaseGiven<ITestShape extends IBaseTest> {
306
418
  );
307
419
  }
308
420
 
309
- for (const thenStep of this.thens) {
421
+ for (const [thenNdx, thenStep] of this.thens.entries()) {
310
422
  const t = await thenStep.test(
311
423
  this.store,
312
424
  testResourceConfiguration,
313
425
  tLog,
314
- pm
426
+ pm,
427
+ `suite-${suiteNdx}/given-${key}/then-${thenNdx}`
315
428
  );
316
429
  tester(t);
317
430
  }
318
431
  } catch (e) {
432
+ console.error(e);
319
433
  this.error = e;
320
- tLog(e);
321
- tLog("\u0007"); // bell
434
+ tLog(e.stack);
435
+ // tLog("\u0007"); // bell
436
+
322
437
  // throw e;
323
438
  } finally {
324
439
  try {
@@ -365,16 +480,39 @@ export abstract class BaseGiven<ITestShape extends IBaseTest> {
365
480
  // window["custom-screenshot"].toString()
366
481
  // );
367
482
 
368
- return await pTarget[pProp]({
369
- ...x,
370
- path:
371
- `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
372
- "/" +
373
- x.path,
374
- });
483
+ return pm.customScreenShot(
484
+ {
485
+ ...x,
486
+ path:
487
+ `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
488
+ "/" +
489
+ x.path,
490
+ },
491
+ page
492
+ );
493
+
494
+ // return await pTarget[pProp]({
495
+ // ...x,
496
+ // path:
497
+ // `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
498
+ // "/" +
499
+ // x.path,
500
+ // });
375
501
  };
502
+ } else if (pProp === "mainFrame") {
503
+ return () => pTarget[pProp]();
504
+ // return target[pProp];
505
+ // return Reflect.get(...arguments);
506
+ } else if (pProp === "exposeFunction") {
507
+ // return Reflect.get(target, prop, receiver);
508
+ return (...a) => pTarget[pProp](...a);
509
+ // return target[pProp];
510
+ } else if (pProp === "removeExposedFunction") {
511
+ // return Reflect.get(target, prop, receiver);
512
+ return pTarget[pProp].bind(pTarget);
513
+ // return target[pProp];
376
514
  }
377
- // else if (pProp === "mainFrame") {
515
+ // else if (pProp === "#frameManager") {
378
516
  // return () => target[pProp](...arguments);
379
517
  // }
380
518
  else {
@@ -397,6 +535,7 @@ export abstract class BaseGiven<ITestShape extends IBaseTest> {
397
535
  },
398
536
  });
399
537
 
538
+ console.log("mark5", this.store, key);
400
539
  await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
401
540
  } catch (e) {
402
541
  console.error("afterEach failed! no error will be recorded!", e);
@@ -444,14 +583,103 @@ export abstract class BaseWhen<ITestShape extends IBaseTest> {
444
583
 
445
584
  const name = this.name;
446
585
  const andWhenProxy = new Proxy(pm, {
586
+ // set(obj, prop, value) {
587
+ // return Reflect.set(...arguments);
588
+ // // if (prop === "eyeCount" && value % 2 !== 0) {
589
+ // // console.log("Monsters must have an even number of eyes");
590
+ // // } else {
591
+ // // return Reflect.set(...arguments);
592
+ // // }
593
+ // },
594
+
447
595
  get(target, prop, receiver) {
448
596
  if (prop === "writeFileSync") {
449
- console.log("andWhenProxy", arguments, target[prop]);
450
597
  return (fp, contents) =>
451
598
  // target[prop](`${key}/andWhen/${fp}`, contents);
452
599
  target[prop](`${key}/andWhen/${fp}`, contents);
453
600
  }
454
601
 
602
+ /////////////////////
603
+
604
+ if (prop === "browser") {
605
+ return new Proxy(target[prop], {
606
+ get(bTarget, bProp, bReceiver) {
607
+ if (bProp === "pages") {
608
+ return async () => {
609
+ return bTarget.pages().then((pages) => {
610
+ return pages.map((page) => {
611
+ return new Proxy(page, {
612
+ get(pTarget, pProp, pReciever) {
613
+ // console.log("mark get", pTarget, pProp, pReciever);
614
+ if (pProp === "screenshot") {
615
+ return async (x) => {
616
+ return pm.customScreenShot(
617
+ {
618
+ ...x,
619
+ path:
620
+ `${testResourceConfiguration.fs}/${key}/afterEach` +
621
+ "/" +
622
+ x.path,
623
+ },
624
+ page
625
+ );
626
+ };
627
+ } else if (pProp === "mainFrame") {
628
+ return () => pTarget[pProp]();
629
+ // return target[pProp];
630
+ // return Reflect.get(...arguments);
631
+ } else if (pProp === "exposeFunction") {
632
+ // return Reflect.get(target, prop, receiver);
633
+ return pTarget[pProp].bind(pTarget);
634
+ // return target[pProp];
635
+ } else if (pProp === "removeExposedFunction") {
636
+ // return Reflect.get(target, prop, receiver);
637
+ return pTarget[pProp].bind(pTarget);
638
+ // return target[pProp];
639
+ } else if (pProp === "click") {
640
+ // console.log("mark12", arguments);
641
+ // return Reflect.get(target, prop, receiver);
642
+ // return pTarget[pProp].bind(pTarget);
643
+ // return target[pProp];
644
+ return (selector, options) => {
645
+ // console.log("mark13", selector, options);
646
+ // debugger;
647
+ pTarget[pProp](selector, options);
648
+ };
649
+ } else if (pProp === "$") {
650
+ return Reflect.get(...arguments);
651
+ // return Reflect.get(target, prop, receiver);
652
+ // return pTarget[pProp].bind(pTarget);
653
+ // return target[pProp];
654
+ // return pTarget[pProp].bind(pTarget);
655
+
656
+ // return async (s) => {
657
+ // console.log("mark17", s);
658
+ // console.log("pTarget", pTarget);
659
+ // console.log("pProp", pProp);
660
+ // console.log("pReciever", pReciever);
661
+ // // return "XXX";
662
+ // // debugger;
663
+ // return await pTarget[pProp](s);
664
+ // };
665
+ } else {
666
+ return Reflect.get(...arguments);
667
+ }
668
+ },
669
+ });
670
+ });
671
+ });
672
+ // return (await target.pages()).map((page) => {
673
+ // return new Proxy(page, handler2);
674
+ // });
675
+ };
676
+ }
677
+ },
678
+ });
679
+ }
680
+
681
+ ///////////////////////
682
+
455
683
  return Reflect.get(...arguments);
456
684
  },
457
685
  });
@@ -470,7 +698,22 @@ export abstract class BaseWhen<ITestShape extends IBaseTest> {
470
698
  }
471
699
  }
472
700
 
473
- export abstract class BaseThen<ITestShape extends IBaseTest> {
701
+ export abstract class BaseThen<
702
+ ITestShape extends IBaseTest<
703
+ unknown,
704
+ unknown,
705
+ unknown,
706
+ unknown,
707
+ unknown,
708
+ unknown,
709
+ unknown,
710
+ Record<string, any>,
711
+ Record<string, any>,
712
+ Record<string, any>,
713
+ Record<string, any>,
714
+ Record<string, any>
715
+ >
716
+ > {
474
717
  public name: string;
475
718
  thenCB: (storeState: ITestShape["iselection"]) => ITestShape["then"];
476
719
  error: boolean;
@@ -494,21 +737,93 @@ export abstract class BaseThen<ITestShape extends IBaseTest> {
494
737
  abstract butThen(
495
738
  store: ITestShape["istore"],
496
739
  thenCB,
497
- testResourceConfiguration?
740
+ testResourceConfiguration: ITTestResourceConfiguration,
741
+ pm: PM
498
742
  ): Promise<ITestShape["iselection"]>;
499
743
 
500
744
  async test(
501
745
  store: ITestShape["istore"],
502
746
  testResourceConfiguration,
503
747
  tLog: ITLog,
504
- pm: PM
748
+ pm: PM,
749
+ filepath: string
505
750
  ): Promise<ITestShape["then"] | undefined> {
506
751
  tLog(" Then:", this.name);
507
752
  try {
753
+ const butThenProxy = new Proxy(pm, {
754
+ get(target, prop, receiver) {
755
+ if (prop === "writeFileSync") {
756
+ return (fp, contents) =>
757
+ target[prop](`${filepath}/${fp}`, contents);
758
+ }
759
+
760
+ if (prop === "browser") {
761
+ return new Proxy(target[prop], {
762
+ get(bTarget, bProp, bReceiver) {
763
+ if (bProp === "pages") {
764
+ return async () => {
765
+ return bTarget.pages().then((pages) => {
766
+ return pages.map((page) => {
767
+ return new Proxy(page, {
768
+ get(pTarget, pProp, pReciever) {
769
+ if (pProp === "screenshot") {
770
+ return async (x) => {
771
+ return pm.customScreenShot(
772
+ {
773
+ ...x,
774
+ path:
775
+ `${testResourceConfiguration.fs}/${filepath}/butThen` +
776
+ "/" +
777
+ x.path,
778
+ },
779
+ page
780
+ );
781
+ // return await window["custom-screenshot"]({
782
+ // ...x,
783
+ // path:
784
+ // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
785
+ // "/" +
786
+ // x.path,
787
+ // });
788
+ };
789
+ } else if (pProp === "close") {
790
+ return () => pTarget[pProp]();
791
+ } else if (pProp === "mainFrame") {
792
+ return () => pTarget[pProp]();
793
+ } else if (pProp === "exposeFunction") {
794
+ // return Reflect.get(target, prop, receiver);
795
+ return (...a) => pTarget[pProp](...a);
796
+ // return target[pProp];
797
+ } else if (pProp === "removeExposedFunction") {
798
+ // return Reflect.get(target, prop, receiver);
799
+ return pTarget[pProp].bind(pTarget);
800
+ // return target[pProp];
801
+ } else {
802
+ return Reflect.get(...arguments);
803
+ }
804
+ },
805
+ });
806
+ });
807
+ });
808
+ // return (await target.pages()).map((page) => {
809
+ // return new Proxy(page, handler2);
810
+ // });
811
+ };
812
+ }
813
+ },
814
+ });
815
+ }
816
+
817
+ return Reflect.get(...arguments);
818
+ },
819
+ });
820
+
508
821
  const x = await this.butThen(
509
822
  store,
510
823
  this.thenCB,
511
- testResourceConfiguration
824
+ testResourceConfiguration,
825
+ butThenProxy
826
+ // pm
512
827
  );
513
828
  return x;
514
829
  } catch (e) {
@@ -519,7 +834,22 @@ export abstract class BaseThen<ITestShape extends IBaseTest> {
519
834
  }
520
835
  }
521
836
 
522
- export abstract class BaseCheck<ITestShape extends IBaseTest> {
837
+ export abstract class BaseCheck<
838
+ ITestShape extends IBaseTest<
839
+ unknown,
840
+ unknown,
841
+ unknown,
842
+ unknown,
843
+ unknown,
844
+ unknown,
845
+ unknown,
846
+ Record<string, any>,
847
+ Record<string, any>,
848
+ Record<string, any>,
849
+ Record<string, any>,
850
+ Record<string, any>
851
+ >
852
+ > {
523
853
  name: string;
524
854
  features: string[];
525
855
  checkCB: (whens, thens) => any;