testeranto 0.70.0 → 0.73.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 (94) hide show
  1. package/README.md +9 -18
  2. package/dist/common/Node.js +14 -34
  3. package/dist/common/PM/index.js +71 -0
  4. package/dist/common/PM/main.js +361 -0
  5. package/dist/common/PM/node.js +176 -0
  6. package/dist/common/PM/web.js +174 -0
  7. package/dist/common/Project.js +20 -2
  8. package/dist/common/Puppeteer.js +109 -0
  9. package/dist/common/Reporter.js +119 -0
  10. package/dist/common/Scheduler.js +1 -0
  11. package/dist/common/SubPackages/puppeteer.js +3 -1
  12. package/dist/common/SubPackages/react-dom/component/web.js +98 -45
  13. package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -1
  14. package/dist/common/Web.js +24 -43
  15. package/dist/common/esbuildConfigs/web.js +3 -1
  16. package/dist/common/lib/abstractBase.js +189 -41
  17. package/dist/common/lib/basebuilder.js +56 -29
  18. package/dist/common/lib/classBuilder.js +6 -2
  19. package/dist/common/lib/core.js +41 -45
  20. package/dist/common/lib/index.js +2 -1
  21. package/dist/common/preload.js +14 -18
  22. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  23. package/dist/module/Node.js +14 -34
  24. package/dist/module/PM/index.js +67 -0
  25. package/dist/module/PM/main.js +331 -0
  26. package/dist/module/PM/node.js +168 -0
  27. package/dist/module/PM/web.js +167 -0
  28. package/dist/module/Project.js +20 -2
  29. package/dist/module/Puppeteer.js +104 -0
  30. package/dist/module/Reporter.js +114 -0
  31. package/dist/module/Scheduler.js +1 -0
  32. package/dist/module/SubPackages/puppeteer.js +3 -1
  33. package/dist/module/SubPackages/react/jsx/node.js +1 -1
  34. package/dist/module/SubPackages/react-dom/component/web.js +98 -45
  35. package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -1
  36. package/dist/module/Web.js +24 -43
  37. package/dist/module/esbuildConfigs/web.js +3 -1
  38. package/dist/module/lib/abstractBase.js +189 -41
  39. package/dist/module/lib/basebuilder.js +56 -29
  40. package/dist/module/lib/classBuilder.js +6 -2
  41. package/dist/module/lib/core.js +41 -45
  42. package/dist/module/lib/index.js +2 -1
  43. package/dist/module/preload.js +15 -14
  44. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  45. package/dist/prebuild/Report.css +1616 -584
  46. package/dist/prebuild/Report.js +2635 -2506
  47. package/dist/types/PM/index.d.ts +19 -0
  48. package/dist/types/PM/main.d.ts +28 -0
  49. package/dist/types/PM/node.d.ts +26 -0
  50. package/dist/types/PM/web.d.ts +24 -0
  51. package/dist/types/Reporter.d.ts +1 -0
  52. package/dist/types/Scheduler.d.ts +0 -0
  53. package/dist/types/SubPackages/react-dom/component/web.d.ts +1 -1
  54. package/dist/types/lib/abstractBase.d.ts +13 -12
  55. package/dist/types/lib/basebuilder.d.ts +4 -2
  56. package/dist/types/lib/classBuilder.d.ts +2 -2
  57. package/dist/types/lib/core.d.ts +4 -4
  58. package/dist/types/lib/index.d.ts +6 -5
  59. package/dist/types/lib/types.d.ts +16 -24
  60. package/dist/types/preload.d.ts +0 -1
  61. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  62. package/package.json +3 -5
  63. package/src/Node.ts +18 -43
  64. package/src/PM/index.ts +102 -0
  65. package/src/PM/main.ts +420 -0
  66. package/src/PM/node.ts +515 -0
  67. package/src/PM/web.ts +497 -0
  68. package/src/Project.ts +21 -2
  69. package/src/Puppeteer.ts +131 -0
  70. package/src/Report.tsx +158 -44
  71. package/src/Reporter.ts +134 -0
  72. package/src/Scheduler.ts +0 -0
  73. package/src/SubPackages/puppeteer.ts +3 -3
  74. package/src/SubPackages/react/jsx/node.ts +5 -8
  75. package/src/SubPackages/react-dom/component/web.ts +126 -67
  76. package/src/SubPackages/react-test-renderer/jsx/index.ts +0 -1
  77. package/src/Web.ts +25 -67
  78. package/src/esbuildConfigs/web.ts +4 -2
  79. package/src/lib/abstractBase.ts +260 -65
  80. package/src/lib/basebuilder.ts +121 -100
  81. package/src/lib/classBuilder.ts +5 -4
  82. package/src/lib/core.ts +58 -59
  83. package/src/lib/index.ts +10 -9
  84. package/src/lib/types.ts +18 -27
  85. package/src/preload.ts +14 -14
  86. package/dist/common/NodeWriter.js +0 -54
  87. package/dist/common/electron.js +0 -266
  88. package/dist/module/NodeWriter.js +0 -48
  89. package/dist/module/electron.js +0 -261
  90. package/dist/types/NodeWriter.d.ts +0 -2
  91. package/src/NodeWriter.ts +0 -72
  92. package/src/electron.ts +0 -317
  93. package/yarn-error.log +0 -3144
  94. /package/dist/types/{electron.d.ts → Puppeteer.d.ts} +0 -0
