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.
- package/README.md +9 -18
- package/dist/common/Node.js +14 -34
- package/dist/common/PM/index.js +71 -0
- package/dist/common/PM/main.js +361 -0
- package/dist/common/PM/node.js +176 -0
- package/dist/common/PM/web.js +174 -0
- package/dist/common/Project.js +20 -2
- package/dist/common/Puppeteer.js +109 -0
- package/dist/common/Reporter.js +119 -0
- package/dist/common/Scheduler.js +1 -0
- package/dist/common/SubPackages/puppeteer.js +3 -1
- package/dist/common/SubPackages/react-dom/component/web.js +98 -45
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -1
- package/dist/common/Web.js +24 -43
- package/dist/common/esbuildConfigs/web.js +3 -1
- package/dist/common/lib/abstractBase.js +189 -41
- package/dist/common/lib/basebuilder.js +56 -29
- package/dist/common/lib/classBuilder.js +6 -2
- package/dist/common/lib/core.js +41 -45
- package/dist/common/lib/index.js +2 -1
- package/dist/common/preload.js +14 -18
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Node.js +14 -34
- package/dist/module/PM/index.js +67 -0
- package/dist/module/PM/main.js +331 -0
- package/dist/module/PM/node.js +168 -0
- package/dist/module/PM/web.js +167 -0
- package/dist/module/Project.js +20 -2
- package/dist/module/Puppeteer.js +104 -0
- package/dist/module/Reporter.js +114 -0
- package/dist/module/Scheduler.js +1 -0
- package/dist/module/SubPackages/puppeteer.js +3 -1
- package/dist/module/SubPackages/react/jsx/node.js +1 -1
- package/dist/module/SubPackages/react-dom/component/web.js +98 -45
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -1
- package/dist/module/Web.js +24 -43
- package/dist/module/esbuildConfigs/web.js +3 -1
- package/dist/module/lib/abstractBase.js +189 -41
- package/dist/module/lib/basebuilder.js +56 -29
- package/dist/module/lib/classBuilder.js +6 -2
- package/dist/module/lib/core.js +41 -45
- package/dist/module/lib/index.js +2 -1
- package/dist/module/preload.js +15 -14
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Report.css +1616 -584
- package/dist/prebuild/Report.js +2635 -2506
- package/dist/types/PM/index.d.ts +19 -0
- package/dist/types/PM/main.d.ts +28 -0
- package/dist/types/PM/node.d.ts +26 -0
- package/dist/types/PM/web.d.ts +24 -0
- package/dist/types/Reporter.d.ts +1 -0
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/react-dom/component/web.d.ts +1 -1
- package/dist/types/lib/abstractBase.d.ts +13 -12
- package/dist/types/lib/basebuilder.d.ts +4 -2
- package/dist/types/lib/classBuilder.d.ts +2 -2
- package/dist/types/lib/core.d.ts +4 -4
- package/dist/types/lib/index.d.ts +6 -5
- package/dist/types/lib/types.d.ts +16 -24
- package/dist/types/preload.d.ts +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -5
- package/src/Node.ts +18 -43
- package/src/PM/index.ts +102 -0
- package/src/PM/main.ts +420 -0
- package/src/PM/node.ts +515 -0
- package/src/PM/web.ts +497 -0
- package/src/Project.ts +21 -2
- package/src/Puppeteer.ts +131 -0
- package/src/Report.tsx +158 -44
- package/src/Reporter.ts +134 -0
- package/src/Scheduler.ts +0 -0
- package/src/SubPackages/puppeteer.ts +3 -3
- package/src/SubPackages/react/jsx/node.ts +5 -8
- package/src/SubPackages/react-dom/component/web.ts +126 -67
- package/src/SubPackages/react-test-renderer/jsx/index.ts +0 -1
- package/src/Web.ts +25 -67
- package/src/esbuildConfigs/web.ts +4 -2
- package/src/lib/abstractBase.ts +260 -65
- package/src/lib/basebuilder.ts +121 -100
- package/src/lib/classBuilder.ts +5 -4
- package/src/lib/core.ts +58 -59
- package/src/lib/index.ts +10 -9
- package/src/lib/types.ts +18 -27
- package/src/preload.ts +14 -14
- package/dist/common/NodeWriter.js +0 -54
- package/dist/common/electron.js +0 -266
- package/dist/module/NodeWriter.js +0 -48
- package/dist/module/electron.js +0 -261
- package/dist/types/NodeWriter.d.ts +0 -2
- package/src/NodeWriter.ts +0 -72
- package/src/electron.ts +0 -317
- package/yarn-error.log +0 -3144
- /package/dist/types/{electron.d.ts → Puppeteer.d.ts} +0 -0
package/dist/module/lib/core.js
CHANGED
|
@@ -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,
|
|
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,
|
|
36
|
+
async setup(s, artifactory, tr, pm) {
|
|
12
37
|
return (fullTestInterface.beforeAll ||
|
|
13
|
-
(async (input, artifactory, tr,
|
|
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,
|
|
24
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value),
|
|
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,
|
|
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),
|
|
68
|
+
artifactory(`afterEach2-${this.name}/${fPath}`, value), pm)));
|
|
75
69
|
}
|
|
76
|
-
}, testResourceRequirement
|
|
70
|
+
}, testResourceRequirement
|
|
71
|
+
// puppetMaster
|
|
72
|
+
);
|
|
77
73
|
}
|
|
78
74
|
}
|
package/dist/module/lib/index.js
CHANGED
|
@@ -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,
|
package/dist/module/preload.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
// });
|