testeranto 0.167.0 → 0.172.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/dist/common/src/NavBar.js +45 -0
- package/dist/common/src/PM/main.js +81 -59
- package/dist/common/src/Pure.js +16 -14
- package/dist/common/src/ReportServer.js +48 -5
- package/dist/common/src/Web.js +35 -20
- package/dist/common/src/components/SunriseAnimation.test/implementation.js +1 -0
- package/dist/common/src/components/SunriseAnimation.test/index.js +1 -0
- package/dist/common/src/components/SunriseAnimation.test/interface.js +1 -0
- package/dist/common/src/components/SunriseAnimation.test/specification.js +1 -0
- package/dist/common/src/components/TestStatusBadge.js +55 -0
- package/dist/common/src/components/pure/ProjectPageView.js +204 -0
- package/dist/common/src/components/pure/ProjectPageView.test/adapter.js +20 -0
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +71 -0
- package/dist/common/src/components/pure/ProjectPageView.test/index.js +10 -0
- package/dist/common/src/components/pure/ProjectPageView.test/specification.js +19 -0
- package/dist/common/src/components/pure/ProjectPageView.test/types.js +2 -0
- package/dist/common/src/lib/BaseSuite.js +3 -3
- package/dist/common/src/lib/BaseSuite.test/test.js +1 -1
- package/dist/common/src/lib/abstractBase.js +41 -14
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
- package/dist/common/src/lib/pmProxy.js +185 -64
- package/dist/common/testeranto.config.js +6 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/App.js +3 -3
- package/dist/module/src/PM/main.js +81 -59
- package/dist/module/src/ProjectsPage.js +1 -110
- package/dist/module/src/Pure.js +16 -14
- package/dist/module/src/ReportServer.js +48 -5
- package/dist/module/src/TestPage.js +45 -16
- package/dist/module/src/Web.js +35 -20
- package/dist/module/src/components/SunriseAnimation.test/implementation.js +1 -0
- package/dist/module/src/components/SunriseAnimation.test/index.js +1 -0
- package/dist/module/src/components/SunriseAnimation.test/interface.js +1 -0
- package/dist/module/src/components/SunriseAnimation.test/specification.js +1 -0
- package/dist/module/src/components/pure/ProjectPageView.js +197 -0
- package/dist/module/src/components/pure/ProjectPageView.test/adapter.js +17 -0
- package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +68 -0
- package/dist/module/src/components/pure/ProjectPageView.test/index.js +5 -0
- package/dist/module/src/components/pure/ProjectPageView.test/specification.js +15 -0
- package/dist/module/src/components/pure/ProjectPageView.test/types.js +1 -0
- package/dist/module/src/components/pure/ProjectsPageView.js +58 -0
- package/dist/module/src/components/pure/TestPageView.js +136 -0
- package/dist/module/src/components/stateful/ProjectPage.js +63 -0
- package/dist/module/src/components/stateful/ProjectsPage.js +55 -0
- package/dist/module/src/components/stateful/TestPage.js +82 -0
- package/dist/module/src/lib/BaseSuite.js +3 -3
- package/dist/module/src/lib/BaseSuite.test/test.js +1 -1
- package/dist/module/src/lib/abstractBase.js +41 -14
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
- package/dist/module/src/lib/pmProxy.js +185 -64
- package/dist/module/testeranto.config.js +6 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.css +13 -9
- package/dist/prebuild/App.js +600 -551
- package/dist/prebuild/ReportServer.mjs +44 -4
- package/dist/prebuild/run.mjs +67 -39
- package/dist/types/src/NavBar.d.ts +19 -0
- package/dist/types/src/PM/index.d.ts +3 -1
- package/dist/types/src/PM/main.d.ts +0 -4
- package/dist/types/src/PM/node.d.ts +2 -2
- package/dist/types/src/components/SunriseAnimation.test/interface.d.ts +0 -0
- package/dist/types/src/components/SunriseAnimation.test/specification.d.ts +0 -0
- package/dist/types/src/components/TestStatusBadge.d.ts +15 -0
- package/dist/types/src/components/pure/ProjectPageView.d.ts +14 -0
- package/dist/types/src/components/pure/ProjectPageView.test/adapter.d.ts +3 -0
- package/dist/types/src/components/pure/ProjectPageView.test/implementation.d.ts +3 -0
- package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +2 -0
- package/dist/types/src/components/pure/ProjectPageView.test/specification.d.ts +3 -0
- package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +39 -0
- package/dist/types/src/lib/BaseSuite.d.ts +2 -0
- package/dist/types/src/lib/abstractBase.d.ts +12 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/src/App.tsx +5 -9
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +87 -82
- package/src/PM/node.ts +2 -2
- package/src/ProjectsPage.tsx +1 -164
- package/src/Pure.ts +16 -16
- package/src/ReportServer.ts +49 -6
- package/src/TestPage.tsx +78 -5
- package/src/Web.ts +35 -35
- package/src/components/SunriseAnimation.test/implementation.ts +0 -0
- package/src/components/SunriseAnimation.test/index.ts +0 -0
- package/src/components/SunriseAnimation.test/interface.ts +0 -0
- package/src/components/SunriseAnimation.test/specification.ts +0 -0
- package/src/components/pure/ProjectPageView.test/adapter.ts +21 -0
- package/src/components/pure/ProjectPageView.test/implementation.tsx +84 -0
- package/src/components/pure/ProjectPageView.test/index.ts +8 -0
- package/src/components/pure/ProjectPageView.test/specification.ts +31 -0
- package/src/components/pure/ProjectPageView.test/types.ts +55 -0
- package/src/components/pure/ProjectPageView.tsx +332 -0
- package/src/components/pure/ProjectsPageView.tsx +99 -0
- package/src/components/pure/TestPageView.tsx +278 -0
- package/src/components/stateful/ProjectPage.tsx +83 -0
- package/src/components/stateful/ProjectsPage.tsx +73 -0
- package/src/components/stateful/TestPage.tsx +107 -0
- package/src/lib/BaseSuite.test/test.ts +1 -1
- package/src/lib/BaseSuite.ts +9 -4
- package/src/lib/abstractBase.ts +45 -14
- package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +1 -1
- package/src/lib/pmProxy.ts +184 -87
- package/testeranto/App.css +13 -9
- package/testeranto/App.js +600 -551
- package/testeranto/bundles/node/allTests/{chunk-4ONUZRZ4.mjs → chunk-3EUGBAOM.mjs} +1 -1
- package/testeranto/bundles/node/allTests/{chunk-IDCUSTSM.mjs → chunk-E75CSRER.mjs} +246 -115
- package/testeranto/bundles/node/allTests/{chunk-NQEP7SN4.mjs → chunk-M6DO7VMB.mjs} +1 -1
- package/testeranto/bundles/node/allTests/metafile.json +37 -37
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +4 -4
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +3 -3
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +3 -3
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +2 -17
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +354 -252
- package/testeranto/bundles/pure/allTests/{chunk-5SBJWHSZ.mjs → chunk-KHDVEHF7.mjs} +2 -17
- package/testeranto/bundles/pure/allTests/{chunk-4ULDTZFU.mjs → chunk-VMUSFSZM.mjs} +246 -115
- package/testeranto/bundles/pure/allTests/metafile.json +72 -42
- package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +2 -2
- package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +3 -3
- package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +2 -29
- package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +2283 -0
- package/testeranto/bundles/web/allTests/{chunk-46E6YGGN.mjs → chunk-U7AW26HL.mjs} +292 -142
- package/testeranto/bundles/web/allTests/metafile.json +22 -943
- package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.html +19 -0
- package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.mjs +37524 -0
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +20 -2
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +26 -2
- package/testeranto/reports/allTests/config.json +8 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +9 -3
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +1 -0
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +13 -0
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +50 -0
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +17 -0
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +32 -0
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +68 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +22 -39
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +6 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +8 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +6 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +9 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +66 -55
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +2 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +6 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +10 -5
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +16 -48
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +18 -9
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +8 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +10 -5
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +62 -33
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +2 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +18 -9
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +10 -5
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +37 -50
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +36 -18
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +8 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +2 -2
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +9 -3
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +28 -43
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +28 -14
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +8 -1
- package/testeranto/reports/allTests/summary.json +15 -8
- package/testeranto/reportsnode_build_errors +20 -0
- package/testeranto/reportspure_build_errors +343 -0
- package/testeranto/reportsweb_build_errors +25 -0
- package/testeranto.config.ts +7 -0
- package/tsc.log +100 -26
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/testeranto/bundles/node/allTests/chunk-FFBRDUBH.mjs +0 -677
- package/testeranto/bundles/node/allTests/chunk-H2IBV7SY.mjs +0 -113
- package/testeranto/bundles/node/allTests/chunk-ZHOULXPN.mjs +0 -252
- package/testeranto/bundles/pure/allTests/chunk-CSMXYJ65.mjs +0 -200
- package/testeranto/bundles/pure/allTests/chunk-QK4IXLF6.mjs +0 -674
- package/testeranto/bundles/web/allTests/chunk-TU3MJSSI.mjs +0 -855
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test/manifest.json +0 -1
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/manifest.json +0 -1
- package/testeranto/reports/allTests/src/Pure.test/pure/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/manifest.json +0 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/manifest.json +0 -1
- /package/{testeranto/reports/allTests/src/Pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/implementation.d.ts} +0 -0
- /package/{testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/index.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PM,
|
|
4
4
|
TesterantoCore,
|
|
5
5
|
defaultTestResourceRequirement
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VMUSFSZM.mjs";
|
|
7
7
|
|
|
8
8
|
// src/PM/pure.ts
|
|
9
9
|
var PM_Pure = class extends PM {
|
|
@@ -153,21 +153,6 @@ var PureTesteranto = class extends TesterantoCore {
|
|
|
153
153
|
);
|
|
154
154
|
const t = JSON.parse(partialTestResource);
|
|
155
155
|
const pm = new PM_Pure(t);
|
|
156
|
-
console.log("[DEBUG] Current test jobs:", this.testJobs?.length);
|
|
157
|
-
if (!this.testJobs || this.testJobs.length === 0) {
|
|
158
|
-
console.error(
|
|
159
|
-
"[ERROR] No test jobs available - checking specs:",
|
|
160
|
-
this.specs?.length
|
|
161
|
-
);
|
|
162
|
-
console.error("[ERROR] Test implementation:", this.testImplementation);
|
|
163
|
-
return {
|
|
164
|
-
failed: true,
|
|
165
|
-
fails: 1,
|
|
166
|
-
artifacts: [],
|
|
167
|
-
// logPromise: Promise.resolve(),
|
|
168
|
-
features: []
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
156
|
try {
|
|
172
157
|
console.log("[DEBUG] Executing test job with PM:", pm);
|
|
173
158
|
const result = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
@@ -177,7 +162,7 @@ var PureTesteranto = class extends TesterantoCore {
|
|
|
177
162
|
console.error("[ERROR] Test job failed:", e);
|
|
178
163
|
return {
|
|
179
164
|
failed: true,
|
|
180
|
-
fails: 1,
|
|
165
|
+
fails: -1,
|
|
181
166
|
artifacts: [],
|
|
182
167
|
// logPromise: Promise.resolve(),
|
|
183
168
|
features: []
|
|
@@ -15,146 +15,243 @@ var baseProxy = function(pm, mappings) {
|
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
var butThenProxy = (pm, filepath) =>
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
path
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
18
|
+
var butThenProxy = (pm, filepath) => {
|
|
19
|
+
return baseProxy(pm, [
|
|
20
|
+
[
|
|
21
|
+
"screencast",
|
|
22
|
+
(opts, p) => {
|
|
23
|
+
const path = `${filepath}/butThen/${opts.path}`;
|
|
24
|
+
console.log(`[Proxy] Captured artifact path for butThen:`, path);
|
|
25
|
+
if (pm.currentStep?.addArtifact) {
|
|
26
|
+
pm.currentStep.addArtifact(path);
|
|
27
|
+
} else {
|
|
28
|
+
console.warn("No currentStep or addArtifact method found");
|
|
29
|
+
}
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
...opts,
|
|
33
|
+
path
|
|
34
|
+
},
|
|
35
|
+
p
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
["createWriteStream", (fp) => {
|
|
40
|
+
const path = `${filepath}/butThen/${fp}`;
|
|
41
|
+
console.log(`[Proxy] Captured artifact path for butThen:`, path);
|
|
42
|
+
if (pm.currentStep?.addArtifact) {
|
|
43
|
+
pm.currentStep.addArtifact(path);
|
|
44
|
+
} else {
|
|
45
|
+
console.warn("No currentStep or addArtifact method found");
|
|
46
|
+
}
|
|
47
|
+
return [path];
|
|
48
|
+
}],
|
|
49
|
+
[
|
|
50
|
+
"writeFileSync",
|
|
51
|
+
(fp, contents) => {
|
|
52
|
+
const path = `${filepath}/butThen/${fp}`;
|
|
53
|
+
pm.currentStep?.artifacts?.push(path);
|
|
54
|
+
return [path, contents];
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
"customScreenShot",
|
|
59
|
+
(opts, p) => {
|
|
60
|
+
const path = `${filepath}/butThen/${opts.path}`;
|
|
61
|
+
pm.currentStep?.artifacts?.push(path);
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
...opts,
|
|
65
|
+
path
|
|
66
|
+
},
|
|
67
|
+
p
|
|
68
|
+
];
|
|
69
|
+
}
|
|
42
70
|
]
|
|
43
|
-
]
|
|
44
|
-
|
|
71
|
+
]);
|
|
72
|
+
};
|
|
45
73
|
var andWhenProxy = (pm, filepath) => baseProxy(pm, [
|
|
46
74
|
[
|
|
47
75
|
"screencast",
|
|
48
|
-
(opts, p) =>
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
(opts, p) => {
|
|
77
|
+
const path = `${filepath}/andWhen/${opts.path}`;
|
|
78
|
+
pm.currentStep?.artifacts?.push(path);
|
|
79
|
+
return [
|
|
80
|
+
{
|
|
81
|
+
...opts,
|
|
82
|
+
path
|
|
83
|
+
},
|
|
84
|
+
p
|
|
85
|
+
];
|
|
86
|
+
}
|
|
55
87
|
],
|
|
56
|
-
["createWriteStream", (fp) =>
|
|
57
|
-
|
|
88
|
+
["createWriteStream", (fp) => {
|
|
89
|
+
const path = `${filepath}/andWhen/${fp}`;
|
|
90
|
+
pm.currentStep?.artifacts?.push(path);
|
|
91
|
+
return [path];
|
|
92
|
+
}],
|
|
93
|
+
["writeFileSync", (fp, contents) => {
|
|
94
|
+
const path = `${filepath}/andWhen/${fp}`;
|
|
95
|
+
pm.currentStep?.artifacts?.push(path);
|
|
96
|
+
return [path, contents];
|
|
97
|
+
}],
|
|
58
98
|
[
|
|
59
99
|
"customScreenShot",
|
|
60
|
-
(opts, p) =>
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
100
|
+
(opts, p) => {
|
|
101
|
+
const path = `${filepath}/andWhen/${opts.path}`;
|
|
102
|
+
pm.currentStep?.artifacts?.push(path);
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
...opts,
|
|
106
|
+
path
|
|
107
|
+
},
|
|
108
|
+
p
|
|
109
|
+
];
|
|
110
|
+
}
|
|
67
111
|
]
|
|
68
112
|
]);
|
|
69
113
|
var afterEachProxy = (pm, suite, given) => baseProxy(pm, [
|
|
70
114
|
[
|
|
71
115
|
"screencast",
|
|
72
|
-
(opts, p) =>
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
116
|
+
(opts, p) => {
|
|
117
|
+
const path = `suite-${suite}/given-${given}/afterEach/${opts.path}`;
|
|
118
|
+
pm.currentStep?.artifacts?.push(path);
|
|
119
|
+
return [
|
|
120
|
+
{
|
|
121
|
+
...opts,
|
|
122
|
+
path
|
|
123
|
+
},
|
|
124
|
+
p
|
|
125
|
+
];
|
|
126
|
+
}
|
|
79
127
|
],
|
|
80
|
-
["createWriteStream", (fp) =>
|
|
128
|
+
["createWriteStream", (fp) => {
|
|
129
|
+
const path = `suite-${suite}/afterEach/${fp}`;
|
|
130
|
+
pm.currentStep?.artifacts?.push(path);
|
|
131
|
+
return [path];
|
|
132
|
+
}],
|
|
81
133
|
[
|
|
82
134
|
"writeFileSync",
|
|
83
|
-
(fp, contents) =>
|
|
84
|
-
`suite-${suite}/given-${given}/afterEach/${fp}
|
|
85
|
-
|
|
86
|
-
|
|
135
|
+
(fp, contents) => {
|
|
136
|
+
const path = `suite-${suite}/given-${given}/afterEach/${fp}`;
|
|
137
|
+
pm.currentStep?.artifacts?.push(path);
|
|
138
|
+
return [path, contents];
|
|
139
|
+
}
|
|
87
140
|
],
|
|
88
141
|
[
|
|
89
142
|
"customScreenShot",
|
|
90
|
-
(opts, p) =>
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
143
|
+
(opts, p) => {
|
|
144
|
+
const path = `suite-${suite}/given-${given}/afterEach/${opts.path}`;
|
|
145
|
+
pm.currentStep?.artifacts?.push(path);
|
|
146
|
+
return [
|
|
147
|
+
{
|
|
148
|
+
...opts,
|
|
149
|
+
path
|
|
150
|
+
},
|
|
151
|
+
p
|
|
152
|
+
];
|
|
153
|
+
}
|
|
97
154
|
]
|
|
98
155
|
]);
|
|
99
156
|
var beforeEachProxy = (pm, suite) => baseProxy(pm, [
|
|
100
157
|
[
|
|
101
158
|
"screencast",
|
|
102
|
-
(opts, p) =>
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
159
|
+
(opts, p) => {
|
|
160
|
+
const path = `suite-${suite}/beforeEach/${opts.path}`;
|
|
161
|
+
pm.currentStep?.artifacts?.push(path);
|
|
162
|
+
return [
|
|
163
|
+
{
|
|
164
|
+
...opts,
|
|
165
|
+
path
|
|
166
|
+
},
|
|
167
|
+
p
|
|
168
|
+
];
|
|
169
|
+
}
|
|
109
170
|
],
|
|
110
171
|
[
|
|
111
172
|
"writeFileSync",
|
|
112
|
-
(fp, contents) =>
|
|
173
|
+
(fp, contents) => {
|
|
174
|
+
const path = `suite-${suite}/beforeEach/${fp}`;
|
|
175
|
+
pm.currentStep?.artifacts?.push(path);
|
|
176
|
+
return [path, contents];
|
|
177
|
+
}
|
|
113
178
|
],
|
|
114
179
|
[
|
|
115
180
|
"customScreenShot",
|
|
116
|
-
(opts, p) =>
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
181
|
+
(opts, p) => {
|
|
182
|
+
const path = `suite-${suite}/beforeEach/${opts.path}`;
|
|
183
|
+
pm.currentStep?.artifacts?.push(path);
|
|
184
|
+
return [
|
|
185
|
+
{
|
|
186
|
+
...opts,
|
|
187
|
+
path
|
|
188
|
+
},
|
|
189
|
+
p
|
|
190
|
+
];
|
|
191
|
+
}
|
|
123
192
|
],
|
|
124
|
-
["createWriteStream", (fp) =>
|
|
193
|
+
["createWriteStream", (fp) => {
|
|
194
|
+
const path = `suite-${suite}/beforeEach/${fp}`;
|
|
195
|
+
pm.currentStep?.artifacts?.push(path);
|
|
196
|
+
return [path];
|
|
197
|
+
}]
|
|
125
198
|
]);
|
|
126
199
|
var beforeAllProxy = (pm, suite) => baseProxy(pm, [
|
|
127
200
|
[
|
|
128
201
|
"writeFileSync",
|
|
129
|
-
(fp, contents) =>
|
|
202
|
+
(fp, contents) => {
|
|
203
|
+
const path = `suite-${suite}/beforeAll/${fp}`;
|
|
204
|
+
pm.currentStep?.artifacts?.push(path);
|
|
205
|
+
return [path, contents];
|
|
206
|
+
}
|
|
130
207
|
],
|
|
131
208
|
[
|
|
132
209
|
"customScreenShot",
|
|
133
|
-
(opts, p) =>
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
210
|
+
(opts, p) => {
|
|
211
|
+
const path = `suite-${suite}/beforeAll/${opts.path}`;
|
|
212
|
+
pm.currentStep?.artifacts?.push(path);
|
|
213
|
+
return [
|
|
214
|
+
{
|
|
215
|
+
...opts,
|
|
216
|
+
path
|
|
217
|
+
},
|
|
218
|
+
p
|
|
219
|
+
];
|
|
220
|
+
}
|
|
140
221
|
],
|
|
141
|
-
["createWriteStream", (fp) =>
|
|
222
|
+
["createWriteStream", (fp) => {
|
|
223
|
+
const path = `suite-${suite}/beforeAll/${fp}`;
|
|
224
|
+
pm.currentStep?.artifacts?.push(path);
|
|
225
|
+
return [path];
|
|
226
|
+
}]
|
|
142
227
|
]);
|
|
143
228
|
var afterAllProxy = (pm, suite) => baseProxy(pm, [
|
|
144
|
-
["createWriteStream", (fp) =>
|
|
229
|
+
["createWriteStream", (fp) => {
|
|
230
|
+
const path = `suite-${suite}/afterAll/${fp}`;
|
|
231
|
+
pm.currentStep?.artifacts?.push(path);
|
|
232
|
+
return [path];
|
|
233
|
+
}],
|
|
145
234
|
[
|
|
146
235
|
"writeFileSync",
|
|
147
|
-
(fp, contents) =>
|
|
236
|
+
(fp, contents) => {
|
|
237
|
+
const path = `suite-${suite}/afterAll/${fp}`;
|
|
238
|
+
pm.currentStep?.artifacts?.push(path);
|
|
239
|
+
return [path, contents];
|
|
240
|
+
}
|
|
148
241
|
],
|
|
149
242
|
[
|
|
150
243
|
"customScreenShot",
|
|
151
|
-
(opts, p) =>
|
|
152
|
-
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
244
|
+
(opts, p) => {
|
|
245
|
+
const path = `suite-${suite}/afterAll/${opts.path}`;
|
|
246
|
+
pm.currentStep?.artifacts?.push(path);
|
|
247
|
+
return [
|
|
248
|
+
{
|
|
249
|
+
...opts,
|
|
250
|
+
path
|
|
251
|
+
},
|
|
252
|
+
p
|
|
253
|
+
];
|
|
254
|
+
}
|
|
158
255
|
]
|
|
159
256
|
]);
|
|
160
257
|
|
|
@@ -165,20 +262,25 @@ var BaseSuite = class {
|
|
|
165
262
|
if (!suiteName) {
|
|
166
263
|
throw new Error("BaseSuite requires a non-empty name");
|
|
167
264
|
}
|
|
168
|
-
console.log(
|
|
265
|
+
console.log(
|
|
266
|
+
"[DEBUG] BaseSuite constructor - name:",
|
|
267
|
+
suiteName,
|
|
268
|
+
"index:",
|
|
269
|
+
index
|
|
270
|
+
);
|
|
169
271
|
this.name = suiteName;
|
|
170
272
|
this.index = index;
|
|
171
273
|
this.givens = givens;
|
|
172
274
|
this.fails = 0;
|
|
173
275
|
console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
|
|
174
|
-
console.log("[DEBUG] BaseSuite givens:", Object.keys(givens));
|
|
276
|
+
console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
|
|
175
277
|
}
|
|
176
278
|
features() {
|
|
177
279
|
try {
|
|
178
280
|
const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
|
|
179
281
|
return array.indexOf(value) === index;
|
|
180
282
|
});
|
|
181
|
-
console.debug("[DEBUG] Features extracted:", features);
|
|
283
|
+
console.debug("[DEBUG] Features extracted:", features.toString());
|
|
182
284
|
return features || [];
|
|
183
285
|
} catch (e) {
|
|
184
286
|
console.error("[ERROR] Failed to extract features:", e);
|
|
@@ -229,7 +331,6 @@ var BaseSuite = class {
|
|
|
229
331
|
).catch((e) => {
|
|
230
332
|
this.failed = true;
|
|
231
333
|
this.fails = this.fails + 1;
|
|
232
|
-
console.error("Given error 1:", e);
|
|
233
334
|
throw e;
|
|
234
335
|
});
|
|
235
336
|
}
|
|
@@ -364,6 +465,7 @@ var BaseBuilder = class {
|
|
|
364
465
|
// src/lib/abstractBase.ts
|
|
365
466
|
var BaseGiven = class {
|
|
366
467
|
constructor(name, features, whens, thens, givenCB, initialValues) {
|
|
468
|
+
this.artifacts = [];
|
|
367
469
|
this.name = name;
|
|
368
470
|
this.features = features;
|
|
369
471
|
this.whens = whens;
|
|
@@ -371,6 +473,10 @@ var BaseGiven = class {
|
|
|
371
473
|
this.givenCB = givenCB;
|
|
372
474
|
this.initialValues = initialValues;
|
|
373
475
|
}
|
|
476
|
+
addArtifact(path) {
|
|
477
|
+
console.log(`[Artifact] Adding to ${this.constructor.name}:`, path);
|
|
478
|
+
this.artifacts.push(path);
|
|
479
|
+
}
|
|
374
480
|
beforeAll(store) {
|
|
375
481
|
return store;
|
|
376
482
|
}
|
|
@@ -381,13 +487,14 @@ var BaseGiven = class {
|
|
|
381
487
|
whens: this.whens.map((w) => {
|
|
382
488
|
if (w && w.toObj)
|
|
383
489
|
return w.toObj();
|
|
384
|
-
console.error("w is not as expected!", w);
|
|
490
|
+
console.error("w is not as expected!", w.toString());
|
|
385
491
|
return {};
|
|
386
492
|
}),
|
|
387
493
|
thens: this.thens.map((t) => t.toObj()),
|
|
388
494
|
error: this.error ? [this.error, this.error.stack] : null,
|
|
389
495
|
failed: this.failed,
|
|
390
|
-
features: this.features
|
|
496
|
+
features: this.features,
|
|
497
|
+
artifacts: this.artifacts
|
|
391
498
|
};
|
|
392
499
|
}
|
|
393
500
|
async afterEach(store, key, artifactory, pm) {
|
|
@@ -401,21 +508,24 @@ var BaseGiven = class {
|
|
|
401
508
|
Given: ${this.name}`);
|
|
402
509
|
const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
|
|
403
510
|
this.uberCatcher((e) => {
|
|
404
|
-
console.error(e);
|
|
511
|
+
console.error(e.toString());
|
|
405
512
|
this.error = e.error;
|
|
406
513
|
tLog(e.stack);
|
|
407
514
|
});
|
|
408
515
|
try {
|
|
516
|
+
const proxiedPm = beforeEachProxy(pm, suiteNdx.toString());
|
|
517
|
+
console.log(`[Given] Setting currentStep for beforeEach:`, this.name);
|
|
518
|
+
proxiedPm.currentStep = this;
|
|
409
519
|
this.store = await this.givenThat(
|
|
410
520
|
subject,
|
|
411
521
|
testResourceConfiguration,
|
|
412
522
|
givenArtifactory,
|
|
413
523
|
this.givenCB,
|
|
414
524
|
this.initialValues,
|
|
415
|
-
|
|
525
|
+
proxiedPm
|
|
416
526
|
);
|
|
417
527
|
} catch (e) {
|
|
418
|
-
console.error("failure
|
|
528
|
+
console.error("Given failure: ", e.toString());
|
|
419
529
|
this.error = e;
|
|
420
530
|
throw e;
|
|
421
531
|
}
|
|
@@ -452,7 +562,7 @@ var BaseGiven = class {
|
|
|
452
562
|
afterEachProxy(pm, suiteNdx.toString(), key)
|
|
453
563
|
);
|
|
454
564
|
} catch (e) {
|
|
455
|
-
console.error("afterEach failed!", e);
|
|
565
|
+
console.error("afterEach failed!", e.toString());
|
|
456
566
|
this.failed = e;
|
|
457
567
|
throw e;
|
|
458
568
|
}
|
|
@@ -462,30 +572,46 @@ var BaseGiven = class {
|
|
|
462
572
|
};
|
|
463
573
|
var BaseWhen = class {
|
|
464
574
|
constructor(name, whenCB) {
|
|
575
|
+
this.artifacts = [];
|
|
465
576
|
this.name = name;
|
|
466
577
|
this.whenCB = whenCB;
|
|
467
578
|
}
|
|
468
579
|
toObj() {
|
|
469
580
|
console.log("toObj error", this.error);
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
581
|
+
if (this.error) {
|
|
582
|
+
return {
|
|
583
|
+
name: this.name,
|
|
584
|
+
error: this.error && this.error.name + this.error.stack,
|
|
585
|
+
artifacts: this.artifacts
|
|
586
|
+
};
|
|
587
|
+
} else {
|
|
588
|
+
return {
|
|
589
|
+
name: this.name,
|
|
590
|
+
artifacts: this.artifacts
|
|
591
|
+
};
|
|
592
|
+
}
|
|
474
593
|
}
|
|
475
594
|
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
476
595
|
try {
|
|
477
596
|
tLog(" When:", this.name);
|
|
478
|
-
console.debug("[DEBUG] Executing When step:", this.name);
|
|
597
|
+
console.debug("[DEBUG] Executing When step:", this.name.toString());
|
|
598
|
+
const proxiedPm = andWhenProxy(pm, filepath);
|
|
599
|
+
console.log(`[When] Setting currentStep for andWhen:`, this.name);
|
|
600
|
+
proxiedPm.currentStep = this;
|
|
479
601
|
const result = await this.andWhen(
|
|
480
602
|
store,
|
|
481
603
|
this.whenCB,
|
|
482
604
|
testResourceConfiguration,
|
|
483
|
-
|
|
605
|
+
proxiedPm
|
|
484
606
|
);
|
|
485
|
-
console.debug("[DEBUG] When step completed:", this.name);
|
|
607
|
+
console.debug("[DEBUG] When step completed:", this.name.toString());
|
|
486
608
|
return result;
|
|
487
609
|
} catch (e) {
|
|
488
|
-
console.error(
|
|
610
|
+
console.error(
|
|
611
|
+
"[ERROR] When step failed:",
|
|
612
|
+
this.name.toString(),
|
|
613
|
+
e.toString()
|
|
614
|
+
);
|
|
489
615
|
this.error = e;
|
|
490
616
|
throw e;
|
|
491
617
|
}
|
|
@@ -493,6 +619,7 @@ var BaseWhen = class {
|
|
|
493
619
|
};
|
|
494
620
|
var BaseThen = class {
|
|
495
621
|
constructor(name, thenCB) {
|
|
622
|
+
this.artifacts = [];
|
|
496
623
|
this.name = name;
|
|
497
624
|
this.thenCB = thenCB;
|
|
498
625
|
this.error = false;
|
|
@@ -500,15 +627,19 @@ var BaseThen = class {
|
|
|
500
627
|
toObj() {
|
|
501
628
|
return {
|
|
502
629
|
name: this.name,
|
|
503
|
-
error: this.error
|
|
630
|
+
error: this.error,
|
|
631
|
+
artifacts: this.artifacts
|
|
504
632
|
};
|
|
505
633
|
}
|
|
506
634
|
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
635
|
+
const proxiedPm = butThenProxy(pm, filepath);
|
|
636
|
+
console.log(`[Then] Setting currentStep for butThen:`, this.name);
|
|
637
|
+
proxiedPm.currentStep = this;
|
|
507
638
|
return this.butThen(
|
|
508
639
|
store,
|
|
509
640
|
async (s) => {
|
|
510
641
|
if (typeof this.thenCB === "function") {
|
|
511
|
-
return await this.thenCB(s);
|
|
642
|
+
return await this.thenCB(s, proxiedPm);
|
|
512
643
|
} else {
|
|
513
644
|
return this.thenCB;
|
|
514
645
|
}
|