testeranto 0.172.0 → 0.177.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 +5 -1
- package/dist/common/src/PM/main.js +57 -54
- package/dist/common/src/PM/node.js +4 -1
- package/dist/common/src/PM/pure.js +4 -1
- package/dist/common/src/PM/web.js +6 -3
- package/dist/common/src/Pure.js +0 -4
- package/dist/common/src/Pure.test.js +1 -1
- 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 +141 -0
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/common/src/esbuildConfigs/node.js +1 -3
- package/dist/common/src/lib/BaseSuite.js +13 -11
- package/dist/common/src/lib/abstractBase.js +39 -40
- 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 +13 -2
- package/dist/common/src/lib/core.js +1 -0
- package/dist/common/src/lib/pmProxy.js +215 -201
- package/dist/common/src/lib/pmProxy.test/adapter.js +2 -2
- package/dist/common/src/lib/pmProxy.test/implementation.js +1 -1
- package/dist/common/testeranto.config.js +47 -32
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/base.js +5 -1
- package/dist/module/src/PM/main.js +22 -19
- package/dist/module/src/PM/node.js +4 -1
- package/dist/module/src/PM/pure.js +4 -1
- package/dist/module/src/PM/web.js +6 -3
- package/dist/module/src/Pure.js +0 -4
- package/dist/module/src/Pure.test.js +1 -1
- 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 +134 -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/esbuildConfigs/node.js +1 -3
- package/dist/module/src/lib/BaseSuite.js +13 -11
- package/dist/module/src/lib/abstractBase.js +39 -40
- 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 +13 -2
- package/dist/module/src/lib/core.js +1 -0
- package/dist/module/src/lib/pmProxy.js +215 -201
- package/dist/module/src/lib/pmProxy.test/adapter.js +2 -2
- package/dist/module/src/lib/pmProxy.test/implementation.js +1 -1
- package/dist/module/testeranto.config.js +47 -32
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.js +3 -3
- package/dist/prebuild/ReportServer.mjs +21 -9
- package/dist/prebuild/build.mjs +1 -1
- package/dist/prebuild/run.mjs +27 -20
- package/dist/types/src/PM/base.d.ts +1 -1
- package/dist/types/src/PM/node.d.ts +1 -1
- package/dist/types/src/PM/pure.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 +1 -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/BaseSuite.d.ts +2 -0
- package/dist/types/src/lib/abstractBase.d.ts +5 -7
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +7 -4
- package/dist/types/src/lib/pmProxy.d.ts +3 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/PM/base.ts +7 -5
- package/src/PM/main.ts +26 -21
- package/src/PM/node.ts +6 -1
- package/src/PM/pure.ts +6 -1
- package/src/PM/web.ts +7 -3
- package/src/Pure.test.ts +6 -6
- package/src/Pure.ts +0 -8
- package/src/ReportServer.test.ts/index.ts +194 -0
- package/src/ReportServer.ts +2 -132
- package/src/ReportServerLib.ts +147 -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/esbuildConfigs/node.ts +1 -1
- package/src/lib/BaseSuite.ts +16 -21
- package/src/lib/abstractBase.ts +59 -48
- 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 +13 -4
- package/src/lib/core.ts +1 -0
- package/src/lib/pmProxy.test/adapter.ts +2 -2
- package/src/lib/pmProxy.test/implementation.ts +3 -3
- package/src/lib/pmProxy.test/types.ts +0 -2
- package/src/lib/pmProxy.ts +135 -80
- package/testeranto/App.js +3 -3
- package/testeranto/bundles/node/core/metafile.json +8 -0
- package/testeranto/bundles/pure/core/metafile.json +8 -0
- package/testeranto/bundles/web/core/metafile.json +15086 -0
- package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.html +1 -1
- package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.mjs +4109 -1642
- package/testeranto/projects.json +1 -1
- package/testeranto/reports/core/config.json +24 -0
- package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +6 -1
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +59 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +27 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
- package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +15 -33
- package/testeranto/reports/core/summary.json +9 -0
- package/testeranto.config.ts +49 -32
- package/tsc.log +78 -92
- 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/metafile.json +0 -1229
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +0 -323
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -223
- 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/chunk-VMUSFSZM.mjs +0 -797
- package/testeranto/bundles/pure/allTests/metafile.json +0 -1054
- 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/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -381
- package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +0 -2283
- package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +0 -997
- package/testeranto/bundles/web/allTests/metafile.json +0 -25
- 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/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +0 -19
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -244
- package/testeranto/reports/allTests/config.json +0 -104
- 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/bdd_errors.txt +0 -1
- 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/lib/BaseSuite.test/node.test/node/bdd_errors.txt +0 -1
- 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/baseBuilder.test/baseBuilder.test.node/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -35
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -77
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -18
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -69
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -77
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -62
- 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/core.test/core.test/node/type_errors.txt +0 -63
- 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/reports/allTests/summary.json +0 -79
- package/testeranto/reportsnode_build_errors +0 -20
- package/testeranto/reportspure_build_errors +0 -343
- package/testeranto/reportsweb_build_errors +0 -25
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PM,
|
|
4
|
-
TesterantoCore,
|
|
5
|
-
defaultTestResourceRequirement
|
|
6
|
-
} from "../../../chunk-E75CSRER.mjs";
|
|
7
|
-
|
|
8
|
-
// src/PM/pure.ts
|
|
9
|
-
var PM_Pure = class extends PM {
|
|
10
|
-
constructor(t) {
|
|
11
|
-
super();
|
|
12
|
-
this.server = {};
|
|
13
|
-
this.testResourceConfiguration = t;
|
|
14
|
-
}
|
|
15
|
-
getInnerHtml(selector, page) {
|
|
16
|
-
throw new Error("pure.ts getInnHtml not implemented");
|
|
17
|
-
return Promise.resolve("");
|
|
18
|
-
}
|
|
19
|
-
stopSideCar(uid) {
|
|
20
|
-
throw new Error("pure.ts getInnHtml not implemented");
|
|
21
|
-
return Promise.resolve(true);
|
|
22
|
-
}
|
|
23
|
-
start() {
|
|
24
|
-
return new Promise((r) => r());
|
|
25
|
-
}
|
|
26
|
-
stop() {
|
|
27
|
-
return new Promise((r) => r());
|
|
28
|
-
}
|
|
29
|
-
launchSideCar(n) {
|
|
30
|
-
return globalThis["launchSideCar"](n, this.testResourceConfiguration.name);
|
|
31
|
-
}
|
|
32
|
-
pages() {
|
|
33
|
-
return globalThis["pages"]();
|
|
34
|
-
}
|
|
35
|
-
waitForSelector(p, s) {
|
|
36
|
-
return globalThis["waitForSelector"](p, s);
|
|
37
|
-
}
|
|
38
|
-
closePage(p) {
|
|
39
|
-
return globalThis["closePage"](p);
|
|
40
|
-
}
|
|
41
|
-
goto(cdpPage, url) {
|
|
42
|
-
return globalThis["goto"](cdpPage.mainFrame()._id, url);
|
|
43
|
-
}
|
|
44
|
-
newPage() {
|
|
45
|
-
return globalThis["newPage"]();
|
|
46
|
-
}
|
|
47
|
-
$(selector) {
|
|
48
|
-
return globalThis["$"](selector);
|
|
49
|
-
}
|
|
50
|
-
isDisabled(selector) {
|
|
51
|
-
return globalThis["isDisabled"](selector);
|
|
52
|
-
}
|
|
53
|
-
getAttribute(selector, attribute) {
|
|
54
|
-
return globalThis["getAttribute"](selector, attribute);
|
|
55
|
-
}
|
|
56
|
-
getValue(selector) {
|
|
57
|
-
return globalThis["getValue"](selector);
|
|
58
|
-
}
|
|
59
|
-
focusOn(selector) {
|
|
60
|
-
return globalThis["focusOn"](selector);
|
|
61
|
-
}
|
|
62
|
-
typeInto(selector, value) {
|
|
63
|
-
return globalThis["typeInto"](selector, value);
|
|
64
|
-
}
|
|
65
|
-
page() {
|
|
66
|
-
return globalThis["page"]();
|
|
67
|
-
}
|
|
68
|
-
click(selector) {
|
|
69
|
-
return globalThis["click"](selector);
|
|
70
|
-
}
|
|
71
|
-
screencast(opts, page) {
|
|
72
|
-
return globalThis["screencast"](
|
|
73
|
-
{
|
|
74
|
-
...opts,
|
|
75
|
-
path: this.testResourceConfiguration.fs + "/" + opts.path
|
|
76
|
-
},
|
|
77
|
-
page,
|
|
78
|
-
this.testResourceConfiguration.name
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
screencastStop(p) {
|
|
82
|
-
return globalThis["screencastStop"](p);
|
|
83
|
-
}
|
|
84
|
-
customScreenShot(opts, page) {
|
|
85
|
-
return globalThis["customScreenShot"](
|
|
86
|
-
{
|
|
87
|
-
...opts,
|
|
88
|
-
path: this.testResourceConfiguration.fs + "/" + opts.path
|
|
89
|
-
},
|
|
90
|
-
page,
|
|
91
|
-
this.testResourceConfiguration.name
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
existsSync(destFolder) {
|
|
95
|
-
return globalThis["existsSync"](
|
|
96
|
-
this.testResourceConfiguration.fs + "/" + destFolder
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
mkdirSync() {
|
|
100
|
-
return globalThis["mkdirSync"](this.testResourceConfiguration.fs + "/");
|
|
101
|
-
}
|
|
102
|
-
write(uid, contents) {
|
|
103
|
-
return globalThis["write"](uid, contents);
|
|
104
|
-
}
|
|
105
|
-
writeFileSync(filepath, contents) {
|
|
106
|
-
return globalThis["writeFileSync"](
|
|
107
|
-
this.testResourceConfiguration.fs + "/" + filepath,
|
|
108
|
-
contents,
|
|
109
|
-
this.testResourceConfiguration.name
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
createWriteStream(filepath) {
|
|
113
|
-
return globalThis["createWriteStream"](
|
|
114
|
-
this.testResourceConfiguration.fs + "/" + filepath,
|
|
115
|
-
this.testResourceConfiguration.name
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
end(uid) {
|
|
119
|
-
return globalThis["end"](uid);
|
|
120
|
-
}
|
|
121
|
-
customclose() {
|
|
122
|
-
globalThis["customclose"](
|
|
123
|
-
this.testResourceConfiguration.fs,
|
|
124
|
-
this.testResourceConfiguration.name
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
testArtiFactoryfileWriter(tLog, callback) {
|
|
128
|
-
}
|
|
129
|
-
// startPuppeteer(options?: any): any {
|
|
130
|
-
// // return puppeteer.connect(options).then((b) => {
|
|
131
|
-
// // this.browser = b;
|
|
132
|
-
// // });
|
|
133
|
-
// }
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// src/Pure.ts
|
|
137
|
-
var PureTesteranto = class extends TesterantoCore {
|
|
138
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter3) {
|
|
139
|
-
super(
|
|
140
|
-
input,
|
|
141
|
-
testSpecification,
|
|
142
|
-
testImplementation,
|
|
143
|
-
testResourceRequirement,
|
|
144
|
-
testAdapter3,
|
|
145
|
-
() => {
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
async receiveTestResourceConfig(partialTestResource) {
|
|
150
|
-
console.log(
|
|
151
|
-
"[DEBUG] receiveTestResourceConfig called with:",
|
|
152
|
-
partialTestResource
|
|
153
|
-
);
|
|
154
|
-
const t = JSON.parse(partialTestResource);
|
|
155
|
-
const pm = new PM_Pure(t);
|
|
156
|
-
try {
|
|
157
|
-
console.log("[DEBUG] Executing test job with PM:", pm);
|
|
158
|
-
const result = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
159
|
-
console.log("[DEBUG] Test job completed with result:", result);
|
|
160
|
-
return result;
|
|
161
|
-
} catch (e) {
|
|
162
|
-
console.error("[ERROR] Test job failed:", e);
|
|
163
|
-
return {
|
|
164
|
-
failed: true,
|
|
165
|
-
fails: -1,
|
|
166
|
-
artifacts: [],
|
|
167
|
-
// logPromise: Promise.resolve(),
|
|
168
|
-
features: []
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
var Pure_default = async (input, testSpecification, testImplementation, testAdapter3, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
174
|
-
return new PureTesteranto(
|
|
175
|
-
input,
|
|
176
|
-
testSpecification,
|
|
177
|
-
testImplementation,
|
|
178
|
-
testResourceRequirement,
|
|
179
|
-
testAdapter3
|
|
180
|
-
);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
// src/lib/core.test/core.test.specification.ts
|
|
184
|
-
var specification2 = (Suite, Given, When, Then) => {
|
|
185
|
-
const summary = {
|
|
186
|
-
suites: {
|
|
187
|
-
"Testeranto Core Functionality": {
|
|
188
|
-
features: {},
|
|
189
|
-
artifacts: []
|
|
190
|
-
},
|
|
191
|
-
"Testeranto Advanced Features": {
|
|
192
|
-
features: {},
|
|
193
|
-
artifacts: []
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
features: {},
|
|
197
|
-
artifacts: []
|
|
198
|
-
};
|
|
199
|
-
return [
|
|
200
|
-
Suite.Default(
|
|
201
|
-
"Testeranto Core Functionality",
|
|
202
|
-
summary.suites["Testeranto Core Functionality"],
|
|
203
|
-
{
|
|
204
|
-
// Initialization tests
|
|
205
|
-
defaultInitialization: Given.Default(
|
|
206
|
-
["Should initialize with default values"],
|
|
207
|
-
[],
|
|
208
|
-
[
|
|
209
|
-
Then.initializedProperly(),
|
|
210
|
-
Then.specsGenerated(),
|
|
211
|
-
Then.jobsCreated(),
|
|
212
|
-
Then.artifactsTracked()
|
|
213
|
-
]
|
|
214
|
-
),
|
|
215
|
-
customInputInitialization: Given.WithCustomInput(
|
|
216
|
-
{ test: "input" },
|
|
217
|
-
[],
|
|
218
|
-
[Then.initializedProperly()]
|
|
219
|
-
),
|
|
220
|
-
// Configuration tests
|
|
221
|
-
resourceConfig: Given.WithResourceRequirements(
|
|
222
|
-
{ ports: [3e3, 3001] },
|
|
223
|
-
[],
|
|
224
|
-
[Then.resourceRequirementsSet()]
|
|
225
|
-
),
|
|
226
|
-
interfaceConfig: Given.WithCustomAdapter(
|
|
227
|
-
{
|
|
228
|
-
assertThis: (x) => !!x,
|
|
229
|
-
beforeEach: async (s, i) => i()
|
|
230
|
-
},
|
|
231
|
-
[],
|
|
232
|
-
[Then.interfaceConfigured()]
|
|
233
|
-
),
|
|
234
|
-
// Core operations
|
|
235
|
-
specGeneration: Given.Default(
|
|
236
|
-
["Should generate test specs"],
|
|
237
|
-
[],
|
|
238
|
-
[Then.specsGenerated()]
|
|
239
|
-
),
|
|
240
|
-
jobCreation: Given.Default(
|
|
241
|
-
["Should create test jobs"],
|
|
242
|
-
[],
|
|
243
|
-
[Then.jobsCreated()]
|
|
244
|
-
),
|
|
245
|
-
artifactHandling: Given.Default(
|
|
246
|
-
["Should track artifacts"],
|
|
247
|
-
[When.addArtifact(Promise.resolve("test"))],
|
|
248
|
-
[Then.artifactsTracked()]
|
|
249
|
-
)
|
|
250
|
-
},
|
|
251
|
-
[]
|
|
252
|
-
),
|
|
253
|
-
Suite.ExtendedSuite("Testeranto Advanced Features", summary.suites["Testeranto Advanced Features"], {
|
|
254
|
-
// Error handling
|
|
255
|
-
errorPropagation: Given.Default(
|
|
256
|
-
["Should propagate errors properly"],
|
|
257
|
-
[When.triggerError("test error")],
|
|
258
|
-
[Then.errorThrown("test error")]
|
|
259
|
-
),
|
|
260
|
-
// Dynamic behavior
|
|
261
|
-
specModification: Given.Default(
|
|
262
|
-
["Should allow spec modification"],
|
|
263
|
-
[When.modifySpecs((specs) => [...specs, { name: "extra" }])],
|
|
264
|
-
[Then.specsModified(1)]
|
|
265
|
-
),
|
|
266
|
-
// Full lifecycle
|
|
267
|
-
testExecution: Given.Default(
|
|
268
|
-
["Should execute full test lifecycle"],
|
|
269
|
-
[],
|
|
270
|
-
[Then.testRunSuccessful()]
|
|
271
|
-
),
|
|
272
|
-
// Custom implementations
|
|
273
|
-
// Removed customImpl test since WithCustomImplementation isn't defined
|
|
274
|
-
dynamicSpecs: Given.Default(
|
|
275
|
-
["Should handle dynamic spec changes"],
|
|
276
|
-
[When.modifySpecs((specs) => specs)],
|
|
277
|
-
[Then.specsGenerated()]
|
|
278
|
-
)
|
|
279
|
-
})
|
|
280
|
-
];
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
// src/lib/core.test/MockCore.ts
|
|
284
|
-
var MockCore = class extends TesterantoCore {
|
|
285
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement = { ports: [] }, testAdapter3, uberCatcher = (cb) => cb()) {
|
|
286
|
-
console.log("[DEBUG] MockCore constructor starting...");
|
|
287
|
-
if (!testImplementation) {
|
|
288
|
-
throw new Error("testImplementation is required");
|
|
289
|
-
}
|
|
290
|
-
if (!testSpecification) {
|
|
291
|
-
console.warn(
|
|
292
|
-
"[WARN] testSpecification is null/undefined - tests may fail"
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
console.log("[DEBUG] MockCore constructor called with:");
|
|
296
|
-
console.log("- input:", JSON.stringify(input, null, 2));
|
|
297
|
-
console.log("- testSpecification keys:", Object.keys(testSpecification));
|
|
298
|
-
console.log("- testImplementation keys:", Object.keys(testImplementation));
|
|
299
|
-
console.log(
|
|
300
|
-
"- testResourceRequirement:",
|
|
301
|
-
JSON.stringify(testResourceRequirement)
|
|
302
|
-
);
|
|
303
|
-
console.log("- testAdapter keys:", Object.keys(testAdapter3));
|
|
304
|
-
const requiredMethods = ["suites", "givens", "whens", "thens"];
|
|
305
|
-
requiredMethods.forEach((method) => {
|
|
306
|
-
if (!testImplementation[method]) {
|
|
307
|
-
throw new Error(`Missing required implementation method: ${method}`);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
console.log("[DEBUG] Validation passed, calling super...");
|
|
311
|
-
super(
|
|
312
|
-
input,
|
|
313
|
-
testSpecification,
|
|
314
|
-
testImplementation,
|
|
315
|
-
testResourceRequirement,
|
|
316
|
-
testAdapter3,
|
|
317
|
-
uberCatcher
|
|
318
|
-
);
|
|
319
|
-
this.specs = [];
|
|
320
|
-
this.testJobs = [];
|
|
321
|
-
this.artifacts = [];
|
|
322
|
-
}
|
|
323
|
-
async receiveTestResourceConfig(partialTestResource) {
|
|
324
|
-
return {
|
|
325
|
-
failed: false,
|
|
326
|
-
fails: 0,
|
|
327
|
-
artifacts: [],
|
|
328
|
-
// logPromise: Promise.resolve(),
|
|
329
|
-
features: []
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
// src/lib/core.test/core.test.implementation.ts
|
|
335
|
-
var implementation = {
|
|
336
|
-
suites: {
|
|
337
|
-
Default: "Testeranto test suite",
|
|
338
|
-
ExtendedSuite: "Extended Testeranto test suite"
|
|
339
|
-
},
|
|
340
|
-
givens: {
|
|
341
|
-
Default: () => {
|
|
342
|
-
console.log("[DEBUG] Creating Default MockCore instance");
|
|
343
|
-
const input = { debug: true };
|
|
344
|
-
const resourceReq = { ports: [3e3] };
|
|
345
|
-
console.log("[DEBUG] Default Given - input:", input);
|
|
346
|
-
console.log("[DEBUG] Default Given - resourceReq:", resourceReq);
|
|
347
|
-
try {
|
|
348
|
-
const instance = new MockCore(
|
|
349
|
-
input,
|
|
350
|
-
specification,
|
|
351
|
-
implementation,
|
|
352
|
-
resourceReq,
|
|
353
|
-
testAdapter,
|
|
354
|
-
(cb) => cb()
|
|
355
|
-
);
|
|
356
|
-
console.log("[DEBUG] MockCore instance created successfully:", instance);
|
|
357
|
-
return instance;
|
|
358
|
-
} catch (e) {
|
|
359
|
-
console.error("[ERROR] Failed to create MockCore:", e);
|
|
360
|
-
throw e;
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
WithCustomInput: (input) => {
|
|
364
|
-
return new MockCore(
|
|
365
|
-
input,
|
|
366
|
-
specification,
|
|
367
|
-
implementation,
|
|
368
|
-
{ ports: [] },
|
|
369
|
-
testAdapter,
|
|
370
|
-
(cb) => cb()
|
|
371
|
-
);
|
|
372
|
-
},
|
|
373
|
-
WithResourceRequirements: (requirements) => {
|
|
374
|
-
return new MockCore(
|
|
375
|
-
{},
|
|
376
|
-
specification,
|
|
377
|
-
implementation,
|
|
378
|
-
requirements,
|
|
379
|
-
testAdapter,
|
|
380
|
-
(cb) => cb()
|
|
381
|
-
);
|
|
382
|
-
},
|
|
383
|
-
WithCustomAdapter: (customAdapter) => {
|
|
384
|
-
return new MockCore(
|
|
385
|
-
{},
|
|
386
|
-
specification,
|
|
387
|
-
implementation,
|
|
388
|
-
{ ports: [] },
|
|
389
|
-
{ ...testAdapter, ...customAdapter },
|
|
390
|
-
(cb) => cb()
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
whens: {
|
|
395
|
-
addArtifact: (artifact) => (builder) => {
|
|
396
|
-
builder.artifacts.push(artifact);
|
|
397
|
-
return builder;
|
|
398
|
-
},
|
|
399
|
-
setTestJobs: (jobs) => (builder) => {
|
|
400
|
-
builder.testJobs = jobs;
|
|
401
|
-
return builder;
|
|
402
|
-
},
|
|
403
|
-
modifySpecs: (modifier) => (builder) => {
|
|
404
|
-
console.log("Modifying specs - current count:", builder.specs?.length);
|
|
405
|
-
const newSpecs = modifier(builder.specs || []);
|
|
406
|
-
console.log("Modifying specs - new count:", newSpecs.length);
|
|
407
|
-
builder.specs = newSpecs;
|
|
408
|
-
return builder;
|
|
409
|
-
},
|
|
410
|
-
triggerError: (message) => (builder) => {
|
|
411
|
-
throw new Error(message);
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
thens: {
|
|
415
|
-
initializedProperly: () => (builder) => {
|
|
416
|
-
if (!builder) {
|
|
417
|
-
throw new Error("Builder is undefined");
|
|
418
|
-
}
|
|
419
|
-
if (!(builder instanceof MockCore)) {
|
|
420
|
-
throw new Error(`Builder is not MockCore (got ${builder.constructor.name})`);
|
|
421
|
-
}
|
|
422
|
-
if (!builder.testResourceRequirement) {
|
|
423
|
-
throw new Error("testResourceRequirement not set");
|
|
424
|
-
}
|
|
425
|
-
if (!builder.testAdapter) {
|
|
426
|
-
throw new Error("testAdapter not set");
|
|
427
|
-
}
|
|
428
|
-
return builder;
|
|
429
|
-
},
|
|
430
|
-
specsGenerated: () => (builder) => {
|
|
431
|
-
if (!Array.isArray(builder.specs)) {
|
|
432
|
-
throw new Error("Specs were not generated");
|
|
433
|
-
}
|
|
434
|
-
return builder;
|
|
435
|
-
},
|
|
436
|
-
jobsCreated: () => (builder) => {
|
|
437
|
-
if (!Array.isArray(builder.testJobs)) {
|
|
438
|
-
throw new Error("Test jobs were not created");
|
|
439
|
-
}
|
|
440
|
-
return builder;
|
|
441
|
-
},
|
|
442
|
-
artifactsTracked: () => (builder) => {
|
|
443
|
-
if (!Array.isArray(builder.artifacts)) {
|
|
444
|
-
throw new Error("Artifacts array not initialized");
|
|
445
|
-
}
|
|
446
|
-
return builder;
|
|
447
|
-
},
|
|
448
|
-
resourceRequirementsSet: () => (builder) => {
|
|
449
|
-
if (!builder.testResourceRequirement) {
|
|
450
|
-
throw new Error("Resource requirements not set");
|
|
451
|
-
}
|
|
452
|
-
return builder;
|
|
453
|
-
},
|
|
454
|
-
interfaceConfigured: () => (builder) => {
|
|
455
|
-
if (!builder.testAdapter) {
|
|
456
|
-
throw new Error("Test adapter not configured");
|
|
457
|
-
}
|
|
458
|
-
return builder;
|
|
459
|
-
},
|
|
460
|
-
errorThrown: (expectedMessage) => (builder) => {
|
|
461
|
-
return builder;
|
|
462
|
-
},
|
|
463
|
-
testRunSuccessful: () => async (builder) => {
|
|
464
|
-
try {
|
|
465
|
-
await builder.receiveTestResourceConfig("");
|
|
466
|
-
return builder;
|
|
467
|
-
} catch (e) {
|
|
468
|
-
throw new Error(`Test run failed: ${e.message}`);
|
|
469
|
-
}
|
|
470
|
-
},
|
|
471
|
-
specsModified: (expectedCount) => (builder) => {
|
|
472
|
-
if (!builder.specs || builder.specs.length !== expectedCount) {
|
|
473
|
-
throw new Error(
|
|
474
|
-
`Expected ${expectedCount} specs, got ${builder.specs?.length}`
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
return builder;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
// src/lib/core.test/core.test.adapter.ts
|
|
483
|
-
var testAdapter2 = {
|
|
484
|
-
beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
|
|
485
|
-
console.log("[DEBUG] BeforeEach - subject:", subject);
|
|
486
|
-
console.log("[DEBUG] BeforeEach - initialValues:", initialValues);
|
|
487
|
-
console.log("[DEBUG] BeforeEach called with:");
|
|
488
|
-
console.log("- subject type:", typeof subject);
|
|
489
|
-
console.log("- testResource:", JSON.stringify(testResource, null, 2));
|
|
490
|
-
console.log("- initialValues:", initialValues);
|
|
491
|
-
try {
|
|
492
|
-
const result = await initializer();
|
|
493
|
-
if (!result) {
|
|
494
|
-
throw new Error("Initializer returned undefined");
|
|
495
|
-
}
|
|
496
|
-
if (!(result instanceof MockCore)) {
|
|
497
|
-
throw new Error(`Initializer returned ${result?.constructor?.name}, expected MockCore`);
|
|
498
|
-
}
|
|
499
|
-
console.log("[DEBUG] BeforeEach initialized MockCore successfully");
|
|
500
|
-
return result;
|
|
501
|
-
} catch (e) {
|
|
502
|
-
console.error("[ERROR] BeforeEach failed:", e);
|
|
503
|
-
throw e;
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
andWhen: async (store, whenCB, testResource, pm) => {
|
|
507
|
-
return whenCB(store, pm);
|
|
508
|
-
},
|
|
509
|
-
butThen: async (store, thenCB, testResource, pm) => {
|
|
510
|
-
return thenCB(store, pm);
|
|
511
|
-
},
|
|
512
|
-
afterEach: (store) => store,
|
|
513
|
-
afterAll: (store, pm) => {
|
|
514
|
-
},
|
|
515
|
-
assertThis: (result) => !!result,
|
|
516
|
-
beforeAll: async (input, testResource, pm) => input
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
// src/lib/core.test/core.test.ts
|
|
520
|
-
var core_test_default = Pure_default(
|
|
521
|
-
MockCore.prototype,
|
|
522
|
-
specification2,
|
|
523
|
-
implementation,
|
|
524
|
-
testAdapter2
|
|
525
|
-
);
|
|
526
|
-
export {
|
|
527
|
-
core_test_default as default
|
|
528
|
-
};
|