testeranto 0.171.0 → 0.173.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 +2 -4
- package/dist/common/src/PM/base.js +4 -0
- package/dist/common/src/PM/main.js +11 -4
- package/dist/common/src/PM/node.js +1 -1
- package/dist/common/src/PM/web.js +3 -3
- package/dist/common/src/ReportServer.js +2 -126
- package/dist/common/src/ReportServer.test.ts/index.js +78 -0
- package/dist/common/src/ReportServerLib.js +135 -0
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/common/src/lib/abstractBase.js +2 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
- package/dist/common/src/lib/basebuilder.js +8 -2
- package/dist/common/src/lib/pmProxy.js +54 -150
- package/dist/common/testeranto.config.js +35 -20
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/base.js +4 -0
- package/dist/module/src/PM/main.js +11 -4
- package/dist/module/src/PM/node.js +1 -1
- package/dist/module/src/PM/web.js +3 -3
- package/dist/module/src/ReportServer.js +2 -123
- package/dist/module/src/ReportServer.test.ts/index.js +73 -0
- package/dist/module/src/ReportServerLib.js +128 -0
- package/dist/module/src/TestPage.js +29 -17
- package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/module/src/components/pure/TestPageView.js +29 -17
- package/dist/module/src/lib/abstractBase.js +2 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
- package/dist/module/src/lib/basebuilder.js +8 -2
- package/dist/module/src/lib/pmProxy.js +54 -150
- package/dist/module/testeranto.config.js +35 -20
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.css +13 -9
- package/dist/prebuild/App.js +102 -99
- package/dist/prebuild/ReportServer.mjs +15 -9
- package/dist/prebuild/run.mjs +14 -4
- package/dist/types/src/PM/node.d.ts +1 -1
- package/dist/types/src/PM/web.d.ts +1 -1
- package/dist/types/src/ReportServer.test.ts/index.d.ts +29 -0
- package/dist/types/src/ReportServerLib.d.ts +2 -0
- package/dist/types/src/Types.d.ts +0 -1
- package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +1 -1
- package/dist/types/src/lib/abstractBase.d.ts +1 -1
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +7 -4
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/src/PM/base.ts +5 -0
- package/src/PM/main.ts +12 -4
- package/src/PM/node.ts +1 -1
- package/src/PM/web.ts +3 -3
- package/src/ReportServer.test.ts/index.ts +194 -0
- package/src/ReportServer.ts +2 -132
- package/src/ReportServerLib.ts +144 -0
- package/src/TestPage.tsx +65 -5
- package/src/Types.ts +0 -1
- package/src/components/pure/ProjectPageView.test/implementation.tsx +1 -1
- package/src/components/pure/TestPageView.tsx +65 -5
- package/src/lib/abstractBase.ts +4 -1
- package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +22 -10
- package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +9 -9
- package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +7 -4
- package/src/lib/basebuilder.ts +7 -4
- package/src/lib/pmProxy.ts +78 -155
- package/testeranto/App.css +13 -9
- package/testeranto/App.js +102 -99
- package/testeranto/bundles/node/allTests/metafile.json +38 -781
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +983 -24
- package/testeranto/bundles/node/core/metafile.json +486 -0
- package/testeranto/bundles/{pure/allTests/chunk-VMUSFSZM.mjs → node/core/src/lib/baseBuilder.test/baseBuilder.test.node.mjs} +797 -412
- package/testeranto/bundles/node/staticSite/metafile.json +593 -0
- package/testeranto/bundles/node/staticSite/src/ReportServer.test.ts/index.mjs +1594 -0
- package/testeranto/bundles/pure/allTests/metafile.json +157 -585
- package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +740 -27
- package/testeranto/bundles/pure/core/metafile.json +626 -0
- package/testeranto/bundles/{web/allTests/chunk-U7AW26HL.mjs → pure/core/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs} +507 -410
- package/testeranto/bundles/pure/staticSite/metafile.json +8 -0
- package/testeranto/bundles/web/allTests/metafile.json +107 -15292
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +893 -45
- package/testeranto/bundles/web/core/metafile.json +780 -0
- package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.html +19 -0
- package/testeranto/bundles/web/{allTests/chunk-RLDR6LJN.mjs → core/src/lib/baseBuilder.test/baseBuilder.test.web.mjs} +580 -518
- package/testeranto/bundles/web/staticSite/metafile.json +8 -0
- package/testeranto/projects.json +2 -1
- package/testeranto/reports/allTests/config.json +0 -64
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +2 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +11 -13
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +10 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +10 -18
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +25 -13
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +2 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +24 -12
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +2 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +49 -55
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +12 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +10 -18
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +24 -12
- package/testeranto/reports/allTests/summary.json +6 -62
- package/testeranto/reports/core/config.json +24 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +32 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +2 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +26 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +69 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +74 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +2 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +26 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +74 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +61 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +2 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +26 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +69 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +74 -0
- package/testeranto/reports/core/summary.json +23 -0
- package/testeranto/reports/staticSite/config.json +24 -0
- package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/lint_errors.txt +5 -0
- package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/logs.txt +44 -0
- package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/message.txt +2 -0
- package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/prompt.txt +23 -0
- package/testeranto/reports/{allTests/src/lib/core.test/core.test → staticSite/src/ReportServer.test.ts/index}/node/type_errors.txt +21 -32
- package/testeranto/reports/staticSite/summary.json +9 -0
- package/testeranto/reportsnode_build_errors +17 -0
- package/testeranto.config.ts +37 -20
- package/testeranto/bundles/node/allTests/chunk-3EUGBAOM.mjs +0 -113
- package/testeranto/bundles/node/allTests/chunk-E75CSRER.mjs +0 -800
- package/testeranto/bundles/node/allTests/chunk-M6DO7VMB.mjs +0 -252
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +0 -323
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +0 -411
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +0 -528
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +0 -4650
- package/testeranto/bundles/pure/allTests/chunk-KHDVEHF7.mjs +0 -185
- package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +0 -429
- package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +0 -425
- package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +0 -2283
- package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.html +0 -19
- package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.mjs +0 -37524
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +0 -19
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +0 -440
- package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +0 -13
- package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +0 -101
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +0 -13
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +0 -50
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -17
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -32
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +0 -68
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -52
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -13
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -14
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -108
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -14
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -700
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +0 -164
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +0 -138
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -21
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +0 -7
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +0 -18
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -20
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -31
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +0 -134
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +0 -76
- package/testeranto/reportsweb_build_errors +0 -25
- /package/testeranto/reports/{allTests/src/components/pure/ProjectPageView.test/index/web → core/src/lib/baseBuilder.test/baseBuilder.test.node/node}/bdd_errors.txt +0 -0
- /package/testeranto/reports/{allTests/src/lib/BaseSuite.test/node.test/node → core/src/lib/baseBuilder.test/baseBuilder.test.web/web}/bdd_errors.txt +0 -0
|
@@ -1,378 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_buffer,
|
|
3
|
-
init_dirname,
|
|
4
|
-
init_process
|
|
5
|
-
} from "./chunk-HPYA4YZC.mjs";
|
|
6
|
-
|
|
7
|
-
// src/lib/BaseSuite.ts
|
|
8
|
-
init_dirname();
|
|
9
|
-
init_buffer();
|
|
10
|
-
init_process();
|
|
11
|
-
|
|
12
|
-
// src/lib/pmProxy.ts
|
|
13
|
-
init_dirname();
|
|
14
|
-
init_buffer();
|
|
15
|
-
init_process();
|
|
16
|
-
var baseProxy = function(pm, mappings) {
|
|
17
|
-
return new Proxy(pm, {
|
|
18
|
-
get: (target, prop, receiver) => {
|
|
19
|
-
for (const mapping of mappings) {
|
|
20
|
-
const method = mapping[0];
|
|
21
|
-
const arger = mapping[1];
|
|
22
|
-
if (prop === method) {
|
|
23
|
-
return (...x) => target[prop](arger(...x));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return (...x) => target[prop](...x);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var butThenProxy = (pm, filepath) => {
|
|
31
|
-
return baseProxy(pm, [
|
|
32
|
-
[
|
|
33
|
-
"screencast",
|
|
34
|
-
(opts2, p) => {
|
|
35
|
-
const path = `${filepath}/butThen/${opts2.path}`;
|
|
36
|
-
console.log(`[Proxy] Captured artifact path for butThen:`, path);
|
|
37
|
-
if (pm.currentStep?.addArtifact) {
|
|
38
|
-
pm.currentStep.addArtifact(path);
|
|
39
|
-
} else {
|
|
40
|
-
console.warn("No currentStep or addArtifact method found");
|
|
41
|
-
}
|
|
42
|
-
return [
|
|
43
|
-
{
|
|
44
|
-
...opts2,
|
|
45
|
-
path
|
|
46
|
-
},
|
|
47
|
-
p
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
["createWriteStream", (fp) => {
|
|
52
|
-
const path = `${filepath}/butThen/${fp}`;
|
|
53
|
-
console.log(`[Proxy] Captured artifact path for butThen:`, path);
|
|
54
|
-
if (pm.currentStep?.addArtifact) {
|
|
55
|
-
pm.currentStep.addArtifact(path);
|
|
56
|
-
} else {
|
|
57
|
-
console.warn("No currentStep or addArtifact method found");
|
|
58
|
-
}
|
|
59
|
-
return [path];
|
|
60
|
-
}],
|
|
61
|
-
[
|
|
62
|
-
"writeFileSync",
|
|
63
|
-
(fp, contents) => {
|
|
64
|
-
const path = `${filepath}/butThen/${fp}`;
|
|
65
|
-
pm.currentStep?.artifacts?.push(path);
|
|
66
|
-
return [path, contents];
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
[
|
|
70
|
-
"customScreenShot",
|
|
71
|
-
(opts2, p) => {
|
|
72
|
-
const path = `${filepath}/butThen/${opts2.path}`;
|
|
73
|
-
pm.currentStep?.artifacts?.push(path);
|
|
74
|
-
return [
|
|
75
|
-
{
|
|
76
|
-
...opts2,
|
|
77
|
-
path
|
|
78
|
-
},
|
|
79
|
-
p
|
|
80
|
-
];
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
]);
|
|
84
|
-
};
|
|
85
|
-
var andWhenProxy = (pm, filepath) => baseProxy(pm, [
|
|
86
|
-
[
|
|
87
|
-
"screencast",
|
|
88
|
-
(opts2, p) => {
|
|
89
|
-
const path = `${filepath}/andWhen/${opts2.path}`;
|
|
90
|
-
pm.currentStep?.artifacts?.push(path);
|
|
91
|
-
return [
|
|
92
|
-
{
|
|
93
|
-
...opts2,
|
|
94
|
-
path
|
|
95
|
-
},
|
|
96
|
-
p
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
["createWriteStream", (fp) => {
|
|
101
|
-
const path = `${filepath}/andWhen/${fp}`;
|
|
102
|
-
pm.currentStep?.artifacts?.push(path);
|
|
103
|
-
return [path];
|
|
104
|
-
}],
|
|
105
|
-
["writeFileSync", (fp, contents) => {
|
|
106
|
-
const path = `${filepath}/andWhen/${fp}`;
|
|
107
|
-
pm.currentStep?.artifacts?.push(path);
|
|
108
|
-
return [path, contents];
|
|
109
|
-
}],
|
|
110
|
-
[
|
|
111
|
-
"customScreenShot",
|
|
112
|
-
(opts2, p) => {
|
|
113
|
-
const path = `${filepath}/andWhen/${opts2.path}`;
|
|
114
|
-
pm.currentStep?.artifacts?.push(path);
|
|
115
|
-
return [
|
|
116
|
-
{
|
|
117
|
-
...opts2,
|
|
118
|
-
path
|
|
119
|
-
},
|
|
120
|
-
p
|
|
121
|
-
];
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
]);
|
|
125
|
-
var afterEachProxy = (pm, suite, given) => baseProxy(pm, [
|
|
126
|
-
[
|
|
127
|
-
"screencast",
|
|
128
|
-
(opts2, p) => {
|
|
129
|
-
const path = `suite-${suite}/given-${given}/afterEach/${opts2.path}`;
|
|
130
|
-
pm.currentStep?.artifacts?.push(path);
|
|
131
|
-
return [
|
|
132
|
-
{
|
|
133
|
-
...opts2,
|
|
134
|
-
path
|
|
135
|
-
},
|
|
136
|
-
p
|
|
137
|
-
];
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
["createWriteStream", (fp) => {
|
|
141
|
-
const path = `suite-${suite}/afterEach/${fp}`;
|
|
142
|
-
pm.currentStep?.artifacts?.push(path);
|
|
143
|
-
return [path];
|
|
144
|
-
}],
|
|
145
|
-
[
|
|
146
|
-
"writeFileSync",
|
|
147
|
-
(fp, contents) => {
|
|
148
|
-
const path = `suite-${suite}/given-${given}/afterEach/${fp}`;
|
|
149
|
-
pm.currentStep?.artifacts?.push(path);
|
|
150
|
-
return [path, contents];
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
[
|
|
154
|
-
"customScreenShot",
|
|
155
|
-
(opts2, p) => {
|
|
156
|
-
const path = `suite-${suite}/given-${given}/afterEach/${opts2.path}`;
|
|
157
|
-
pm.currentStep?.artifacts?.push(path);
|
|
158
|
-
return [
|
|
159
|
-
{
|
|
160
|
-
...opts2,
|
|
161
|
-
path
|
|
162
|
-
},
|
|
163
|
-
p
|
|
164
|
-
];
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
]);
|
|
168
|
-
var beforeEachProxy = (pm, suite) => baseProxy(pm, [
|
|
169
|
-
[
|
|
170
|
-
"screencast",
|
|
171
|
-
(opts2, p) => {
|
|
172
|
-
const path = `suite-${suite}/beforeEach/${opts2.path}`;
|
|
173
|
-
pm.currentStep?.artifacts?.push(path);
|
|
174
|
-
return [
|
|
175
|
-
{
|
|
176
|
-
...opts2,
|
|
177
|
-
path
|
|
178
|
-
},
|
|
179
|
-
p
|
|
180
|
-
];
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
[
|
|
184
|
-
"writeFileSync",
|
|
185
|
-
(fp, contents) => {
|
|
186
|
-
const path = `suite-${suite}/beforeEach/${fp}`;
|
|
187
|
-
pm.currentStep?.artifacts?.push(path);
|
|
188
|
-
return [path, contents];
|
|
189
|
-
}
|
|
190
|
-
],
|
|
191
|
-
[
|
|
192
|
-
"customScreenShot",
|
|
193
|
-
(opts2, p) => {
|
|
194
|
-
const path = `suite-${suite}/beforeEach/${opts2.path}`;
|
|
195
|
-
pm.currentStep?.artifacts?.push(path);
|
|
196
|
-
return [
|
|
197
|
-
{
|
|
198
|
-
...opts2,
|
|
199
|
-
path
|
|
200
|
-
},
|
|
201
|
-
p
|
|
202
|
-
];
|
|
203
|
-
}
|
|
204
|
-
],
|
|
205
|
-
["createWriteStream", (fp) => {
|
|
206
|
-
const path = `suite-${suite}/beforeEach/${fp}`;
|
|
207
|
-
pm.currentStep?.artifacts?.push(path);
|
|
208
|
-
return [path];
|
|
209
|
-
}]
|
|
210
|
-
]);
|
|
211
|
-
var beforeAllProxy = (pm, suite) => baseProxy(pm, [
|
|
212
|
-
[
|
|
213
|
-
"writeFileSync",
|
|
214
|
-
(fp, contents) => {
|
|
215
|
-
const path = `suite-${suite}/beforeAll/${fp}`;
|
|
216
|
-
pm.currentStep?.artifacts?.push(path);
|
|
217
|
-
return [path, contents];
|
|
218
|
-
}
|
|
219
|
-
],
|
|
220
|
-
[
|
|
221
|
-
"customScreenShot",
|
|
222
|
-
(opts2, p) => {
|
|
223
|
-
const path = `suite-${suite}/beforeAll/${opts2.path}`;
|
|
224
|
-
pm.currentStep?.artifacts?.push(path);
|
|
225
|
-
return [
|
|
226
|
-
{
|
|
227
|
-
...opts2,
|
|
228
|
-
path
|
|
229
|
-
},
|
|
230
|
-
p
|
|
231
|
-
];
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
["createWriteStream", (fp) => {
|
|
235
|
-
const path = `suite-${suite}/beforeAll/${fp}`;
|
|
236
|
-
pm.currentStep?.artifacts?.push(path);
|
|
237
|
-
return [path];
|
|
238
|
-
}]
|
|
239
|
-
]);
|
|
240
|
-
var afterAllProxy = (pm, suite) => baseProxy(pm, [
|
|
241
|
-
["createWriteStream", (fp) => {
|
|
242
|
-
const path = `suite-${suite}/afterAll/${fp}`;
|
|
243
|
-
pm.currentStep?.artifacts?.push(path);
|
|
244
|
-
return [path];
|
|
245
|
-
}],
|
|
246
|
-
[
|
|
247
|
-
"writeFileSync",
|
|
248
|
-
(fp, contents) => {
|
|
249
|
-
const path = `suite-${suite}/afterAll/${fp}`;
|
|
250
|
-
pm.currentStep?.artifacts?.push(path);
|
|
251
|
-
return [path, contents];
|
|
252
|
-
}
|
|
253
|
-
],
|
|
254
|
-
[
|
|
255
|
-
"customScreenShot",
|
|
256
|
-
(opts2, p) => {
|
|
257
|
-
const path = `suite-${suite}/afterAll/${opts2.path}`;
|
|
258
|
-
pm.currentStep?.artifacts?.push(path);
|
|
259
|
-
return [
|
|
260
|
-
{
|
|
261
|
-
...opts2,
|
|
262
|
-
path
|
|
263
|
-
},
|
|
264
|
-
p
|
|
265
|
-
];
|
|
266
|
-
}
|
|
267
|
-
]
|
|
268
|
-
]);
|
|
269
|
-
|
|
270
|
-
// src/lib/BaseSuite.ts
|
|
271
|
-
var BaseSuite = class {
|
|
272
|
-
constructor(name, index, givens = {}) {
|
|
273
|
-
const suiteName = name || "testSuite";
|
|
274
|
-
if (!suiteName) {
|
|
275
|
-
throw new Error("BaseSuite requires a non-empty name");
|
|
276
|
-
}
|
|
277
|
-
console.log(
|
|
278
|
-
"[DEBUG] BaseSuite constructor - name:",
|
|
279
|
-
suiteName,
|
|
280
|
-
"index:",
|
|
281
|
-
index
|
|
282
|
-
);
|
|
283
|
-
this.name = suiteName;
|
|
284
|
-
this.index = index;
|
|
285
|
-
this.givens = givens;
|
|
286
|
-
this.fails = 0;
|
|
287
|
-
console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
|
|
288
|
-
console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
|
|
289
|
-
}
|
|
290
|
-
features() {
|
|
291
|
-
try {
|
|
292
|
-
const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
|
|
293
|
-
return array.indexOf(value) === index;
|
|
294
|
-
});
|
|
295
|
-
console.debug("[DEBUG] Features extracted:", features.toString());
|
|
296
|
-
return features || [];
|
|
297
|
-
} catch (e) {
|
|
298
|
-
console.error("[ERROR] Failed to extract features:", e);
|
|
299
|
-
return [];
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
toObj() {
|
|
303
|
-
const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
|
|
304
|
-
return {
|
|
305
|
-
name: this.name,
|
|
306
|
-
givens,
|
|
307
|
-
fails: this.fails,
|
|
308
|
-
failed: this.failed,
|
|
309
|
-
features: this.features()
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
setup(s, artifactory, tr, pm) {
|
|
313
|
-
return new Promise((res) => res(s));
|
|
314
|
-
}
|
|
315
|
-
assertThat(t) {
|
|
316
|
-
return !!t;
|
|
317
|
-
}
|
|
318
|
-
afterAll(store, artifactory, pm) {
|
|
319
|
-
return store;
|
|
320
|
-
}
|
|
321
|
-
async run(input, testResourceConfiguration, artifactory, tLog, pm) {
|
|
322
|
-
this.testResourceConfiguration = testResourceConfiguration;
|
|
323
|
-
const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
|
|
324
|
-
tLog("\nSuite:", this.index, this.name);
|
|
325
|
-
const sNdx = this.index;
|
|
326
|
-
const subject = await this.setup(
|
|
327
|
-
input,
|
|
328
|
-
suiteArtifactory,
|
|
329
|
-
testResourceConfiguration,
|
|
330
|
-
beforeAllProxy(pm, sNdx.toString())
|
|
331
|
-
);
|
|
332
|
-
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
333
|
-
const giver = this.givens[gKey];
|
|
334
|
-
this.store = await giver.give(
|
|
335
|
-
subject,
|
|
336
|
-
gKey,
|
|
337
|
-
testResourceConfiguration,
|
|
338
|
-
this.assertThat,
|
|
339
|
-
suiteArtifactory,
|
|
340
|
-
tLog,
|
|
341
|
-
pm,
|
|
342
|
-
sNdx
|
|
343
|
-
).catch((e) => {
|
|
344
|
-
this.failed = true;
|
|
345
|
-
this.fails = this.fails + 1;
|
|
346
|
-
throw e;
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
try {
|
|
350
|
-
this.afterAll(
|
|
351
|
-
this.store,
|
|
352
|
-
artifactory,
|
|
353
|
-
afterAllProxy(pm, sNdx.toString())
|
|
354
|
-
);
|
|
355
|
-
} catch (e) {
|
|
356
|
-
console.error(e);
|
|
357
|
-
}
|
|
358
|
-
return this;
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
// src/Web.ts
|
|
363
|
-
init_dirname();
|
|
364
|
-
init_buffer();
|
|
365
|
-
init_process();
|
|
366
|
-
|
|
367
|
-
// src/PM/web.ts
|
|
368
|
-
init_dirname();
|
|
369
|
-
init_buffer();
|
|
370
|
-
init_process();
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
371
2
|
|
|
372
3
|
// src/PM/index.ts
|
|
373
|
-
init_dirname();
|
|
374
|
-
init_buffer();
|
|
375
|
-
init_process();
|
|
376
4
|
var PM = class {
|
|
377
5
|
};
|
|
378
6
|
|
|
@@ -452,8 +80,6 @@ var PM_Web = class extends PM {
|
|
|
452
80
|
customScreenShot(x, y) {
|
|
453
81
|
const opts2 = x[0];
|
|
454
82
|
const page2 = x[1];
|
|
455
|
-
console.log("customScreenShot 2 opts", opts2);
|
|
456
|
-
console.log("customScreenShot 2 page", page2);
|
|
457
83
|
return window["customScreenShot"](
|
|
458
84
|
{
|
|
459
85
|
...opts2,
|
|
@@ -472,7 +98,7 @@ var PM_Web = class extends PM {
|
|
|
472
98
|
write(uid, contents) {
|
|
473
99
|
return window["write"](uid, contents);
|
|
474
100
|
}
|
|
475
|
-
writeFileSync(filepath, contents) {
|
|
101
|
+
writeFileSync([filepath, contents]) {
|
|
476
102
|
return window["writeFileSync"](
|
|
477
103
|
this.testResourceConfiguration.fs + "/" + filepath,
|
|
478
104
|
contents,
|
|
@@ -505,15 +131,7 @@ var PM_Web = class extends PM {
|
|
|
505
131
|
}
|
|
506
132
|
};
|
|
507
133
|
|
|
508
|
-
// src/lib/core.ts
|
|
509
|
-
init_dirname();
|
|
510
|
-
init_buffer();
|
|
511
|
-
init_process();
|
|
512
|
-
|
|
513
134
|
// src/lib/index.ts
|
|
514
|
-
init_dirname();
|
|
515
|
-
init_buffer();
|
|
516
|
-
init_process();
|
|
517
135
|
var BaseAdapter = () => ({
|
|
518
136
|
beforeAll: async (s) => s,
|
|
519
137
|
beforeEach: async function(subject, initialValues, x, testResource, pm) {
|
|
@@ -544,10 +162,186 @@ var defaultTestResourceRequirement = {
|
|
|
544
162
|
ports: 0
|
|
545
163
|
};
|
|
546
164
|
|
|
165
|
+
// src/lib/pmProxy.ts
|
|
166
|
+
var baseProxy = function(pm, mappings) {
|
|
167
|
+
return new Proxy(pm, {
|
|
168
|
+
get: (target, prop, receiver) => {
|
|
169
|
+
for (const mapping of mappings) {
|
|
170
|
+
const method = mapping[0];
|
|
171
|
+
const arger = mapping[1];
|
|
172
|
+
if (prop === method) {
|
|
173
|
+
return (...x) => target[prop](arger(...x));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return (...x) => target[prop](...x);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
var butThenProxy = (pm, filepath) => {
|
|
181
|
+
return baseProxy(pm, [
|
|
182
|
+
[
|
|
183
|
+
"screencast",
|
|
184
|
+
(opts2, p) => {
|
|
185
|
+
const path = `${filepath}/butThen/${opts2.path}`;
|
|
186
|
+
pm.currentStep?.artifacts?.push(path);
|
|
187
|
+
return [
|
|
188
|
+
{
|
|
189
|
+
...opts2,
|
|
190
|
+
path
|
|
191
|
+
},
|
|
192
|
+
p
|
|
193
|
+
];
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"createWriteStream",
|
|
198
|
+
(fp) => {
|
|
199
|
+
const path = `${filepath}/butThen/${fp}`;
|
|
200
|
+
pm.currentStep?.artifacts?.push(path);
|
|
201
|
+
return [path];
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
[
|
|
205
|
+
"writeFileSync",
|
|
206
|
+
(fp, contents) => {
|
|
207
|
+
const path = `${filepath}/butThen/${fp}`;
|
|
208
|
+
pm.currentStep?.artifacts?.push(path);
|
|
209
|
+
return [path, contents];
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
[
|
|
213
|
+
"customScreenShot",
|
|
214
|
+
(opts2, p) => {
|
|
215
|
+
const path = `${filepath}/butThen/${opts2.path}`;
|
|
216
|
+
pm.currentStep?.artifacts?.push(path);
|
|
217
|
+
return [
|
|
218
|
+
{
|
|
219
|
+
...opts2,
|
|
220
|
+
path
|
|
221
|
+
},
|
|
222
|
+
p
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
]);
|
|
227
|
+
};
|
|
228
|
+
var andWhenProxy = (pm, filepath) => baseProxy(pm, [
|
|
229
|
+
[
|
|
230
|
+
"screencast",
|
|
231
|
+
(opts2, p) => [
|
|
232
|
+
{
|
|
233
|
+
...opts2,
|
|
234
|
+
path: `${filepath}/andWhen/${opts2.path}`
|
|
235
|
+
},
|
|
236
|
+
p
|
|
237
|
+
]
|
|
238
|
+
],
|
|
239
|
+
["createWriteStream", (fp) => [`${filepath}/andWhen/${fp}`]],
|
|
240
|
+
["writeFileSync", (fp, contents) => [`${filepath}/andWhen${fp}`, contents]],
|
|
241
|
+
[
|
|
242
|
+
"customScreenShot",
|
|
243
|
+
(opts2, p) => [
|
|
244
|
+
{
|
|
245
|
+
...opts2,
|
|
246
|
+
path: `${filepath}/andWhen${opts2.path}`
|
|
247
|
+
},
|
|
248
|
+
p
|
|
249
|
+
]
|
|
250
|
+
]
|
|
251
|
+
]);
|
|
252
|
+
var afterEachProxy = (pm, suite, given) => baseProxy(pm, [
|
|
253
|
+
[
|
|
254
|
+
"screencast",
|
|
255
|
+
(opts2, p) => [
|
|
256
|
+
{
|
|
257
|
+
...opts2,
|
|
258
|
+
path: `suite-${suite}/given-${given}/afterEach/${opts2.path}`
|
|
259
|
+
},
|
|
260
|
+
p
|
|
261
|
+
]
|
|
262
|
+
],
|
|
263
|
+
["createWriteStream", (fp) => [`suite-${suite}/afterEach/${fp}`]],
|
|
264
|
+
[
|
|
265
|
+
"writeFileSync",
|
|
266
|
+
(fp, contents) => [
|
|
267
|
+
`suite-${suite}/given-${given}/afterEach/${fp}`,
|
|
268
|
+
contents
|
|
269
|
+
]
|
|
270
|
+
],
|
|
271
|
+
[
|
|
272
|
+
"customScreenShot",
|
|
273
|
+
(opts2, p) => [
|
|
274
|
+
{
|
|
275
|
+
...opts2,
|
|
276
|
+
path: `suite-${suite}/given-${given}/afterEach/${opts2.path}`
|
|
277
|
+
},
|
|
278
|
+
p
|
|
279
|
+
]
|
|
280
|
+
]
|
|
281
|
+
]);
|
|
282
|
+
var beforeEachProxy = (pm, suite) => baseProxy(pm, [
|
|
283
|
+
[
|
|
284
|
+
"screencast",
|
|
285
|
+
(opts2, p) => [
|
|
286
|
+
{
|
|
287
|
+
...opts2,
|
|
288
|
+
path: `suite-${suite}/beforeEach/${opts2.path}`
|
|
289
|
+
},
|
|
290
|
+
p
|
|
291
|
+
]
|
|
292
|
+
],
|
|
293
|
+
[
|
|
294
|
+
"writeFileSync",
|
|
295
|
+
(fp, contents) => [`suite-${suite}/beforeEach/${fp}`, contents]
|
|
296
|
+
],
|
|
297
|
+
[
|
|
298
|
+
"customScreenShot",
|
|
299
|
+
(opts2, p) => [
|
|
300
|
+
{
|
|
301
|
+
...opts2,
|
|
302
|
+
path: `suite-${suite}/beforeEach/${opts2.path}`
|
|
303
|
+
},
|
|
304
|
+
p
|
|
305
|
+
]
|
|
306
|
+
],
|
|
307
|
+
["createWriteStream", (fp) => [`suite-${suite}/beforeEach/${fp}`]]
|
|
308
|
+
]);
|
|
309
|
+
var beforeAllProxy = (pm, suite) => baseProxy(pm, [
|
|
310
|
+
[
|
|
311
|
+
"writeFileSync",
|
|
312
|
+
(fp, contents) => [`suite-${suite}/beforeAll/${fp}`, contents]
|
|
313
|
+
],
|
|
314
|
+
[
|
|
315
|
+
"customScreenShot",
|
|
316
|
+
(opts2, p) => [
|
|
317
|
+
{
|
|
318
|
+
...opts2,
|
|
319
|
+
path: `suite-${suite}/beforeAll/${opts2.path}`
|
|
320
|
+
},
|
|
321
|
+
p
|
|
322
|
+
]
|
|
323
|
+
],
|
|
324
|
+
["createWriteStream", (fp) => [`suite-${suite}/beforeAll/${fp}`]]
|
|
325
|
+
]);
|
|
326
|
+
var afterAllProxy = (pm, suite) => baseProxy(pm, [
|
|
327
|
+
["createWriteStream", (fp) => [`suite-${suite}/afterAll/${fp}`]],
|
|
328
|
+
[
|
|
329
|
+
"writeFileSync",
|
|
330
|
+
(fp, contents) => [`suite-${suite}/afterAll/${fp}`, contents]
|
|
331
|
+
],
|
|
332
|
+
[
|
|
333
|
+
"customScreenShot",
|
|
334
|
+
(opts2, p) => [
|
|
335
|
+
{
|
|
336
|
+
...opts2,
|
|
337
|
+
path: `suite-${suite}/afterAll/${opts2.path}`
|
|
338
|
+
},
|
|
339
|
+
p
|
|
340
|
+
]
|
|
341
|
+
]
|
|
342
|
+
]);
|
|
343
|
+
|
|
547
344
|
// src/lib/abstractBase.ts
|
|
548
|
-
init_dirname();
|
|
549
|
-
init_buffer();
|
|
550
|
-
init_process();
|
|
551
345
|
var BaseGiven = class {
|
|
552
346
|
constructor(name, features, whens, thens, givenCB, initialValues) {
|
|
553
347
|
this.artifacts = [];
|
|
@@ -737,15 +531,7 @@ var BaseThen = class {
|
|
|
737
531
|
}
|
|
738
532
|
};
|
|
739
533
|
|
|
740
|
-
// src/lib/classBuilder.ts
|
|
741
|
-
init_dirname();
|
|
742
|
-
init_buffer();
|
|
743
|
-
init_process();
|
|
744
|
-
|
|
745
534
|
// src/lib/basebuilder.ts
|
|
746
|
-
init_dirname();
|
|
747
|
-
init_buffer();
|
|
748
|
-
init_process();
|
|
749
535
|
var BaseBuilder = class {
|
|
750
536
|
constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, testResourceRequirement, testSpecification) {
|
|
751
537
|
this.artifacts = [];
|
|
@@ -790,11 +576,14 @@ var BaseBuilder = class {
|
|
|
790
576
|
};
|
|
791
577
|
const suiteDone = await runner(puppetMaster, tLog);
|
|
792
578
|
const fails = suiteDone.fails;
|
|
793
|
-
await puppetMaster.writeFileSync(
|
|
794
|
-
|
|
579
|
+
await puppetMaster.writeFileSync([
|
|
580
|
+
`bdd_errors.txt`,
|
|
581
|
+
fails.toString()
|
|
582
|
+
]);
|
|
583
|
+
await puppetMaster.writeFileSync([
|
|
795
584
|
`tests.json`,
|
|
796
585
|
JSON.stringify(this.toObj(), null, 2)
|
|
797
|
-
);
|
|
586
|
+
]);
|
|
798
587
|
return {
|
|
799
588
|
failed: fails > 0,
|
|
800
589
|
fails,
|
|
@@ -899,10 +688,102 @@ var ClassBuilder = class extends BaseBuilder {
|
|
|
899
688
|
}
|
|
900
689
|
};
|
|
901
690
|
|
|
691
|
+
// src/lib/BaseSuite.ts
|
|
692
|
+
var BaseSuite = class {
|
|
693
|
+
constructor(name, index, givens = {}) {
|
|
694
|
+
const suiteName = name || "testSuite";
|
|
695
|
+
if (!suiteName) {
|
|
696
|
+
throw new Error("BaseSuite requires a non-empty name");
|
|
697
|
+
}
|
|
698
|
+
console.log(
|
|
699
|
+
"[DEBUG] BaseSuite constructor - name:",
|
|
700
|
+
suiteName,
|
|
701
|
+
"index:",
|
|
702
|
+
index
|
|
703
|
+
);
|
|
704
|
+
this.name = suiteName;
|
|
705
|
+
this.index = index;
|
|
706
|
+
this.givens = givens;
|
|
707
|
+
this.fails = 0;
|
|
708
|
+
console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
|
|
709
|
+
console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
|
|
710
|
+
}
|
|
711
|
+
features() {
|
|
712
|
+
try {
|
|
713
|
+
const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
|
|
714
|
+
return array.indexOf(value) === index;
|
|
715
|
+
});
|
|
716
|
+
console.debug("[DEBUG] Features extracted:", features.toString());
|
|
717
|
+
return features || [];
|
|
718
|
+
} catch (e) {
|
|
719
|
+
console.error("[ERROR] Failed to extract features:", e);
|
|
720
|
+
return [];
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
toObj() {
|
|
724
|
+
const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
|
|
725
|
+
return {
|
|
726
|
+
name: this.name,
|
|
727
|
+
givens,
|
|
728
|
+
fails: this.fails,
|
|
729
|
+
failed: this.failed,
|
|
730
|
+
features: this.features()
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
setup(s, artifactory, tr, pm) {
|
|
734
|
+
return new Promise((res) => res(s));
|
|
735
|
+
}
|
|
736
|
+
assertThat(t) {
|
|
737
|
+
return !!t;
|
|
738
|
+
}
|
|
739
|
+
afterAll(store, artifactory, pm) {
|
|
740
|
+
return store;
|
|
741
|
+
}
|
|
742
|
+
async run(input, testResourceConfiguration, artifactory, tLog, pm) {
|
|
743
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
744
|
+
const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
|
|
745
|
+
tLog("\nSuite:", this.index, this.name);
|
|
746
|
+
const sNdx = this.index;
|
|
747
|
+
const subject = await this.setup(
|
|
748
|
+
input,
|
|
749
|
+
suiteArtifactory,
|
|
750
|
+
testResourceConfiguration,
|
|
751
|
+
beforeAllProxy(pm, sNdx.toString())
|
|
752
|
+
);
|
|
753
|
+
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
754
|
+
const giver = this.givens[gKey];
|
|
755
|
+
this.store = await giver.give(
|
|
756
|
+
subject,
|
|
757
|
+
gKey,
|
|
758
|
+
testResourceConfiguration,
|
|
759
|
+
this.assertThat,
|
|
760
|
+
suiteArtifactory,
|
|
761
|
+
tLog,
|
|
762
|
+
pm,
|
|
763
|
+
sNdx
|
|
764
|
+
).catch((e) => {
|
|
765
|
+
this.failed = true;
|
|
766
|
+
this.fails = this.fails + 1;
|
|
767
|
+
throw e;
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
try {
|
|
771
|
+
this.afterAll(
|
|
772
|
+
this.store,
|
|
773
|
+
artifactory,
|
|
774
|
+
afterAllProxy(pm, sNdx.toString())
|
|
775
|
+
);
|
|
776
|
+
} catch (e) {
|
|
777
|
+
console.error(e);
|
|
778
|
+
}
|
|
779
|
+
return this;
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
|
|
902
783
|
// src/lib/core.ts
|
|
903
784
|
var TesterantoCore = class extends ClassBuilder {
|
|
904
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement,
|
|
905
|
-
const fullAdapter = DefaultAdapter(
|
|
785
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter2, uberCatcher) {
|
|
786
|
+
const fullAdapter = DefaultAdapter(testAdapter2);
|
|
906
787
|
super(
|
|
907
788
|
testImplementation,
|
|
908
789
|
testSpecification,
|
|
@@ -960,13 +841,13 @@ var TesterantoCore = class extends ClassBuilder {
|
|
|
960
841
|
|
|
961
842
|
// src/Web.ts
|
|
962
843
|
var WebTesteranto = class extends TesterantoCore {
|
|
963
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement,
|
|
844
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter2) {
|
|
964
845
|
super(
|
|
965
846
|
input,
|
|
966
847
|
testSpecification,
|
|
967
848
|
testImplementation,
|
|
968
849
|
testResourceRequirement,
|
|
969
|
-
|
|
850
|
+
testAdapter2,
|
|
970
851
|
(cb) => {
|
|
971
852
|
}
|
|
972
853
|
);
|
|
@@ -977,21 +858,237 @@ var WebTesteranto = class extends TesterantoCore {
|
|
|
977
858
|
return await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
978
859
|
}
|
|
979
860
|
};
|
|
980
|
-
var Web_default = async (input, testSpecification, testImplementation,
|
|
861
|
+
var Web_default = async (input, testSpecification, testImplementation, testAdapter2, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
981
862
|
return new WebTesteranto(
|
|
982
863
|
input,
|
|
983
864
|
testSpecification,
|
|
984
865
|
testImplementation,
|
|
985
866
|
testResourceRequirement,
|
|
986
|
-
|
|
867
|
+
testAdapter2
|
|
987
868
|
);
|
|
988
869
|
};
|
|
989
870
|
|
|
871
|
+
// src/lib/baseBuilder.test/baseBuilder.test.specification.ts
|
|
872
|
+
var specification = (Suite, Given, When, Then) => {
|
|
873
|
+
return [
|
|
874
|
+
Suite.Default("Testing BaseBuilder functionality", {
|
|
875
|
+
testInitialization: Given["the default BaseBuilder"](
|
|
876
|
+
["BaseBuilder should initialize correctly"],
|
|
877
|
+
[],
|
|
878
|
+
[
|
|
879
|
+
Then["it is initialized"](),
|
|
880
|
+
Then["it tracks artifacts"]()
|
|
881
|
+
// Then["it creates jobs"](),
|
|
882
|
+
// Then["it generates TestSpecifications"](),
|
|
883
|
+
]
|
|
884
|
+
),
|
|
885
|
+
testSpecsGeneration: Given["the default BaseBuilder"](
|
|
886
|
+
["BaseBuilder should generate specs from test specification"],
|
|
887
|
+
[],
|
|
888
|
+
[Then["it generates TestSpecifications"]()]
|
|
889
|
+
),
|
|
890
|
+
testJobsCreation: Given["the default BaseBuilder"](
|
|
891
|
+
["BaseBuilder should create test jobs"],
|
|
892
|
+
[],
|
|
893
|
+
[Then["it creates jobs"]()]
|
|
894
|
+
)
|
|
895
|
+
})
|
|
896
|
+
];
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
// src/lib/baseBuilder.test/baseBuilder.test.mock.ts
|
|
900
|
+
var MockBaseBuilder = class extends BaseBuilder {
|
|
901
|
+
constructor(input, suitesOverrides = {}, givenOverrides = {}, whenOverrides = {}, thenOverrides = {}, testResourceRequirement = { ports: 0 }, testSpecification = () => []) {
|
|
902
|
+
super(
|
|
903
|
+
input,
|
|
904
|
+
suitesOverrides,
|
|
905
|
+
givenOverrides,
|
|
906
|
+
whenOverrides,
|
|
907
|
+
thenOverrides,
|
|
908
|
+
testResourceRequirement,
|
|
909
|
+
testSpecification
|
|
910
|
+
);
|
|
911
|
+
this.summary = {};
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Simplified version for testing that doesn't actually run tests
|
|
915
|
+
*/
|
|
916
|
+
testRun(puppetMaster) {
|
|
917
|
+
this.summary = {
|
|
918
|
+
[puppetMaster.testResourceConfiguration.name]: {
|
|
919
|
+
typeErrors: 0,
|
|
920
|
+
staticErrors: 0,
|
|
921
|
+
runTimeError: "",
|
|
922
|
+
prompt: "",
|
|
923
|
+
failingFeatures: {}
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
return Promise.resolve({
|
|
927
|
+
failed: false,
|
|
928
|
+
fails: 0,
|
|
929
|
+
artifacts: [],
|
|
930
|
+
// logPromise: Promise.resolve(),
|
|
931
|
+
features: []
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
// src/lib/baseBuilder.test/baseBuilder.test.implementation.ts
|
|
937
|
+
var implementation = {
|
|
938
|
+
suites: {
|
|
939
|
+
Default: "BaseBuilder test suite"
|
|
940
|
+
},
|
|
941
|
+
givens: {
|
|
942
|
+
"the default BaseBuilder": () => {
|
|
943
|
+
return new MockBaseBuilder(
|
|
944
|
+
{},
|
|
945
|
+
// input
|
|
946
|
+
{},
|
|
947
|
+
// suitesOverrides
|
|
948
|
+
{},
|
|
949
|
+
// givenOverrides
|
|
950
|
+
{},
|
|
951
|
+
// whenOverrides
|
|
952
|
+
{},
|
|
953
|
+
// thenOverrides
|
|
954
|
+
{ ports: 0 },
|
|
955
|
+
// testResourceRequirement
|
|
956
|
+
() => []
|
|
957
|
+
// testSpecification
|
|
958
|
+
);
|
|
959
|
+
},
|
|
960
|
+
"a BaseBuilder with TestInput": (input) => {
|
|
961
|
+
return new MockBaseBuilder(
|
|
962
|
+
input,
|
|
963
|
+
{},
|
|
964
|
+
{},
|
|
965
|
+
{},
|
|
966
|
+
{},
|
|
967
|
+
{ ports: [] },
|
|
968
|
+
() => []
|
|
969
|
+
);
|
|
970
|
+
},
|
|
971
|
+
"a BaseBuilder with Test Resource Requirements": (requirements) => {
|
|
972
|
+
return new MockBaseBuilder({}, {}, {}, {}, {}, requirements, () => []);
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
whens: {
|
|
976
|
+
addArtifact: (artifact) => (builder) => {
|
|
977
|
+
builder.artifacts.push(artifact);
|
|
978
|
+
return builder;
|
|
979
|
+
},
|
|
980
|
+
setTestJobs: (jobs) => (builder) => {
|
|
981
|
+
builder.testJobs = jobs;
|
|
982
|
+
return builder;
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
thens: {
|
|
986
|
+
"it is initialized": () => (builder, utils) => {
|
|
987
|
+
utils.writeFileSync("hello.txt", "world");
|
|
988
|
+
if (!(builder instanceof BaseBuilder)) {
|
|
989
|
+
console.error("Builder instance:", builder);
|
|
990
|
+
throw new Error(
|
|
991
|
+
`Builder was not properly initialized - expected BaseBuilder instance but got ${builder?.constructor?.name}`
|
|
992
|
+
);
|
|
993
|
+
}
|
|
994
|
+
[
|
|
995
|
+
"artifacts",
|
|
996
|
+
"testJobs",
|
|
997
|
+
"specs",
|
|
998
|
+
"suitesOverrides",
|
|
999
|
+
"givenOverides",
|
|
1000
|
+
"whenOverides",
|
|
1001
|
+
"thenOverides"
|
|
1002
|
+
].forEach((prop) => {
|
|
1003
|
+
if (!(prop in builder)) {
|
|
1004
|
+
throw new Error(`Builder missing required property: ${prop}`);
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
return builder;
|
|
1008
|
+
},
|
|
1009
|
+
"it generates TestSpecifications": () => (builder) => {
|
|
1010
|
+
if (!Array.isArray(builder.specs)) {
|
|
1011
|
+
throw new Error("Specs were not generated");
|
|
1012
|
+
}
|
|
1013
|
+
return builder;
|
|
1014
|
+
},
|
|
1015
|
+
"it creates jobs": () => (builder) => {
|
|
1016
|
+
if (!Array.isArray(builder.testJobs)) {
|
|
1017
|
+
throw new Error("Test jobs were not created");
|
|
1018
|
+
}
|
|
1019
|
+
return builder;
|
|
1020
|
+
},
|
|
1021
|
+
"it tracks artifacts": () => (builder) => {
|
|
1022
|
+
if (!Array.isArray(builder.artifacts)) {
|
|
1023
|
+
throw new Error("Artifacts array not initialized");
|
|
1024
|
+
}
|
|
1025
|
+
return builder;
|
|
1026
|
+
},
|
|
1027
|
+
resourceRequirementsSet: () => (builder) => {
|
|
1028
|
+
if (!builder.testResourceRequirement) {
|
|
1029
|
+
throw new Error("Resource requirements not set");
|
|
1030
|
+
}
|
|
1031
|
+
return builder;
|
|
1032
|
+
},
|
|
1033
|
+
suitesOverridesConfigured: () => (builder) => {
|
|
1034
|
+
if (!builder.suitesOverrides) {
|
|
1035
|
+
throw new Error("Suites overrides not configured");
|
|
1036
|
+
}
|
|
1037
|
+
return builder;
|
|
1038
|
+
},
|
|
1039
|
+
givensOverridesConfigured: () => (builder) => {
|
|
1040
|
+
if (!builder.givenOverides) {
|
|
1041
|
+
throw new Error("Givens overrides not configured");
|
|
1042
|
+
}
|
|
1043
|
+
return builder;
|
|
1044
|
+
},
|
|
1045
|
+
whensOverridesConfigured: () => (builder) => {
|
|
1046
|
+
if (!builder.whenOverides) {
|
|
1047
|
+
throw new Error("Whens overrides not configured");
|
|
1048
|
+
}
|
|
1049
|
+
return builder;
|
|
1050
|
+
},
|
|
1051
|
+
thensOverridesConfigured: () => (builder) => {
|
|
1052
|
+
if (!builder.thenOverides) {
|
|
1053
|
+
throw new Error("Thens overrides not configured");
|
|
1054
|
+
}
|
|
1055
|
+
return builder;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
// src/lib/baseBuilder.test/baseBuilder.test.adapter.ts
|
|
1061
|
+
var testAdapter = {
|
|
1062
|
+
beforeAll: async (input, testResource, pm) => input,
|
|
1063
|
+
beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
|
|
1064
|
+
console.log("Initializing test with:", {
|
|
1065
|
+
subject,
|
|
1066
|
+
initializer,
|
|
1067
|
+
initialValues
|
|
1068
|
+
});
|
|
1069
|
+
const result = initializer();
|
|
1070
|
+
console.log("Initialization result:", result.toString());
|
|
1071
|
+
return result;
|
|
1072
|
+
},
|
|
1073
|
+
andWhen: async (store, whenCB, testResource, utils) => {
|
|
1074
|
+
return whenCB(store, utils);
|
|
1075
|
+
},
|
|
1076
|
+
butThen: async (store, thenCB, testResource, pm) => {
|
|
1077
|
+
return thenCB(store, pm);
|
|
1078
|
+
},
|
|
1079
|
+
afterEach: (store) => store,
|
|
1080
|
+
afterAll: () => {
|
|
1081
|
+
},
|
|
1082
|
+
assertThis: (x) => x
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
// src/lib/baseBuilder.test/baseBuilder.test.pure.ts
|
|
1086
|
+
var baseBuilder_test_pure_default = Web_default(
|
|
1087
|
+
MockBaseBuilder.prototype,
|
|
1088
|
+
specification,
|
|
1089
|
+
implementation,
|
|
1090
|
+
testAdapter
|
|
1091
|
+
);
|
|
990
1092
|
export {
|
|
991
|
-
|
|
992
|
-
BaseWhen,
|
|
993
|
-
BaseThen,
|
|
994
|
-
BaseBuilder,
|
|
995
|
-
BaseSuite,
|
|
996
|
-
Web_default
|
|
1093
|
+
baseBuilder_test_pure_default as default
|
|
997
1094
|
};
|