@@ -2,59 +2,53 @@ import { DefaultTestInterface, defaultTestResourceRequirement, } from "./index.j
2
2
  import { BaseSuite, BaseGiven, BaseWhen, BaseThen, BaseCheck, } from "./abstractBase.js";
3
3
  import { ClassBuilder } from "./classBuilder.js";
4
4
  export default class Testeranto extends ClassBuilder {
5
- constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, logWriter, testInterface) {
5
+ constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testInterface
6
+ // puppetMaster: PM
7
+ ) {
6
8
  const fullTestInterface = DefaultTestInterface(testInterface);
7
9
  super(testImplementation, testSpecification, input, class extends BaseSuite {
10
+ afterAll(store, artifactory, pm) {
11
+ // const pagesHandler = {
12
+ // get(target, prop) {
13
+ // console.log(`Getting pages property ${prop}`);
14
+ // return target[prop];
15
+ // },
16
+ // };
17
+ // const browserHandler = {
18
+ // get(target, prop) {
19
+ // console.log(`Getting browser property ${prop}`);
20
+ // if (prop === "pages") {
21
+ // // return target[prop];
22
+ // return new Proxy(target[prop], pagesHandler);
23
+ // } else {
24
+ // return target[prop];
25
+ // }
26
+ // },
27
+ // };
28
+ // const proxy = new Proxy(utils.browser, browserHandler);
29
+ return fullTestInterface.afterAll(store, (fPath, value) => {
30
+ artifactory(`afterAll4-${this.name}/${fPath}`, value);
31
+ }, pm);
32
+ }
8
33
  assertThat(t) {
9
34
  fullTestInterface.assertThis(t);
10
35
  }
11
- async setup(s, artifactory, tr, utils) {
36
+ async setup(s, artifactory, tr, pm) {
12
37
  return (fullTestInterface.beforeAll ||
13
- (async (input, artifactory, tr, utils) => input))(s, this.testResourceConfiguration, artifactory, utils);
38
+ (async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration, artifactory, pm);
14
39
  }
15
40
  }, class Given extends BaseGiven {
16
- async givenThat(subject, testResource, artifactory, initializer) {
41
+ async givenThat(subject, testResource, artifactory, initializer, pm) {
17
42
  return fullTestInterface.beforeEach(subject, initializer, (fPath, value) =>
18
43
  // TODO does not work?
19
- artifactory(`beforeEach/${fPath}`, value), testResource, this.initialValues
20
- // utils,
21
- );
44
+ artifactory(`beforeEach/${fPath}`, value), testResource, this.initialValues, pm);
22
45
  }
23
- afterEach(store, key, artifactory, utils) {
24
- return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value), utils)));
25
- }
26
- afterAll(store, artifactory, utils) {
27
- const pagesHandler = {
28
- get(target, prop) {
29
- console.log(`Getting pages property ${prop}`);
30
- return target[prop];
31
- },
32
- };
33
- const browserHandler = {
34
- get(target, prop) {
35
- console.log(`Getting browser property ${prop}`);
36
- if (prop === "pages") {
37
- // return target[prop];
38
- return new Proxy(target[prop], pagesHandler);
39
- }
40
- else {
41
- return target[prop];
42
- }
43
- },
44
- };
45
- const proxy = new Proxy(utils.browser, browserHandler);
46
- return fullTestInterface.afterAll(store, (fPath, value) => {
47
- artifactory(`afterAll4-${this.name}/${fPath}`, value);
48
- }, utils
49
- // {
50
- // ...utils,
51
- // browser: proxy,
52
- // }
53
- );
46
+ afterEach(store, key, artifactory, pm) {
47
+ return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value), pm)));
54
48
  }
