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