testeranto 0.75.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 +6 -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
@@ -1,348 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseCheck = exports.BaseThen = exports.BaseWhen = exports.BaseGiven = exports.BaseSuite = void 0;
4
- class BaseSuite {
5
- constructor(name, index, givens = {}, checks = []) {
6
- this.name = name;
7
- this.index = index;
8
- this.givens = givens;
9
- this.checks = checks;
10
- this.fails = [];
11
- }
12
- toObj() {
13
- return {
14
- name: this.name,
15
- givens: Object.keys(this.givens).map((k) => this.givens[k].toObj()),
16
- fails: this.fails,
17
- };
18
- }
19
- setup(s, artifactory, tr, pm) {
20
- return new Promise((res) => res(s));
21
- }
22
- assertThat(t) {
23
- return t;
24
- }
25
- afterAll(store, artifactory, pm) {
26
- return store;
27
- }
28
- async run(input, testResourceConfiguration, artifactory, tLog, pm) {
29
- this.testResourceConfiguration = testResourceConfiguration;
30
- tLog("test resources: ", JSON.stringify(testResourceConfiguration));
31
- const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
32
- console.log("\nSuite:", this.index, this.name);
33
- tLog("\nSuite:", this.index, this.name);
34
- const sNdx = this.index;
35
- const sName = this.name;
36
- for (const [gNdx, g] of Object.entries(this.givens)) {
37
- const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, pm);
38
- const giver = this.givens[gNdx];
39
- try {
40
- this.store = await giver.give(subject, gNdx, testResourceConfiguration, this.assertThat, suiteArtifactory, tLog, pm, sNdx);
41
- }
42
- catch (e) {
43
- console.error(e);
44
- this.fails.push(giver);
45
- // return this;
46
- }
47
- }
48
- const afterAllProxy = new Proxy(pm, {
49
- get(target, prop, receiver) {
50
- if (prop === "writeFileSync") {
51
- return (fp, contents) => target[prop](`suite-${sNdx}/afterAll/${fp}`, contents);
52
- }
53
- if (prop === "browser") {
54
- return new Proxy(target[prop], {
55
- get(bTarget, bProp, bReceiver) {
56
- if (bProp === "pages") {
57
- return async () => {
58
- return bTarget.pages().then((pages) => {
59
- return pages.map((page) => {
60
- return new Proxy(page, {
61
- get(pTarget, pProp, pReciever) {
62
- if (pProp === "screenshot") {
63
- return async (x) => {
64
- // console.log(
65
- // "custom-screenshot-MARK-afterAllProxy",
66
- // // arguments,
67
- // // x,
68
- // window["custom-screenshot"].toString()
69
- // );
70
- return await window["custom-screenshot"](Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
71
- "/" +
72
- x.path }));
73
- };
74
- }
75
- // else if (pProp === "mainFrame") {
76
- // return () => target[pProp](...arguments);
77
- // }
78
- else {
79
- return Reflect.get(...arguments);
80
- }
81
- },
82
- });
83
- });
84
- });
85
- // return (await target.pages()).map((page) => {
86
- // return new Proxy(page, handler2);
87
- // });
88
- };
89
- }
90
- },
91
- });
92
- }
93
- return Reflect.get(...arguments);
94
- },
95
- });
96
- // pm.browser
97
- try {
98
- this.afterAll(this.store, artifactory, afterAllProxy);
99
- }
100
- catch (e) {
101
- console.error(e);
102
- // this.fails.push(this);
103
- // return this;
104
- }
105
- // for (const [ndx, thater] of this.checks.entries()) {
106
- // await thater.check(
107
- // subject,
108
- // thater.name,
109
- // testResourceConfiguration,
110
- // this.assertThat,
111
- // suiteArtifactory,
112
- // tLog,
113
- // pm
114
- // );
115
- // }
116
- // @TODO fix me
117
- // for (const k of Object.keys(this.givens)) {
118
- // const giver = this.givens[k];
119
- // try {
120
- // giver.afterAll(this.store, artifactory, pm);
121
- // } catch (e) {
122
- // console.error(e);
123
- // this.fails.push(giver);
124
- // return this;
125
- // }
126
- // }
127
- ////////////////
128
- return this;
129
- }
130
- }
131
- exports.BaseSuite = BaseSuite;
132
- class BaseGiven {
133
- constructor(name, features, whens, thens, givenCB, initialValues) {
134
- this.name = name;
135
- this.features = features;
136
- this.whens = whens;
137
- this.thens = thens;
138
- this.givenCB = givenCB;
139
- this.initialValues = initialValues;
140
- }
141
- beforeAll(store, artifactory) {
142
- return store;
143
- }
144
- toObj() {
145
- return {
146
- name: this.name,
147
- whens: this.whens.map((w) => w.toObj()),
148
- thens: this.thens.map((t) => t.toObj()),
149
- error: this.error ? [this.error, this.error.stack] : null,
150
- // fail: this.fail ? [this.fail] : false,
151
- features: this.features,
152
- };
153
- }
154
- async afterEach(store, key, artifactory, pm) {
155
- return store;
156
- }
157
- async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
158
- tLog(`\n Given: ${this.name}`);
159
- const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
160
- try {
161
- // tLog(`\n Given this.store`, this.store);
162
- const beforeEachProxy = new Proxy(pm, {
163
- get(target, prop, receiver) {
164
- if (prop === "writeFileSync") {
165
- console.log("beforeEachProx", arguments, target[prop]);
166
- return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`, contents);
167
- }
168
- return Reflect.get(...arguments);
169
- },
170
- });
171
- this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, beforeEachProxy);
172
- for (const [whenNdx, whenStep] of this.whens.entries()) {
173
- await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/when/${whenNdx}`);
174
- }
175
- for (const thenStep of this.thens) {
176
- const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm);
177
- tester(t);
178
- }
179
- }
180
- catch (e) {
181
- this.error = e;
182
- tLog(e);
183
- tLog("\u0007"); // bell
184
- // throw e;
185
- }
186
- finally {
187
- try {
188
- // const afterEachProxy = new Proxy(pm, {
189
- // get(target, prop, receiver) {
190
- // if (prop === "writeFileSync") {
191
- // console.log("afterEachProxy", arguments, target[prop]);
192
- // return (fp, contents) =>
193
- // // target[prop](`${key}/andWhen/${fp}`, contents);
194
- // target[prop](`${key}/afterEach/${fp}`, contents);
195
- // }
196
- // return Reflect.get(...arguments);
197
- // },
198
- // });
199
- // await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
200
- // await this.afterEach(this.store, key, givenArtifactory, pm);
201
- const afterEachProxy = new Proxy(pm, {
202
- get(target, prop, receiver) {
203
- if (prop === "writeFileSync") {
204
- return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/afterAll/${fp}`, contents);
205
- }
206
- if (prop === "browser") {
207
- return new Proxy(target[prop], {
208
- get(bTarget, bProp, bReceiver) {
209
- if (bProp === "pages") {
210
- return async () => {
211
- return bTarget.pages().then((pages) => {
212
- return pages.map((page) => {
213
- return new Proxy(page, {
214
- get(pTarget, pProp, pReciever) {
215
- if (pProp === "screenshot") {
216
- return async (x) => {
217
- // console.log(
218
- // "custom-screenshot-MARK-afterEachProxy",
219
- // window["custom-screenshot"].toString()
220
- // );
221
- return await pTarget[pProp](Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
222
- "/" +
223
- x.path }));
224
- };
225
- }
226
- // else if (pProp === "mainFrame") {
227
- // return () => target[pProp](...arguments);
228
- // }
229
- else {
230
- return Reflect.get(...arguments);
231
- }
232
- },
233
- });
234
- });
235
- });
236
- // return (await target.pages()).map((page) => {
237
- // return new Proxy(page, handler2);
238
- // });
239
- };
240
- }
241
- },
242
- });
243
- }
244
- return Reflect.get(...arguments);
245
- },
246
- });
247
- await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
248
- }
249
- catch (e) {
250
- console.error("afterEach failed! no error will be recorded!", e);
251
- }
252
- }
253
- return this.store;
254
- }
255
- }
256
- exports.BaseGiven = BaseGiven;
257
- class BaseWhen {
258
- constructor(name, whenCB) {
259
- this.name = name;
260
- this.whenCB = whenCB;
261
- }
262
- toObj() {
263
- return {
264
- name: this.name,
265
- error: this.error,
266
- };
267
- }
268
- async test(store, testResourceConfiguration, tLog, pm, key) {
269
- tLog(" When:", this.name);
270
- const name = this.name;
271
- const andWhenProxy = new Proxy(pm, {
272
- get(target, prop, receiver) {
273
- if (prop === "writeFileSync") {
274
- console.log("andWhenProxy", arguments, target[prop]);
275
- return (fp, contents) =>
276
- // target[prop](`${key}/andWhen/${fp}`, contents);
277
- target[prop](`${key}/andWhen/${fp}`, contents);
278
- }
279
- return Reflect.get(...arguments);
280
- },
281
- });
282
- try {
283
- return await this.andWhen(store, this.whenCB, testResourceConfiguration, andWhenProxy);
284
- }
285
- catch (e) {
286
- this.error = true;
287
- throw e;
288
- }
289
- }
290
- }
291
- exports.BaseWhen = BaseWhen;
292
- class BaseThen {
293
- constructor(name, thenCB) {
294
- this.name = name;
295
- this.thenCB = thenCB;
296
- this.error = false;
297
- }
298
- toObj() {
299
- return {
300
- name: this.name,
301
- error: this.error,
302
- };
303
- }
304
- async test(store, testResourceConfiguration, tLog, pm) {
305
- tLog(" Then:", this.name);
306
- try {
307
- const x = await this.butThen(store, this.thenCB, testResourceConfiguration);
308
- return x;
309
- }
310
- catch (e) {
311
- console.log("test failed", e);
312
- this.error = e.message;
313
- throw e;
314
- }
315
- }
316
- }
317
- exports.BaseThen = BaseThen;
318
- class BaseCheck {
319
- constructor(name, features, checkCB, whens, thens) {
320
- this.name = name;
321
- this.features = features;
322
- this.checkCB = checkCB;
323
- this.whens = whens;
324
- this.thens = thens;
325
- }
326
- async afterEach(store, key, cb, pm) {
327
- return;
328
- }
329
- async check(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm) {
330
- tLog(`\n Check: ${this.name}`);
331
- const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
332
- await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
333
- a[key] = async (payload) => {
334
- return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm, "x");
335
- };
336
- return a;
337
- }, {}), Object.entries(this.thens).reduce((a, [key, then]) => {
338
- a[key] = async (payload) => {
339
- const t = await then(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm);
340
- tester(t);
341
- };
342
- return a;
343
- }, {}));
344
- await this.afterEach(store, key, () => { }, pm);
345
- return;
346
- }
347
- }
348
- exports.BaseCheck = BaseCheck;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- // import puppeteer from "puppeteer-core";
3
- // import { NodeWriter } from "./NodeWriter";
4
- // import puppeteerConfiger from "./puppeteerConfiger";
5
- // (window as any).NodeWriter = NodeWriter;
6
- // (window as any).browser = new Promise(async (res, rej) => {
7
- // const browser = await puppeteerConfiger("2999").then(async (json) => {
8
- // const b = await puppeteer.connect({
9
- // browserWSEndpoint: json.webSocketDebuggerUrl,
10
- // defaultViewport: null,
11
- // });
12
- // console.log("connected!", b.isConnected());
13
- // return res(b);
14
- // });
15
- // });
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = () => `
4
- <!DOCTYPE html>
5
- <html lang="en">
6
-
7
- <head>
8
- <meta name="description" content="Webpage description goes here" />
9
- <meta charset="utf-8" />
10
- <title>kokomoBay - testeranto</title>
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <meta name="author" content="" />
13
-
14
- <link rel="stylesheet" href="./Report.css">
15
-
16
- <script type="importmap">
17
- {
18
- "imports": {
19
- "features.test.js": "./features.test.js",
20
- "testeranto.json": "./testeranto.json"
21
- }
22
- }
23
- </script>
24
-
25
- <script type="module" src="./Report.js"></script>
26
- </head>
27
-
28
- <body><div id="root">react is loading</div></body>
29
-
30
- </html>
31
- `;
@@ -1,73 +0,0 @@
1
- import Graph from "graphology/dist/graphology.umd.js";
2
- const { DirectedGraph, UndirectedGraph } = Graph;
3
- class TesterantoGraph {
4
- constructor(name) {
5
- this.name = name;
6
- }
7
- }
8
- export class BaseFeature {
9
- constructor(name) {
10
- this.name = name;
11
- }
12
- }
13
- export class TesterantoGraphUndirected {
14
- constructor(name) {
15
- this.name = name;
16
- this.graph = new UndirectedGraph();
17
- }
18
- connect(a, b, relation) {
19
- this.graph.mergeEdge(a, b, { type: relation });
20
- }
21
- }
22
- export class TesterantoGraphDirected {
23
- constructor(name) {
24
- this.name = name;
25
- this.graph = new DirectedGraph();
26
- }
27
- connect(to, from, relation) {
28
- this.graph.mergeEdge(to, from, { type: relation });
29
- }
30
- }
31
- export class TesterantoGraphDirectedAcyclic {
32
- constructor(name) {
33
- this.name = name;
34
- this.graph = new DirectedGraph();
35
- }
36
- connect(to, from, relation) {
37
- this.graph.mergeEdge(to, from, { type: relation });
38
- }
39
- }
40
- export class TesterantoFeatures {
41
- constructor(features, graphs) {
42
- this.features = features;
43
- this.graphs = graphs;
44
- }
45
- networks() {
46
- return [
47
- ...this.graphs.undirected.values(),
48
- ...this.graphs.directed.values(),
49
- ...this.graphs.dags.values(),
50
- ];
51
- }
52
- toObj() {
53
- return {
54
- features: Object.entries(this.features).map(([name, feature]) => {
55
- return Object.assign(Object.assign({}, feature), { inNetworks: this.networks()
56
- .filter((network) => {
57
- return network.graph.hasNode(feature.name);
58
- })
59
- .map((network) => {
60
- return {
61
- network: network.name,
62
- neighbors: network.graph.neighbors(feature.name),
63
- };
64
- }) });
65
- }),
66
- networks: this.networks().map((network) => {
67
- return Object.assign({}, network);
68
- }),
69
- };
70
- }
71
- }
72
- export { DirectedGraph };
73
- export default {};
@@ -1,67 +0,0 @@
1
- // import {
2
- // Browser,
3
- // BrowserContext,
4
- // BrowserContextOptions,
5
- // DebugInfo,
6
- // Page,
7
- // PuppeteerNode,
8
- // Target,
9
- // } from "puppeteer-core";
10
- const fPaths = [];
11
- export class PM {
12
- }
13
- // export class PuppetMasterBrowser extends Browser {
14
- // process(): ChildProcess | null {
15
- // return super.process();
16
- // }
17
- // createBrowserContext(
18
- // options?: BrowserContextOptions
19
- // ): Promise<BrowserContext> {
20
- // throw new Error("Method not implemented.");
21
- // }
22
- // browserContexts(): BrowserContext[] {
23
- // throw new Error("Method not implemented.");
24
- // }
25
- // defaultBrowserContext(): BrowserContext {
26
- // throw new Error("Method not implemented.");
27
- // }
28
- // wsEndpoint(): string {
29
- // throw new Error("Method not implemented.");
30
- // }
31
- // newPage(): Promise<Page> {
32
- // throw new Error("Method not implemented.");
33
- // }
34
- // targets(): Target[] {
35
- // throw new Error("Method not implemented.");
36
- // }
37
- // target(): Target {
38
- // throw new Error("Method not implemented.");
39
- // }
40
- // version(): Promise<string> {
41
- // throw new Error("Method not implemented.");
42
- // }
43
- // userAgent(): Promise<string> {
44
- // throw new Error("Method not implemented.");
45
- // }
46
- // close(): Promise<void> {
47
- // throw new Error("Method not implemented.");
48
- // }
49
- // disconnect(): Promise<void> {
50
- // throw new Error("Method not implemented.");
51
- // }
52
- // get connected(): boolean {
53
- // throw new Error("Method not implemented.");
54
- // }
55
- // get debugInfo(): DebugInfo {
56
- // throw new Error("Method not implemented.");
57
- // }
58
- // constructor(...z: []) {
59
- // super(...z);
60
- // }
61
- // // pages(): Promise<Page[]>;
62
- // pages(): Promise<Page[]> {
63
- // return new Promise<Page[]>((res, rej) => {
64
- // res(super.pages());
65
- // });
66
- // }
67
- // }