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