55
49
  }, class When extends BaseWhen {
56
- async andWhen(store, whenCB, testResource) {
57
- return await fullTestInterface.andWhen(store, whenCB, testResource);
50
+ async andWhen(store, whenCB, testResource, pm) {
51
+ return await fullTestInterface.andWhen(store, whenCB, testResource, pm);
58
52
  }
59
53
  }, class Then extends BaseThen {
60
54
  async butThen(store, thenCB, testResourceConfiguration) {
@@ -65,14 +59,16 @@ export default class Testeranto extends ClassBuilder {
65
59
  super(name, features, checkCallback, whens, thens);
66
60
  this.initialValues = initialValues;
67
61
  }
68
- async checkThat(subject, testResourceConfiguration, artifactory) {
69
- return fullTestInterface.beforeEach(subject, this.initialValues, (fPath, value) => artifactory(`before/${fPath}`, value), testResourceConfiguration, this.initialValues);
62
+ async checkThat(subject, testResourceConfiguration, artifactory, pm) {
63
+ return fullTestInterface.beforeEach(subject, this.initialValues, (fPath, value) => artifactory(`before/${fPath}`, value), testResourceConfiguration, this.initialValues, pm);
70
64
  }
71
- afterEach(store, key, artifactory, utils) {
65
+ afterEach(store, key, artifactory, pm) {
72
66
  return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) =>
73
67
  // TODO does not work?
74
- artifactory(`afterEach2-${this.name}/${fPath}`, value), utils)));
68
+ artifactory(`afterEach2-${this.name}/${fPath}`, value), pm)));
75
69
  }
76
- }, testResourceRequirement, logWriter);
70
+ }, testResourceRequirement
71
+ // puppetMaster
72
+ );
77
73
  }
78
74
  }
@@ -1,6 +1,7 @@
1
+ // import { INodeUtils, ITestInterface, IUtils, IWebUtils } from "./types.js";
1
2
  export const BaseTestInterface = {
2
3
  beforeAll: async (s) => s,
3
- beforeEach: async function (subject, initialValues, testResource) {
4
+ beforeEach: async function (subject, initialValues, x, testResource, pm) {
4
5
  return subject;
5
6
  },
6
7
  afterEach: async (s) => s,
@@ -1,14 +1,15 @@
1
- import puppeteer from "puppeteer-core";
2
- import { NodeWriter } from "./NodeWriter";
3
- import puppeteerConfiger from "./puppeteerConfiger";
4
- window.NodeWriter = NodeWriter;
5
- window.browser = new Promise(async (res, rej) => {
6
- const browser = await puppeteerConfiger("2999").then(async (json) => {
7
- const b = await puppeteer.connect({
8
- browserWSEndpoint: json.webSocketDebuggerUrl,
9
- defaultViewport: null,
10
- });
11
- console.log("connected!", b.isConnected());
12
- return res(b);
13
- });
14
- });
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
+ // });