testeranto 0.75.0 → 0.79.4
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 +25 -24
- package/TaskMan.Dockerfile +23 -0
- package/TaskMan1.Dockerfile +23 -0
- package/devBot.dockerfile +12 -0
- package/dist/TaskMan.Dockerfile +23 -0
- package/dist/common/Node.js +1 -0
- package/dist/common/PM/index.js +0 -64
- package/dist/common/PM/main.js +278 -7
- package/dist/common/PM/node.js +4 -0
- package/dist/common/PM/web.js +3 -0
- package/dist/common/Project.js +6 -2
- package/dist/common/Puppeteer.js +12 -17
- package/dist/common/Reporter.js +1 -8
- package/dist/common/SubPackages/react-dom/component/web.js +5 -25
- package/dist/common/SubPackages/react-dom/jsx/web.js +80 -55
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -86
- package/dist/common/SubPackages/react-test-renderer/component/interface.js +68 -0
- package/dist/common/SubPackages/react-test-renderer/component/node.js +2 -2
- package/dist/common/SubPackages/react-test-renderer/component/web.js +2 -2
- package/dist/common/TaskManBackEnd.js +174 -0
- package/dist/common/Types.js +0 -2
- package/dist/common/esbuildConfigs/index.js +1 -0
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +49 -0
- package/dist/common/esbuildConfigs/node.js +3 -1
- package/dist/common/esbuildConfigs/web.js +3 -1
- package/dist/common/lib/abstractBase.js +222 -17
- package/dist/common/lib/basebuilder.js +4 -38
- package/dist/common/lib/classBuilder.js +1 -3
- package/dist/common/lib/core.js +3 -5
- package/dist/common/mongooseSchemas.js +56 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +16 -0
- package/dist/module/ExampleTab.js +112 -0
- package/dist/module/Node.js +1 -0
- package/dist/module/PM/index.js +0 -64
- package/dist/module/PM/main.js +278 -7
- package/dist/module/PM/node.js +4 -0
- package/dist/module/PM/web.js +3 -0
- package/dist/module/Project.js +6 -2
- package/dist/module/Puppeteer.js +12 -17
- package/dist/module/Reporter.js +1 -8
- package/dist/module/SubPackages/react-dom/component/web.js +5 -25
- package/dist/module/SubPackages/react-dom/jsx/web.js +80 -55
- package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -59
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +39 -0
- package/dist/module/SubPackages/react-test-renderer/component/node.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/component/web.js +1 -1
- package/dist/module/TaskManBackEnd.js +169 -0
- package/dist/module/TaskManFrontEnd.js +600 -0
- package/dist/module/Types.js +0 -2
- package/dist/module/esbuildConfigs/index.js +1 -0
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +44 -0
- package/dist/module/esbuildConfigs/node.js +3 -1
- package/dist/module/esbuildConfigs/web.js +3 -1
- package/dist/module/lib/abstractBase.js +222 -17
- package/dist/module/lib/basebuilder.js +4 -38
- package/dist/module/lib/classBuilder.js +1 -3
- package/dist/module/lib/core.js +3 -5
- package/dist/module/mongooseSchemas.js +50 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +9 -0
- package/dist/prebuild/Report.js +117 -36
- package/dist/prebuild/TaskManBackEnd.mjs +180 -0
- package/dist/prebuild/TaskManFrontEnd.css +12301 -0
- package/dist/prebuild/TaskManFrontEnd.js +81737 -0
- package/dist/types/Node.d.ts +1 -1
- package/dist/types/PM/index.d.ts +2 -1
- package/dist/types/PM/main.d.ts +6 -3
- package/dist/types/PM/node.d.ts +2 -0
- package/dist/types/PM/web.d.ts +1 -0
- package/dist/types/SubPackages/puppeteer.d.ts +1 -1
- package/dist/types/SubPackages/react/component/node.d.ts +1 -1
- package/dist/types/SubPackages/react/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/node.d.ts +2 -2
- package/dist/types/SubPackages/react/jsx/web.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/component/node.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/component/web.d.ts +8 -2
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +2 -2
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +2 -2
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -7
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +1 -2
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +1 -2
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +1 -2
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +1 -2
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +1 -2
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +1 -2
- package/dist/types/TaskManBackEnd.d.ts +1 -0
- package/dist/types/Types.d.ts +19 -19
- package/dist/types/Web.d.ts +1 -1
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
- package/dist/types/lib/abstractBase.d.ts +8 -8
- package/dist/types/lib/basebuilder.d.ts +1 -1
- package/dist/types/lib/classBuilder.d.ts +1 -1
- package/dist/types/lib/core.d.ts +1 -1
- package/dist/types/lib/index.d.ts +5 -5
- package/dist/types/lib/types.d.ts +15 -13
- package/dist/types/mongooseSchemas.d.ts +124 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +2 -0
- package/docker-compose-dev.yml +9 -0
- package/docker-compose-prod.yml +18 -0
- package/package.json +20 -7
- package/src/ExampleTab.tsx +219 -0
- package/src/Node.ts +31 -2
- package/src/PM/index.ts +6 -83
- package/src/PM/main.ts +389 -11
- package/src/PM/node.ts +6 -0
- package/src/PM/web.ts +4 -0
- package/src/Project.ts +10 -2
- package/src/Puppeteer.ts +16 -17
- package/src/Report.tsx +17 -40
- package/src/Reporter.ts +1 -9
- package/src/SubPackages/react-dom/component/web.ts +10 -30
- package/src/SubPackages/react-dom/jsx/web.ts +111 -74
- 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/TaskManBackEnd.ts +218 -0
- package/src/TaskManFrontEnd.tsx +1222 -0
- package/src/Types.ts +136 -28
- package/src/Web.ts +32 -2
- package/src/esbuildConfigs/index.ts +1 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +65 -0
- package/src/esbuildConfigs/node.ts +3 -1
- package/src/esbuildConfigs/web.ts +4 -0
- package/src/lib/abstractBase.ts +337 -34
- package/src/lib/basebuilder.ts +17 -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 -35
- package/src/mongooseSchemas.ts +105 -0
- package/src/utils.ts +15 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import baseEsBuildConfig from "./index.js";
|
|
2
|
+
import inputFilesPlugin from "./inputFilesPlugin";
|
|
2
3
|
export default (config, entryPoints) => {
|
|
3
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node", inject: [`./node_modules/testeranto/dist/cjs-shim.js`], supported: {
|
|
4
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node", inject: [`./node_modules/testeranto/dist/cjs-shim.js`], metafile: true, supported: {
|
|
4
5
|
"dynamic-import": true,
|
|
5
6
|
}, define: {
|
|
6
7
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
@@ -15,6 +16,7 @@ export default (config, entryPoints) => {
|
|
|
15
16
|
...config.externals,
|
|
16
17
|
], entryPoints: [...entryPoints], plugins: [
|
|
17
18
|
...(config.nodePlugins || []),
|
|
19
|
+
inputFilesPlugin("node", entryPoints),
|
|
18
20
|
{
|
|
19
21
|
name: "rebuild-notify",
|
|
20
22
|
setup(build) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import baseEsBuildConfig from "./index.js";
|
|
3
|
+
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
3
4
|
export default (config, entryPoints) => {
|
|
4
5
|
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), {
|
|
5
6
|
// inject: ["./node_modules/testeranto/dist/cjs-shim.js"],
|
|
@@ -9,7 +10,7 @@ export default (config, entryPoints) => {
|
|
|
9
10
|
// splitting: true,
|
|
10
11
|
outdir: config.outdir + "/web", alias: {
|
|
11
12
|
react: path.resolve("./node_modules/react"),
|
|
12
|
-
}, external: [
|
|
13
|
+
}, metafile: true, external: [
|
|
13
14
|
"testeranto.json",
|
|
14
15
|
"features.test.ts",
|
|
15
16
|
// "url",
|
|
@@ -33,6 +34,7 @@ export default (config, entryPoints) => {
|
|
|
33
34
|
"dns",
|
|
34
35
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
35
36
|
...(config.webPlugins || []),
|
|
37
|
+
inputFilesPlugin("node", entryPoints),
|
|
36
38
|
{
|
|
37
39
|
name: "rebuild-notify",
|
|
38
40
|
setup(build) {
|
|
@@ -31,7 +31,62 @@ export class BaseSuite {
|
|
|
31
31
|
const sNdx = this.index;
|
|
32
32
|
const sName = this.name;
|
|
33
33
|
for (const [gNdx, g] of Object.entries(this.givens)) {
|
|
34
|
-
const
|
|
34
|
+
const beforeAllProxy = new Proxy(pm, {
|
|
35
|
+
get(target, prop, receiver) {
|
|
36
|
+
if (prop === "writeFileSync") {
|
|
37
|
+
return (fp, contents) => target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
|
|
38
|
+
}
|
|
39
|
+
if (prop === "browser") {
|
|
40
|
+
return new Proxy(target[prop], {
|
|
41
|
+
get(bTarget, bProp, bReceiver) {
|
|
42
|
+
if (bProp === "pages") {
|
|
43
|
+
return async () => {
|
|
44
|
+
return bTarget.pages().then((pages) => {
|
|
45
|
+
return pages.map((page) => {
|
|
46
|
+
return new Proxy(page, {
|
|
47
|
+
get(pTarget, pProp, pReciever) {
|
|
48
|
+
if (pProp === "screenshot") {
|
|
49
|
+
return async (x) => {
|
|
50
|
+
return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${sNdx}/beforeAll` +
|
|
51
|
+
"/" +
|
|
52
|
+
x.path }), page);
|
|
53
|
+
// return await window["custom-screenshot"]({
|
|
54
|
+
// ...x,
|
|
55
|
+
// path:
|
|
56
|
+
// `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
|
|
57
|
+
// "/" +
|
|
58
|
+
// x.path,
|
|
59
|
+
// });
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
else if (pProp === "mainFrame") {
|
|
63
|
+
return () => pTarget[pProp]();
|
|
64
|
+
}
|
|
65
|
+
else if (pProp === "close") {
|
|
66
|
+
return () => pTarget[pProp]();
|
|
67
|
+
}
|
|
68
|
+
// else if (pProp === "mainFrame") {
|
|
69
|
+
// return () => target[pProp](...arguments);
|
|
70
|
+
// }
|
|
71
|
+
else {
|
|
72
|
+
return Reflect.get(...arguments);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
// return (await target.pages()).map((page) => {
|
|
79
|
+
// return new Proxy(page, handler2);
|
|
80
|
+
// });
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return Reflect.get(...arguments);
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, beforeAllProxy);
|
|
35
90
|
const giver = this.givens[gNdx];
|
|
36
91
|
try {
|
|
37
92
|
this.store = await giver.give(subject, gNdx, testResourceConfiguration, this.assertThat, suiteArtifactory, tLog, pm, sNdx);
|
|
@@ -58,17 +113,24 @@ export class BaseSuite {
|
|
|
58
113
|
get(pTarget, pProp, pReciever) {
|
|
59
114
|
if (pProp === "screenshot") {
|
|
60
115
|
return async (x) => {
|
|
61
|
-
|
|
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` +
|
|
116
|
+
return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
|
|
68
117
|
"/" +
|
|
69
118
|
x.path }));
|
|
119
|
+
// return await window["custom-screenshot"]({
|
|
120
|
+
// ...x,
|
|
121
|
+
// path:
|
|
122
|
+
// `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
|
|
123
|
+
// "/" +
|
|
124
|
+
// x.path,
|
|
125
|
+
// });
|
|
70
126
|
};
|
|
71
127
|
}
|
|
128
|
+
else if (pProp === "mainFrame") {
|
|
129
|
+
return () => pTarget[pProp]();
|
|
130
|
+
}
|
|
131
|
+
else if (pProp === "close") {
|
|
132
|
+
return () => pTarget[pProp]();
|
|
133
|
+
}
|
|
72
134
|
// else if (pProp === "mainFrame") {
|
|
73
135
|
// return () => target[pProp](...arguments);
|
|
74
136
|
// }
|
|
@@ -158,7 +220,6 @@ export class BaseGiven {
|
|
|
158
220
|
const beforeEachProxy = new Proxy(pm, {
|
|
159
221
|
get(target, prop, receiver) {
|
|
160
222
|
if (prop === "writeFileSync") {
|
|
161
|
-
console.log("beforeEachProx", arguments, target[prop]);
|
|
162
223
|
return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`, contents);
|
|
163
224
|
}
|
|
164
225
|
return Reflect.get(...arguments);
|
|
@@ -168,8 +229,8 @@ export class BaseGiven {
|
|
|
168
229
|
for (const [whenNdx, whenStep] of this.whens.entries()) {
|
|
169
230
|
await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/when/${whenNdx}`);
|
|
170
231
|
}
|
|
171
|
-
for (const thenStep of this.thens) {
|
|
172
|
-
const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm);
|
|
232
|
+
for (const [thenNdx, thenStep] of this.thens.entries()) {
|
|
233
|
+
const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/then-${thenNdx}`);
|
|
173
234
|
tester(t);
|
|
174
235
|
}
|
|
175
236
|
}
|
|
@@ -214,12 +275,34 @@ export class BaseGiven {
|
|
|
214
275
|
// "custom-screenshot-MARK-afterEachProxy",
|
|
215
276
|
// window["custom-screenshot"].toString()
|
|
216
277
|
// );
|
|
217
|
-
return
|
|
278
|
+
return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
|
|
218
279
|
"/" +
|
|
219
|
-
x.path }));
|
|
280
|
+
x.path }), page);
|
|
281
|
+
// return await pTarget[pProp]({
|
|
282
|
+
// ...x,
|
|
283
|
+
// path:
|
|
284
|
+
// `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
|
|
285
|
+
// "/" +
|
|
286
|
+
// x.path,
|
|
287
|
+
// });
|
|
220
288
|
};
|
|
221
289
|
}
|
|
222
|
-
|
|
290
|
+
else if (pProp === "mainFrame") {
|
|
291
|
+
return () => pTarget[pProp]();
|
|
292
|
+
// return target[pProp];
|
|
293
|
+
// return Reflect.get(...arguments);
|
|
294
|
+
}
|
|
295
|
+
else if (pProp === "exposeFunction") {
|
|
296
|
+
// return Reflect.get(target, prop, receiver);
|
|
297
|
+
return (...a) => pTarget[pProp](...a);
|
|
298
|
+
// return target[pProp];
|
|
299
|
+
}
|
|
300
|
+
else if (pProp === "removeExposedFunction") {
|
|
301
|
+
// return Reflect.get(target, prop, receiver);
|
|
302
|
+
return pTarget[pProp].bind(pTarget);
|
|
303
|
+
// return target[pProp];
|
|
304
|
+
}
|
|
305
|
+
// else if (pProp === "#frameManager") {
|
|
223
306
|
// return () => target[pProp](...arguments);
|
|
224
307
|
// }
|
|
225
308
|
else {
|
|
@@ -266,11 +349,69 @@ export class BaseWhen {
|
|
|
266
349
|
const andWhenProxy = new Proxy(pm, {
|
|
267
350
|
get(target, prop, receiver) {
|
|
268
351
|
if (prop === "writeFileSync") {
|
|
269
|
-
console.log("andWhenProxy", arguments, target[prop]);
|
|
270
352
|
return (fp, contents) =>
|
|
271
353
|
// target[prop](`${key}/andWhen/${fp}`, contents);
|
|
272
354
|
target[prop](`${key}/andWhen/${fp}`, contents);
|
|
273
355
|
}
|
|
356
|
+
/////////////////////
|
|
357
|
+
if (prop === "browser") {
|
|
358
|
+
return new Proxy(target[prop], {
|
|
359
|
+
get(bTarget, bProp, bReceiver) {
|
|
360
|
+
if (bProp === "pages") {
|
|
361
|
+
return async () => {
|
|
362
|
+
return bTarget.pages().then((pages) => {
|
|
363
|
+
return pages.map((page) => {
|
|
364
|
+
return new Proxy(page, {
|
|
365
|
+
get(pTarget, pProp, pReciever) {
|
|
366
|
+
if (pProp === "screenshot") {
|
|
367
|
+
return async (x) => {
|
|
368
|
+
// console.log(
|
|
369
|
+
// "custom-screenshot-MARK-afterEachProxy",
|
|
370
|
+
// window["custom-screenshot"].toString()
|
|
371
|
+
// );
|
|
372
|
+
return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/${key}/afterEach` +
|
|
373
|
+
"/" +
|
|
374
|
+
x.path }), page);
|
|
375
|
+
// return await pTarget[pProp]({
|
|
376
|
+
// ...x,
|
|
377
|
+
// path:
|
|
378
|
+
// `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
|
|
379
|
+
// "/" +
|
|
380
|
+
// x.path,
|
|
381
|
+
// });
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
else if (pProp === "mainFrame") {
|
|
385
|
+
return () => pTarget[pProp]();
|
|
386
|
+
// return target[pProp];
|
|
387
|
+
// return Reflect.get(...arguments);
|
|
388
|
+
}
|
|
389
|
+
else if (pProp === "exposeFunction") {
|
|
390
|
+
// return Reflect.get(target, prop, receiver);
|
|
391
|
+
return pTarget[pProp].bind(pTarget);
|
|
392
|
+
// return target[pProp];
|
|
393
|
+
}
|
|
394
|
+
else if (pProp === "removeExposedFunction") {
|
|
395
|
+
// return Reflect.get(target, prop, receiver);
|
|
396
|
+
return pTarget[pProp].bind(pTarget);
|
|
397
|
+
// return target[pProp];
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
return Reflect.get(...arguments);
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
// return (await target.pages()).map((page) => {
|
|
407
|
+
// return new Proxy(page, handler2);
|
|
408
|
+
// });
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
///////////////////////
|
|
274
415
|
return Reflect.get(...arguments);
|
|
275
416
|
},
|
|
276
417
|
});
|
|
@@ -295,10 +436,74 @@ export class BaseThen {
|
|
|
295
436
|
error: this.error,
|
|
296
437
|
};
|
|
297
438
|
}
|
|
298
|
-
async test(store, testResourceConfiguration, tLog, pm) {
|
|
439
|
+
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
299
440
|
tLog(" Then:", this.name);
|
|
300
441
|
try {
|
|
301
|
-
const
|
|
442
|
+
const butThenProxy = new Proxy(pm, {
|
|
443
|
+
get(target, prop, receiver) {
|
|
444
|
+
if (prop === "writeFileSync") {
|
|
445
|
+
return (fp, contents) => target[prop](`${filepath}/${fp}`, contents);
|
|
446
|
+
}
|
|
447
|
+
if (prop === "browser") {
|
|
448
|
+
return new Proxy(target[prop], {
|
|
449
|
+
get(bTarget, bProp, bReceiver) {
|
|
450
|
+
if (bProp === "pages") {
|
|
451
|
+
return async () => {
|
|
452
|
+
return bTarget.pages().then((pages) => {
|
|
453
|
+
return pages.map((page) => {
|
|
454
|
+
return new Proxy(page, {
|
|
455
|
+
get(pTarget, pProp, pReciever) {
|
|
456
|
+
if (pProp === "screenshot") {
|
|
457
|
+
return async (x) => {
|
|
458
|
+
return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/${filepath}/butThen` +
|
|
459
|
+
"/" +
|
|
460
|
+
x.path }), page);
|
|
461
|
+
// return await window["custom-screenshot"]({
|
|
462
|
+
// ...x,
|
|
463
|
+
// path:
|
|
464
|
+
// `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
|
|
465
|
+
// "/" +
|
|
466
|
+
// x.path,
|
|
467
|
+
// });
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
else if (pProp === "close") {
|
|
471
|
+
return () => pTarget[pProp]();
|
|
472
|
+
}
|
|
473
|
+
else if (pProp === "mainFrame") {
|
|
474
|
+
return () => pTarget[pProp]();
|
|
475
|
+
}
|
|
476
|
+
else if (pProp === "exposeFunction") {
|
|
477
|
+
// return Reflect.get(target, prop, receiver);
|
|
478
|
+
return (...a) => pTarget[pProp](...a);
|
|
479
|
+
// return target[pProp];
|
|
480
|
+
}
|
|
481
|
+
else if (pProp === "removeExposedFunction") {
|
|
482
|
+
// return Reflect.get(target, prop, receiver);
|
|
483
|
+
return pTarget[pProp].bind(pTarget);
|
|
484
|
+
// return target[pProp];
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
return Reflect.get(...arguments);
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
// return (await target.pages()).map((page) => {
|
|
494
|
+
// return new Proxy(page, handler2);
|
|
495
|
+
// });
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
return Reflect.get(...arguments);
|
|
502
|
+
},
|
|
503
|
+
});
|
|
504
|
+
const x = await this.butThen(store, this.thenCB, testResourceConfiguration, butThenProxy
|
|
505
|
+
// pm
|
|
506
|
+
);
|
|
302
507
|
return x;
|
|
303
508
|
}
|
|
304
509
|
catch (e) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class BaseBuilder {
|
|
2
|
-
constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides, testResourceRequirement, testSpecification
|
|
3
|
-
// puppetMaster: PM
|
|
4
|
-
) {
|
|
2
|
+
constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides, testResourceRequirement, testSpecification) {
|
|
5
3
|
this.input = input;
|
|
6
4
|
this.artifacts = [];
|
|
7
5
|
this.artifacts = [];
|
|
@@ -12,12 +10,9 @@ export class BaseBuilder {
|
|
|
12
10
|
this.thenOverides = thenOverides;
|
|
13
11
|
this.checkOverides = checkOverides;
|
|
14
12
|
this.testSpecification = testSpecification;
|
|
15
|
-
// this.puppetMaster = puppetMaster;
|
|
16
13
|
this.specs = testSpecification(this.Suites(), this.Given(), this.When(), this.Then(), this.Check());
|
|
17
14
|
this.testJobs = this.specs.map((suite) => {
|
|
18
|
-
const suiteRunner = (suite) => async (
|
|
19
|
-
// testResourceConfiguration: ITTestResourceConfiguration,
|
|
20
|
-
puppetMaster, tLog) => {
|
|
15
|
+
const suiteRunner = (suite) => async (puppetMaster, tLog) => {
|
|
21
16
|
await puppetMaster.startPuppeteer({
|
|
22
17
|
browserWSEndpoint: puppetMaster.testResourceConfiguration.browserWSEndpoint,
|
|
23
18
|
}, puppetMaster.testResourceConfiguration.fs);
|
|
@@ -28,44 +23,15 @@ export class BaseBuilder {
|
|
|
28
23
|
const runner = suiteRunner(suite);
|
|
29
24
|
return {
|
|
30
25
|
test: suite,
|
|
31
|
-
// testResourceRequirement,
|
|
32
26
|
toObj: () => {
|
|
33
27
|
return suite.toObj();
|
|
34
28
|
},
|
|
35
29
|
runner,
|
|
36
|
-
receiveTestResourceConfig: async function (
|
|
37
|
-
|
|
38
|
-
// name: "",
|
|
39
|
-
// fs: ".",
|
|
40
|
-
// ports: [],
|
|
41
|
-
// browserWSEndpoint: "",
|
|
42
|
-
// },
|
|
43
|
-
puppetMaster) {
|
|
44
|
-
// console.log(
|
|
45
|
-
// `testResourceConfiguration! ${JSON.stringify(
|
|
46
|
-
// testResourceConfiguration,
|
|
47
|
-
// null,
|
|
48
|
-
// 2
|
|
49
|
-
// )}`
|
|
50
|
-
// );
|
|
51
|
-
// console.log("puppetMaster", puppetMaster);
|
|
52
|
-
await puppetMaster
|
|
53
|
-
.mkdirSync();
|
|
54
|
-
// if (!puppetMaster.existsSync(destFolder)) {
|
|
55
|
-
// puppetMaster.mkdirSync(destFolder, { recursive: true });
|
|
56
|
-
// }
|
|
57
|
-
// puppetMaster.writeFileSync(
|
|
58
|
-
// // puppetMaster.testResourceConfiguration.fs + `/tests.json`,
|
|
59
|
-
// `tests.json`,
|
|
60
|
-
// JSON.stringify(this.toObj(), null, 2)
|
|
61
|
-
// );
|
|
30
|
+
receiveTestResourceConfig: async function (puppetMaster) {
|
|
31
|
+
await puppetMaster.mkdirSync();
|
|
62
32
|
const logFilePath = "log.txt";
|
|
63
|
-
// puppetMaster.testResourceConfiguration.fs + `/log.txt`;
|
|
64
33
|
const access = await puppetMaster.createWriteStream(logFilePath);
|
|
65
|
-
// console.log("access", access);
|
|
66
34
|
const tLog = (...l) => {
|
|
67
|
-
// access.write(`${l.toString()}\n`);
|
|
68
|
-
// console.log("tLog", l);
|
|
69
35
|
puppetMaster.write(access, `${l.toString()}\n`);
|
|
70
36
|
};
|
|
71
37
|
const suiteDone = await runner(puppetMaster, tLog);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { BaseBuilder } from "./basebuilder.js";
|
|
2
2
|
export class ClassBuilder extends BaseBuilder {
|
|
3
|
-
constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement
|
|
4
|
-
// puppetMaster: PM
|
|
5
|
-
) {
|
|
3
|
+
constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement) {
|
|
6
4
|
const classySuites = Object.entries(testImplementation.suites).reduce((a, [key], index) => {
|
|
7
5
|
a[key] = (somestring, givens, checks) => {
|
|
8
6
|
return new suiteKlasser.prototype.constructor(somestring, index, givens, checks);
|
package/dist/module/lib/core.js
CHANGED
|
@@ -2,9 +2,7 @@ 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, testInterface
|
|
6
|
-
// puppetMaster: PM
|
|
7
|
-
) {
|
|
5
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testInterface) {
|
|
8
6
|
const fullTestInterface = DefaultTestInterface(testInterface);
|
|
9
7
|
super(testImplementation, testSpecification, input, class extends BaseSuite {
|
|
10
8
|
afterAll(store, artifactory, pm) {
|
|
@@ -51,8 +49,8 @@ export default class Testeranto extends ClassBuilder {
|
|
|
51
49
|
return await fullTestInterface.andWhen(store, whenCB, testResource, pm);
|
|
52
50
|
}
|
|
53
51
|
}, class Then extends BaseThen {
|
|
54
|
-
async butThen(store, thenCB, testResourceConfiguration) {
|
|
55
|
-
return await fullTestInterface.butThen(store, thenCB, testResourceConfiguration);
|
|
52
|
+
async butThen(store, thenCB, testResourceConfiguration, pm) {
|
|
53
|
+
return await fullTestInterface.butThen(store, thenCB, testResourceConfiguration, pm);
|
|
56
54
|
}
|
|
57
55
|
}, class Check extends BaseCheck {
|
|
58
56
|
constructor(name, features, checkCallback, whens, thens, initialValues) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
export const userSchema = new mongoose.Schema({
|
|
3
|
+
email: String,
|
|
4
|
+
channels: [{ type: mongoose.Schema.Types.ObjectId, ref: "Channel" }],
|
|
5
|
+
dmgroups: [{ type: mongoose.Schema.Types.ObjectId, ref: "Dmgroup" }],
|
|
6
|
+
});
|
|
7
|
+
userSchema.virtual("features", {
|
|
8
|
+
ref: "Feature",
|
|
9
|
+
localField: "_id",
|
|
10
|
+
foreignField: "owner",
|
|
11
|
+
});
|
|
12
|
+
export const kanbanSchema = new mongoose.Schema({
|
|
13
|
+
title: String,
|
|
14
|
+
});
|
|
15
|
+
export const ganttSchema = new mongoose.Schema({
|
|
16
|
+
name: String,
|
|
17
|
+
type: String,
|
|
18
|
+
start: Date,
|
|
19
|
+
end: Date,
|
|
20
|
+
});
|
|
21
|
+
export const featuresSchema = new mongoose.Schema({
|
|
22
|
+
title: String,
|
|
23
|
+
state: String,
|
|
24
|
+
});
|
|
25
|
+
export const channelsFeature = new mongoose.Schema({});
|
|
26
|
+
export const chatCatMessageSchema = new mongoose.Schema({
|
|
27
|
+
user: {
|
|
28
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
29
|
+
ref: "User",
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
room: {
|
|
33
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
34
|
+
ref: "ChatCatRoom",
|
|
35
|
+
required: true,
|
|
36
|
+
maxlength: 100,
|
|
37
|
+
},
|
|
38
|
+
timestamp: {
|
|
39
|
+
type: Date,
|
|
40
|
+
default: Date.now(),
|
|
41
|
+
},
|
|
42
|
+
text: {
|
|
43
|
+
type: String,
|
|
44
|
+
maxlength: 1000,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
export const HuddleSchema = new mongoose.Schema({});
|
|
48
|
+
export const RoomSchema = new mongoose.Schema({
|
|
49
|
+
name: { type: String, required: true },
|
|
50
|
+
});
|