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.
- package/.eslintrc.js +5 -2
- package/Bundle.Dockerfile +52 -0
- package/README.md +25 -24
- package/build-tests.ts +16 -0
- package/dist/common/build-tests.js +38 -0
- package/dist/common/init-docs.js +8 -0
- package/dist/common/run-tests.js +34 -0
- package/dist/common/src/Aider.js +96 -0
- package/dist/common/src/Init.js +10 -0
- package/dist/common/{Node.js → src/Node.js} +1 -0
- package/dist/common/src/PM/index.js +7 -0
- package/dist/common/{PM → src/PM}/main.js +287 -10
- package/dist/common/{PM → src/PM}/node.js +4 -0
- package/dist/common/{PM → src/PM}/web.js +3 -0
- package/dist/common/{Project.js → src/Project.js} +15 -57
- package/dist/common/{Puppeteer.js → src/Puppeteer.js} +65 -26
- package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
- package/dist/common/src/SubPackages/react-dom/jsx/web.js +117 -0
- package/dist/common/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/common/{Types.js → src/Types.js} +0 -2
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +52 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
- package/dist/common/src/esbuildConfigs/report.js +14 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
- package/dist/common/src/lib/abstractBase.js +581 -0
- package/dist/common/{lib → src/lib}/basebuilder.js +12 -38
- package/dist/common/{lib → src/lib}/classBuilder.js +1 -3
- package/dist/common/{lib → src/lib}/core.js +3 -5
- package/dist/common/src/lib/types.js +2 -0
- package/dist/common/src/utils.js +16 -0
- package/dist/common/testeranto.js +15 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/build-tests.js +10 -0
- package/dist/module/init-docs.js +3 -0
- package/dist/module/run-tests.js +6 -0
- package/dist/module/src/Aider.js +89 -0
- package/dist/module/src/Init.js +5 -0
- package/dist/module/{Node.js → src/Node.js} +1 -0
- package/dist/module/src/PM/index.js +3 -0
- package/dist/module/src/PM/main.js +617 -0
- package/dist/module/{PM → src/PM}/node.js +4 -0
- package/dist/module/{PM → src/PM}/web.js +3 -0
- package/dist/module/{Project.js → src/Project.js} +15 -57
- package/dist/module/{Puppeteer.js → src/Puppeteer.js} +65 -26
- package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
- package/dist/module/src/SubPackages/react-dom/jsx/web.js +89 -0
- package/dist/module/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
- package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +1 -1
- package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +1 -1
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +47 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
- package/dist/module/src/esbuildConfigs/report.js +14 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
- package/dist/module/src/lib/abstractBase.js +573 -0
- package/dist/module/{lib → src/lib}/basebuilder.js +12 -38
- package/dist/module/{lib → src/lib}/classBuilder.js +1 -3
- package/dist/module/{lib → src/lib}/core.js +3 -5
- package/dist/module/src/utils.js +9 -0
- package/dist/module/testeranto.js +13 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/build-tests.d.ts +3 -0
- package/dist/types/init-docs.d.ts +2 -0
- package/dist/types/run-tests.d.ts +2 -0
- package/dist/types/src/Aider.d.ts +1 -0
- package/dist/types/src/Init.d.ts +2 -0
- package/dist/types/src/Node.d.ts +6 -0
- package/dist/types/{PM → src/PM}/index.d.ts +3 -2
- package/dist/types/{PM → src/PM}/main.d.ts +8 -3
- package/dist/types/{PM → src/PM}/node.d.ts +2 -0
- package/dist/types/{PM → src/PM}/web.d.ts +1 -0
- package/dist/types/{Project.d.ts → src/Project.d.ts} +1 -1
- package/dist/types/src/Puppeteer.d.ts +2 -0
- package/dist/types/src/SubPackages/puppeteer.d.ts +6 -0
- package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +1 -1
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +11 -0
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -7
- package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +1 -2
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +3 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +1 -2
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +1 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
- package/dist/types/src/Types.d.ts +51 -0
- package/dist/types/src/Web.d.ts +6 -0
- package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
- package/dist/types/{lib → src/lib}/abstractBase.d.ts +8 -8
- package/dist/types/{lib → src/lib}/basebuilder.d.ts +1 -1
- package/dist/types/{lib → src/lib}/classBuilder.d.ts +1 -1
- package/dist/types/{lib → src/lib}/core.d.ts +1 -1
- package/dist/types/{lib → src/lib}/index.d.ts +5 -5
- package/dist/types/{lib → src/lib}/types.d.ts +15 -15
- package/dist/types/src/utils.d.ts +2 -0
- package/dist/types/testeranto.d.ts +16 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docker-compose.yml +37 -0
- package/init-docs.ts +5 -0
- package/package.json +72 -25
- package/run-tests.ts +9 -0
- package/src/Aider.ts +125 -0
- package/src/Init.ts +20 -0
- package/src/Node.ts +31 -2
- package/src/PM/index.ts +7 -84
- package/src/PM/main.ts +400 -16
- package/src/PM/node.ts +6 -0
- package/src/PM/web.ts +4 -0
- package/src/Project.ts +33 -84
- package/src/Puppeteer.ts +115 -62
- package/src/SubPackages/react-dom/component/web.ts +10 -30
- package/src/SubPackages/react-dom/jsx/web.ts +110 -76
- package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
- package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
- package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
- package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
- package/src/Types.ts +138 -29
- package/src/Web.ts +32 -2
- package/src/esbuildConfigs/index.ts +1 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +67 -0
- package/src/esbuildConfigs/node.ts +4 -2
- package/src/esbuildConfigs/report.ts +13 -13
- package/src/esbuildConfigs/web.ts +4 -0
- package/src/lib/abstractBase.ts +366 -36
- package/src/lib/basebuilder.ts +26 -52
- package/src/lib/classBuilder.ts +14 -2
- package/src/lib/core.ts +18 -7
- package/src/lib/index.ts +115 -7
- package/src/lib/types.ts +143 -37
- package/src/utils.ts +15 -0
- package/testeranto.ts +13 -0
- package/tsconfig.common.json +12 -4
- package/tsconfig.json +9 -3
- package/tsconfig.module.json +2 -3
- package/tsconfig.types.json +1 -2
- package/dist/common/Features.js +0 -84
- package/dist/common/PM/index.js +0 -71
- package/dist/common/Reporter.js +0 -119
- package/dist/common/Scheduler.js +0 -1
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -93
- package/dist/common/esbuildConfigs/report.js +0 -13
- package/dist/common/lib/abstractBase.js +0 -348
- package/dist/common/preload.js +0 -15
- package/dist/common/report.html.js +0 -31
- package/dist/module/Features.js +0 -73
- package/dist/module/PM/index.js +0 -67
- package/dist/module/PM/main.js +0 -340
- package/dist/module/Reporter.js +0 -114
- package/dist/module/Scheduler.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -65
- package/dist/module/Types.js +0 -3
- package/dist/module/esbuildConfigs/report.js +0 -11
- package/dist/module/lib/abstractBase.js +0 -340
- package/dist/module/preload.js +0 -15
- package/dist/module/report.html.js +0 -29
- package/dist/prebuild/Report.css +0 -11358
- package/dist/prebuild/Report.js +0 -37585
- package/dist/types/Features.d.ts +0 -68
- package/dist/types/Node.d.ts +0 -6
- package/dist/types/SubPackages/puppeteer.d.ts +0 -6
- package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -5
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -6
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/Types.d.ts +0 -50
- package/dist/types/Web.d.ts +0 -6
- package/dist/types/esbuildConfigs/report.d.ts +0 -4
- package/dist/types/preload.d.ts +0 -0
- package/dist/types/report.html.d.ts +0 -2
- package/electronBuild.ts +0 -32
- package/src/Features.ts +0 -118
- package/src/Report.tsx +0 -521
- package/src/Reporter.ts +0 -134
- package/src/Scheduler.ts +0 -0
- package/src/preload.ts +0 -17
- package/src/report.html.ts +0 -29
- package/tests/Rectangle.test.ts +0 -189
- /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/common/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/common/{Web.js → src/Web.js} +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/common/{lib → src/lib}/index.js +0 -0
- /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/common/{web.html.js → src/web.html.js} +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/module/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/{types/Puppeteer.d.ts → module/src/Types.js} +0 -0
- /package/dist/module/{Web.js → src/Web.js} +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/module/{lib → src/lib}/index.js +0 -0
- /package/dist/{types/Reporter.d.ts → module/src/lib/types.js} +0 -0
- /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/module/{web.html.js → src/web.html.js} +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
- /package/dist/types/{Scheduler.d.ts → src/esbuildConfigs/report.d.ts} +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
- /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
export class BaseSuite {
|
|
2
|
-
constructor(name, index, givens = {}, checks = []) {
|
|
3
|
-
this.name = name;
|
|
4
|
-
this.index = index;
|
|
5
|
-
this.givens = givens;
|
|
6
|
-
this.checks = checks;
|
|
7
|
-
this.fails = [];
|
|
8
|
-
}
|
|
9
|
-
toObj() {
|
|
10
|
-
return {
|
|
11
|
-
name: this.name,
|
|
12
|
-
givens: Object.keys(this.givens).map((k) => this.givens[k].toObj()),
|
|
13
|
-
fails: this.fails,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
setup(s, artifactory, tr, pm) {
|
|
17
|
-
return new Promise((res) => res(s));
|
|
18
|
-
}
|
|
19
|
-
assertThat(t) {
|
|
20
|
-
return t;
|
|
21
|
-
}
|
|
22
|
-
afterAll(store, artifactory, pm) {
|
|
23
|
-
return store;
|
|
24
|
-
}
|
|
25
|
-
async run(input, testResourceConfiguration, artifactory, tLog, pm) {
|
|
26
|
-
this.testResourceConfiguration = testResourceConfiguration;
|
|
27
|
-
tLog("test resources: ", JSON.stringify(testResourceConfiguration));
|
|
28
|
-
const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
|
|
29
|
-
console.log("\nSuite:", this.index, this.name);
|
|
30
|
-
tLog("\nSuite:", this.index, this.name);
|
|
31
|
-
const sNdx = this.index;
|
|
32
|
-
const sName = this.name;
|
|
33
|
-
for (const [gNdx, g] of Object.entries(this.givens)) {
|
|
34
|
-
const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, pm);
|
|
35
|
-
const giver = this.givens[gNdx];
|
|
36
|
-
try {
|
|
37
|
-
this.store = await giver.give(subject, gNdx, testResourceConfiguration, this.assertThat, suiteArtifactory, tLog, pm, sNdx);
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
console.error(e);
|
|
41
|
-
this.fails.push(giver);
|
|
42
|
-
// return this;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const afterAllProxy = new Proxy(pm, {
|
|
46
|
-
get(target, prop, receiver) {
|
|
47
|
-
if (prop === "writeFileSync") {
|
|
48
|
-
return (fp, contents) => target[prop](`suite-${sNdx}/afterAll/${fp}`, contents);
|
|
49
|
-
}
|
|
50
|
-
if (prop === "browser") {
|
|
51
|
-
return new Proxy(target[prop], {
|
|
52
|
-
get(bTarget, bProp, bReceiver) {
|
|
53
|
-
if (bProp === "pages") {
|
|
54
|
-
return async () => {
|
|
55
|
-
return bTarget.pages().then((pages) => {
|
|
56
|
-
return pages.map((page) => {
|
|
57
|
-
return new Proxy(page, {
|
|
58
|
-
get(pTarget, pProp, pReciever) {
|
|
59
|
-
if (pProp === "screenshot") {
|
|
60
|
-
return async (x) => {
|
|
61
|
-
// console.log(
|
|
62
|
-
// "custom-screenshot-MARK-afterAllProxy",
|
|
63
|
-
// // arguments,
|
|
64
|
-
// // x,
|
|
65
|
-
// window["custom-screenshot"].toString()
|
|
66
|
-
// );
|
|
67
|
-
return await window["custom-screenshot"](Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
|
|
68
|
-
"/" +
|
|
69
|
-
x.path }));
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
// else if (pProp === "mainFrame") {
|
|
73
|
-
// return () => target[pProp](...arguments);
|
|
74
|
-
// }
|
|
75
|
-
else {
|
|
76
|
-
return Reflect.get(...arguments);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
// return (await target.pages()).map((page) => {
|
|
83
|
-
// return new Proxy(page, handler2);
|
|
84
|
-
// });
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return Reflect.get(...arguments);
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
// pm.browser
|
|
94
|
-
try {
|
|
95
|
-
this.afterAll(this.store, artifactory, afterAllProxy);
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
console.error(e);
|
|
99
|
-
// this.fails.push(this);
|
|
100
|
-
// return this;
|
|
101
|
-
}
|
|
102
|
-
// for (const [ndx, thater] of this.checks.entries()) {
|
|
103
|
-
// await thater.check(
|
|
104
|
-
// subject,
|
|
105
|
-
// thater.name,
|
|
106
|
-
// testResourceConfiguration,
|
|
107
|
-
// this.assertThat,
|
|
108
|
-
// suiteArtifactory,
|
|
109
|
-
// tLog,
|
|
110
|
-
// pm
|
|
111
|
-
// );
|
|
112
|
-
// }
|
|
113
|
-
// @TODO fix me
|
|
114
|
-
// for (const k of Object.keys(this.givens)) {
|
|
115
|
-
// const giver = this.givens[k];
|
|
116
|
-
// try {
|
|
117
|
-
// giver.afterAll(this.store, artifactory, pm);
|
|
118
|
-
// } catch (e) {
|
|
119
|
-
// console.error(e);
|
|
120
|
-
// this.fails.push(giver);
|
|
121
|
-
// return this;
|
|
122
|
-
// }
|
|
123
|
-
// }
|
|
124
|
-
////////////////
|
|
125
|
-
return this;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
export class BaseGiven {
|
|
129
|
-
constructor(name, features, whens, thens, givenCB, initialValues) {
|
|
130
|
-
this.name = name;
|
|
131
|
-
this.features = features;
|
|
132
|
-
this.whens = whens;
|
|
133
|
-
this.thens = thens;
|
|
134
|
-
this.givenCB = givenCB;
|
|
135
|
-
this.initialValues = initialValues;
|
|
136
|
-
}
|
|
137
|
-
beforeAll(store, artifactory) {
|
|
138
|
-
return store;
|
|
139
|
-
}
|
|
140
|
-
toObj() {
|
|
141
|
-
return {
|
|
142
|
-
name: this.name,
|
|
143
|
-
whens: this.whens.map((w) => w.toObj()),
|
|
144
|
-
thens: this.thens.map((t) => t.toObj()),
|
|
145
|
-
error: this.error ? [this.error, this.error.stack] : null,
|
|
146
|
-
// fail: this.fail ? [this.fail] : false,
|
|
147
|
-
features: this.features,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
async afterEach(store, key, artifactory, pm) {
|
|
151
|
-
return store;
|
|
152
|
-
}
|
|
153
|
-
async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
|
|
154
|
-
tLog(`\n Given: ${this.name}`);
|
|
155
|
-
const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
|
|
156
|
-
try {
|
|
157
|
-
// tLog(`\n Given this.store`, this.store);
|
|
158
|
-
const beforeEachProxy = new Proxy(pm, {
|
|
159
|
-
get(target, prop, receiver) {
|
|
160
|
-
if (prop === "writeFileSync") {
|
|
161
|
-
console.log("beforeEachProx", arguments, target[prop]);
|
|
162
|
-
return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`, contents);
|
|
163
|
-
}
|
|
164
|
-
return Reflect.get(...arguments);
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, beforeEachProxy);
|
|
168
|
-
for (const [whenNdx, whenStep] of this.whens.entries()) {
|
|
169
|
-
await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/when/${whenNdx}`);
|
|
170
|
-
}
|
|
171
|
-
for (const thenStep of this.thens) {
|
|
172
|
-
const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm);
|
|
173
|
-
tester(t);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
catch (e) {
|
|
177
|
-
this.error = e;
|
|
178
|
-
tLog(e);
|
|
179
|
-
tLog("\u0007"); // bell
|
|
180
|
-
// throw e;
|
|
181
|
-
}
|
|
182
|
-
finally {
|
|
183
|
-
try {
|
|
184
|
-
// const afterEachProxy = new Proxy(pm, {
|
|
185
|
-
// get(target, prop, receiver) {
|
|
186
|
-
// if (prop === "writeFileSync") {
|
|
187
|
-
// console.log("afterEachProxy", arguments, target[prop]);
|
|
188
|
-
// return (fp, contents) =>
|
|
189
|
-
// // target[prop](`${key}/andWhen/${fp}`, contents);
|
|
190
|
-
// target[prop](`${key}/afterEach/${fp}`, contents);
|
|
191
|
-
// }
|
|
192
|
-
// return Reflect.get(...arguments);
|
|
193
|
-
// },
|
|
194
|
-
// });
|
|
195
|
-
// await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
|
|
196
|
-
// await this.afterEach(this.store, key, givenArtifactory, pm);
|
|
197
|
-
const afterEachProxy = new Proxy(pm, {
|
|
198
|
-
get(target, prop, receiver) {
|
|
199
|
-
if (prop === "writeFileSync") {
|
|
200
|
-
return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/afterAll/${fp}`, contents);
|
|
201
|
-
}
|
|
202
|
-
if (prop === "browser") {
|
|
203
|
-
return new Proxy(target[prop], {
|
|
204
|
-
get(bTarget, bProp, bReceiver) {
|
|
205
|
-
if (bProp === "pages") {
|
|
206
|
-
return async () => {
|
|
207
|
-
return bTarget.pages().then((pages) => {
|
|
208
|
-
return pages.map((page) => {
|
|
209
|
-
return new Proxy(page, {
|
|
210
|
-
get(pTarget, pProp, pReciever) {
|
|
211
|
-
if (pProp === "screenshot") {
|
|
212
|
-
return async (x) => {
|
|
213
|
-
// console.log(
|
|
214
|
-
// "custom-screenshot-MARK-afterEachProxy",
|
|
215
|
-
// window["custom-screenshot"].toString()
|
|
216
|
-
// );
|
|
217
|
-
return await pTarget[pProp](Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
|
|
218
|
-
"/" +
|
|
219
|
-
x.path }));
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
// else if (pProp === "mainFrame") {
|
|
223
|
-
// return () => target[pProp](...arguments);
|
|
224
|
-
// }
|
|
225
|
-
else {
|
|
226
|
-
return Reflect.get(...arguments);
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
// return (await target.pages()).map((page) => {
|
|
233
|
-
// return new Proxy(page, handler2);
|
|
234
|
-
// });
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
return Reflect.get(...arguments);
|
|
241
|
-
},
|
|
242
|
-
});
|
|
243
|
-
await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
|
|
244
|
-
}
|
|
245
|
-
catch (e) {
|
|
246
|
-
console.error("afterEach failed! no error will be recorded!", e);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return this.store;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
export class BaseWhen {
|
|
253
|
-
constructor(name, whenCB) {
|
|
254
|
-
this.name = name;
|
|
255
|
-
this.whenCB = whenCB;
|
|
256
|
-
}
|
|
257
|
-
toObj() {
|
|
258
|
-
return {
|
|
259
|
-
name: this.name,
|
|
260
|
-
error: this.error,
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
async test(store, testResourceConfiguration, tLog, pm, key) {
|
|
264
|
-
tLog(" When:", this.name);
|
|
265
|
-
const name = this.name;
|
|
266
|
-
const andWhenProxy = new Proxy(pm, {
|
|
267
|
-
get(target, prop, receiver) {
|
|
268
|
-
if (prop === "writeFileSync") {
|
|
269
|
-
console.log("andWhenProxy", arguments, target[prop]);
|
|
270
|
-
return (fp, contents) =>
|
|
271
|
-
// target[prop](`${key}/andWhen/${fp}`, contents);
|
|
272
|
-
target[prop](`${key}/andWhen/${fp}`, contents);
|
|
273
|
-
}
|
|
274
|
-
return Reflect.get(...arguments);
|
|
275
|
-
},
|
|
276
|
-
});
|
|
277
|
-
try {
|
|
278
|
-
return await this.andWhen(store, this.whenCB, testResourceConfiguration, andWhenProxy);
|
|
279
|
-
}
|
|
280
|
-
catch (e) {
|
|
281
|
-
this.error = true;
|
|
282
|
-
throw e;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
export class BaseThen {
|
|
287
|
-
constructor(name, thenCB) {
|
|
288
|
-
this.name = name;
|
|
289
|
-
this.thenCB = thenCB;
|
|
290
|
-
this.error = false;
|
|
291
|
-
}
|
|
292
|
-
toObj() {
|
|
293
|
-
return {
|
|
294
|
-
name: this.name,
|
|
295
|
-
error: this.error,
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
async test(store, testResourceConfiguration, tLog, pm) {
|
|
299
|
-
tLog(" Then:", this.name);
|
|
300
|
-
try {
|
|
301
|
-
const x = await this.butThen(store, this.thenCB, testResourceConfiguration);
|
|
302
|
-
return x;
|
|
303
|
-
}
|
|
304
|
-
catch (e) {
|
|
305
|
-
console.log("test failed", e);
|
|
306
|
-
this.error = e.message;
|
|
307
|
-
throw e;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
export class BaseCheck {
|
|
312
|
-
constructor(name, features, checkCB, whens, thens) {
|
|
313
|
-
this.name = name;
|
|
314
|
-
this.features = features;
|
|
315
|
-
this.checkCB = checkCB;
|
|
316
|
-
this.whens = whens;
|
|
317
|
-
this.thens = thens;
|
|
318
|
-
}
|
|
319
|
-
async afterEach(store, key, cb, pm) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
async check(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm) {
|
|
323
|
-
tLog(`\n Check: ${this.name}`);
|
|
324
|
-
const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
|
|
325
|
-
await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
|
|
326
|
-
a[key] = async (payload) => {
|
|
327
|
-
return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm, "x");
|
|
328
|
-
};
|
|
329
|
-
return a;
|
|
330
|
-
}, {}), Object.entries(this.thens).reduce((a, [key, then]) => {
|
|
331
|
-
a[key] = async (payload) => {
|
|
332
|
-
const t = await then(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm);
|
|
333
|
-
tester(t);
|
|
334
|
-
};
|
|
335
|
-
return a;
|
|
336
|
-
}, {}));
|
|
337
|
-
await this.afterEach(store, key, () => { }, pm);
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
}
|
package/dist/module/preload.js
DELETED
|
@@ -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,29 +0,0 @@
|
|
|
1
|
-
export default () => `
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<meta name="description" content="Webpage description goes here" />
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<title>kokomoBay - testeranto</title>
|
|
9
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
-
<meta name="author" content="" />
|
|
11
|
-
|
|
12
|
-
<link rel="stylesheet" href="./Report.css">
|
|
13
|
-
|
|
14
|
-
<script type="importmap">
|
|
15
|
-
{
|
|
16
|
-
"imports": {
|
|
17
|
-
"features.test.js": "./features.test.js",
|
|
18
|
-
"testeranto.json": "./testeranto.json"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<script type="module" src="./Report.js"></script>
|
|
24
|
-
</head>
|
|
25
|
-
|
|
26
|
-
<body><div id="root">react is loading</div></body>
|
|
27
|
-
|
|
28
|
-
</html>
|
|
29
|
-
`;
|