testeranto 0.167.0 → 0.171.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.js +541 -495
- 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 +3 -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 +3 -2
- 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.js +541 -495
- 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 +34 -34
- 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 +2 -2
- 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 +57 -27
- 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-TU3MJSSI.mjs → chunk-RLDR6LJN.mjs} +302 -127
- package/testeranto/bundles/web/allTests/{chunk-46E6YGGN.mjs → chunk-U7AW26HL.mjs} +292 -142
- package/testeranto/bundles/web/allTests/metafile.json +15062 -43
- 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 +21 -36
- 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/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/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
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
BaseGiven,
|
|
4
|
-
BaseSuite,
|
|
5
|
-
BaseThen,
|
|
6
|
-
BaseWhen
|
|
7
|
-
} from "./chunk-IDCUSTSM.mjs";
|
|
8
|
-
|
|
9
|
-
// src/lib/BaseSuite.test/mock.ts
|
|
10
|
-
var MockGiven = class extends BaseGiven {
|
|
11
|
-
constructor(name, features, whens, thens) {
|
|
12
|
-
super(
|
|
13
|
-
name,
|
|
14
|
-
features,
|
|
15
|
-
whens,
|
|
16
|
-
thens,
|
|
17
|
-
async () => ({ testStore: true, testSelection: false }),
|
|
18
|
-
// givenCB
|
|
19
|
-
{}
|
|
20
|
-
// initialValues
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
async givenThat() {
|
|
24
|
-
return { testStore: true, testSelection: false };
|
|
25
|
-
}
|
|
26
|
-
uberCatcher(e) {
|
|
27
|
-
console.error("Given error 2:", e);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var MockWhen = class extends BaseWhen {
|
|
31
|
-
async andWhen(store, whenCB, testResource, pm) {
|
|
32
|
-
console.log(
|
|
33
|
-
"[DEBUG] MockWhen - andWhen - input store:",
|
|
34
|
-
JSON.stringify(store)
|
|
35
|
-
);
|
|
36
|
-
const newStore = {
|
|
37
|
-
...store,
|
|
38
|
-
testSelection: true
|
|
39
|
-
// Ensure testSelection is set for assertions
|
|
40
|
-
};
|
|
41
|
-
console.log("[DEBUG] MockWhen - andWhen - calling whenCB");
|
|
42
|
-
const result = await whenCB(newStore);
|
|
43
|
-
console.log("[DEBUG] MockWhen - andWhen - result:", JSON.stringify(result));
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
addArtifact(name, content) {
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var MockThen = class extends BaseThen {
|
|
51
|
-
async butThen(store, thenCB, testResourceConfiguration, pm) {
|
|
52
|
-
console.log(
|
|
53
|
-
"[DEBUG] MockThen - butThen - input store:",
|
|
54
|
-
JSON.stringify(store)
|
|
55
|
-
);
|
|
56
|
-
if (!store) {
|
|
57
|
-
throw new Error("Store is undefined in butThen");
|
|
58
|
-
}
|
|
59
|
-
const testSelection = {
|
|
60
|
-
name: store.name,
|
|
61
|
-
index: store.index,
|
|
62
|
-
testSelection: store.testSelection || false,
|
|
63
|
-
error: store.error ? true : void 0
|
|
64
|
-
};
|
|
65
|
-
console.log(
|
|
66
|
-
"[DEBUG] MockThen - passing testSelection:",
|
|
67
|
-
JSON.stringify(testSelection)
|
|
68
|
-
);
|
|
69
|
-
try {
|
|
70
|
-
const result = await thenCB(testSelection);
|
|
71
|
-
console.log(
|
|
72
|
-
"[DEBUG] MockThen - received result:",
|
|
73
|
-
JSON.stringify(result)
|
|
74
|
-
);
|
|
75
|
-
if (!result || typeof result.testSelection === "undefined") {
|
|
76
|
-
throw new Error(
|
|
77
|
-
`Invalid test selection result: ${JSON.stringify(result)}`
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
return result;
|
|
81
|
-
} catch (e) {
|
|
82
|
-
console.error("[ERROR] MockThen - butThen failed:", e);
|
|
83
|
-
throw e;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
var MockSuite = class extends BaseSuite {
|
|
88
|
-
constructor(name, index) {
|
|
89
|
-
if (!name) {
|
|
90
|
-
throw new Error("MockSuite requires a non-empty name");
|
|
91
|
-
}
|
|
92
|
-
console.log("[DEBUG] Creating MockSuite with name:", name, "index:", index);
|
|
93
|
-
const suiteName = name || "testSuite";
|
|
94
|
-
super(suiteName, index, {
|
|
95
|
-
testGiven: new MockGiven(
|
|
96
|
-
"testGiven",
|
|
97
|
-
["testFeature"],
|
|
98
|
-
[new MockWhen("testWhen", () => Promise.resolve({ testStore: true }))],
|
|
99
|
-
[
|
|
100
|
-
new MockThen(
|
|
101
|
-
"testThen",
|
|
102
|
-
async () => Promise.resolve({ testSelection: true })
|
|
103
|
-
)
|
|
104
|
-
]
|
|
105
|
-
)
|
|
106
|
-
});
|
|
107
|
-
console.log("[DEBUG] MockSuite created:", this.name, this.index);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export {
|
|
112
|
-
MockSuite
|
|
113
|
-
};
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PM,
|
|
4
|
-
TesterantoCore,
|
|
5
|
-
defaultTestResourceRequirement
|
|
6
|
-
} from "./chunk-IDCUSTSM.mjs";
|
|
7
|
-
|
|
8
|
-
// src/PM/node.ts
|
|
9
|
-
import net from "net";
|
|
10
|
-
import fs from "fs";
|
|
11
|
-
import path from "path";
|
|
12
|
-
var fPaths = [];
|
|
13
|
-
var PM_Node = class extends PM {
|
|
14
|
-
constructor(t, ipcFile) {
|
|
15
|
-
super();
|
|
16
|
-
this.testResourceConfiguration = t;
|
|
17
|
-
this.client = net.createConnection(ipcFile, () => {
|
|
18
|
-
return;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
start() {
|
|
22
|
-
throw new Error("DEPRECATED");
|
|
23
|
-
}
|
|
24
|
-
stop() {
|
|
25
|
-
throw new Error("stop not implemented.");
|
|
26
|
-
}
|
|
27
|
-
send(command, ...argz) {
|
|
28
|
-
const key = Math.random().toString();
|
|
29
|
-
if (!this.client) {
|
|
30
|
-
console.error(
|
|
31
|
-
`Tried to send "${command} (${argz})" but the test has not been started and the IPC client is not established. Exiting as failure!`
|
|
32
|
-
);
|
|
33
|
-
process.exit(-1);
|
|
34
|
-
}
|
|
35
|
-
return new Promise((res) => {
|
|
36
|
-
const myListener = (event) => {
|
|
37
|
-
const x = JSON.parse(event);
|
|
38
|
-
if (x.key === key) {
|
|
39
|
-
process.removeListener("message", myListener);
|
|
40
|
-
res(x.payload);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
process.addListener("message", myListener);
|
|
44
|
-
this.client.write(JSON.stringify([command, ...argz, key]));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
async launchSideCar(n) {
|
|
48
|
-
return this.send(
|
|
49
|
-
"launchSideCar",
|
|
50
|
-
n,
|
|
51
|
-
this.testResourceConfiguration.name
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
stopSideCar(n) {
|
|
55
|
-
return this.send(
|
|
56
|
-
"stopSideCar",
|
|
57
|
-
n,
|
|
58
|
-
this.testResourceConfiguration.name
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
async pages() {
|
|
62
|
-
return this.send("pages", ...arguments);
|
|
63
|
-
}
|
|
64
|
-
waitForSelector(p, s) {
|
|
65
|
-
return this.send("waitForSelector", ...arguments);
|
|
66
|
-
}
|
|
67
|
-
closePage(p) {
|
|
68
|
-
return this.send("closePage", ...arguments);
|
|
69
|
-
}
|
|
70
|
-
goto(page, url) {
|
|
71
|
-
return this.send("goto", ...arguments);
|
|
72
|
-
}
|
|
73
|
-
async newPage() {
|
|
74
|
-
return this.send("newPage");
|
|
75
|
-
}
|
|
76
|
-
$(selector, page) {
|
|
77
|
-
return this.send("$", ...arguments);
|
|
78
|
-
}
|
|
79
|
-
isDisabled(selector) {
|
|
80
|
-
return this.send("isDisabled", ...arguments);
|
|
81
|
-
}
|
|
82
|
-
getAttribute(selector, attribute, p) {
|
|
83
|
-
return this.send("getAttribute", ...arguments);
|
|
84
|
-
}
|
|
85
|
-
getInnerHtml(selector, p) {
|
|
86
|
-
return this.send("getInnerHtml", ...arguments);
|
|
87
|
-
}
|
|
88
|
-
// setValue(selector: string) {
|
|
89
|
-
// return this.send("getValue", ...arguments);
|
|
90
|
-
// }
|
|
91
|
-
focusOn(selector) {
|
|
92
|
-
return this.send("focusOn", ...arguments);
|
|
93
|
-
}
|
|
94
|
-
typeInto(selector) {
|
|
95
|
-
return this.send("typeInto", ...arguments);
|
|
96
|
-
}
|
|
97
|
-
page() {
|
|
98
|
-
return this.send("page");
|
|
99
|
-
}
|
|
100
|
-
click(selector) {
|
|
101
|
-
return this.send("click", ...arguments);
|
|
102
|
-
}
|
|
103
|
-
screencast(opts, page) {
|
|
104
|
-
return this.send(
|
|
105
|
-
"screencast",
|
|
106
|
-
{
|
|
107
|
-
...opts,
|
|
108
|
-
path: this.testResourceConfiguration.fs + "/" + opts.path
|
|
109
|
-
},
|
|
110
|
-
page,
|
|
111
|
-
this.testResourceConfiguration.name
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
screencastStop(p) {
|
|
115
|
-
return this.send("screencastStop", ...arguments);
|
|
116
|
-
}
|
|
117
|
-
customScreenShot(x, y) {
|
|
118
|
-
const opts = x[0];
|
|
119
|
-
const page = x[1];
|
|
120
|
-
return this.send(
|
|
121
|
-
"customScreenShot",
|
|
122
|
-
{
|
|
123
|
-
...opts,
|
|
124
|
-
path: this.testResourceConfiguration.fs + "/" + opts.path
|
|
125
|
-
},
|
|
126
|
-
this.testResourceConfiguration.name,
|
|
127
|
-
page
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
async existsSync(destFolder) {
|
|
131
|
-
return await this.send(
|
|
132
|
-
"existsSync",
|
|
133
|
-
this.testResourceConfiguration.fs + "/" + destFolder
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
mkdirSync() {
|
|
137
|
-
return this.send("mkdirSync", this.testResourceConfiguration.fs + "/");
|
|
138
|
-
}
|
|
139
|
-
async write(uid, contents) {
|
|
140
|
-
return await this.send("write", ...arguments);
|
|
141
|
-
}
|
|
142
|
-
async writeFileSync(filepath, contents) {
|
|
143
|
-
return await this.send(
|
|
144
|
-
"writeFileSync",
|
|
145
|
-
this.testResourceConfiguration.fs + "/" + filepath,
|
|
146
|
-
contents,
|
|
147
|
-
this.testResourceConfiguration.name
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
async createWriteStream(filepath) {
|
|
151
|
-
return await this.send(
|
|
152
|
-
"createWriteStream",
|
|
153
|
-
this.testResourceConfiguration.fs + "/" + filepath,
|
|
154
|
-
this.testResourceConfiguration.name
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
async end(uid) {
|
|
158
|
-
return await this.send("end", ...arguments);
|
|
159
|
-
}
|
|
160
|
-
async customclose() {
|
|
161
|
-
return await this.send(
|
|
162
|
-
"customclose",
|
|
163
|
-
this.testResourceConfiguration.fs,
|
|
164
|
-
this.testResourceConfiguration.name
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
testArtiFactoryfileWriter(tLog, callback) {
|
|
168
|
-
return (fPath, value) => {
|
|
169
|
-
callback(
|
|
170
|
-
new Promise((res, rej) => {
|
|
171
|
-
tLog("testArtiFactory =>", fPath);
|
|
172
|
-
const cleanPath = path.resolve(fPath);
|
|
173
|
-
fPaths.push(cleanPath.replace(process.cwd(), ``));
|
|
174
|
-
const targetDir = cleanPath.split("/").slice(0, -1).join("/");
|
|
175
|
-
fs.mkdir(targetDir, { recursive: true }, async (error) => {
|
|
176
|
-
if (error) {
|
|
177
|
-
console.error(`\u2757\uFE0FtestArtiFactory failed`, targetDir, error);
|
|
178
|
-
}
|
|
179
|
-
if (Buffer.isBuffer(value)) {
|
|
180
|
-
fs.writeFileSync(fPath, value, "binary");
|
|
181
|
-
res();
|
|
182
|
-
} else if (`string` === typeof value) {
|
|
183
|
-
fs.writeFileSync(fPath, value.toString(), {
|
|
184
|
-
encoding: "utf-8"
|
|
185
|
-
});
|
|
186
|
-
res();
|
|
187
|
-
} else {
|
|
188
|
-
const pipeStream = value;
|
|
189
|
-
const myFile = fs.createWriteStream(fPath);
|
|
190
|
-
pipeStream.pipe(myFile);
|
|
191
|
-
pipeStream.on("close", () => {
|
|
192
|
-
myFile.close();
|
|
193
|
-
res();
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
})
|
|
198
|
-
);
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
// launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
|
|
202
|
-
startPuppeteer(options) {
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
// src/Node.ts
|
|
207
|
-
var ipcfile;
|
|
208
|
-
var NodeTesteranto = class extends TesterantoCore {
|
|
209
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
|
|
210
|
-
super(
|
|
211
|
-
input,
|
|
212
|
-
testSpecification,
|
|
213
|
-
testImplementation,
|
|
214
|
-
testResourceRequirement,
|
|
215
|
-
testAdapter,
|
|
216
|
-
() => {
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
async receiveTestResourceConfig(partialTestResource) {
|
|
221
|
-
console.log("receiveTestResourceConfig", partialTestResource);
|
|
222
|
-
const t = JSON.parse(partialTestResource);
|
|
223
|
-
const pm = new PM_Node(t, ipcfile);
|
|
224
|
-
return await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
var testeranto = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
228
|
-
try {
|
|
229
|
-
const t = new NodeTesteranto(
|
|
230
|
-
input,
|
|
231
|
-
testSpecification,
|
|
232
|
-
testImplementation,
|
|
233
|
-
testResourceRequirement,
|
|
234
|
-
testAdapter
|
|
235
|
-
);
|
|
236
|
-
process.on("unhandledRejection", (reason, promise) => {
|
|
237
|
-
console.error("Unhandled Rejection at:", promise, "reason:", reason);
|
|
238
|
-
});
|
|
239
|
-
ipcfile = process.argv[3];
|
|
240
|
-
const f = await t.receiveTestResourceConfig(process.argv[2]);
|
|
241
|
-
console.error("goodbye node with failures", f.fails);
|
|
242
|
-
process.exit(f.fails);
|
|
243
|
-
} catch (e) {
|
|
244
|
-
console.error("goodbye node with caught error", e);
|
|
245
|
-
process.exit(-1);
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var Node_default = testeranto;
|
|
249
|
-
|
|
250
|
-
export {
|
|
251
|
-
Node_default
|
|
252
|
-
};
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PM,
|
|
4
|
-
TesterantoCore,
|
|
5
|
-
defaultTestResourceRequirement
|
|
6
|
-
} from "./chunk-QK4IXLF6.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, testAdapter) {
|
|
139
|
-
super(
|
|
140
|
-
input,
|
|
141
|
-
testSpecification,
|
|
142
|
-
testImplementation,
|
|
143
|
-
testResourceRequirement,
|
|
144
|
-
testAdapter,
|
|
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
|
-
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
|
-
try {
|
|
172
|
-
console.log("[DEBUG] Executing test job with PM:", pm);
|
|
173
|
-
const result = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
174
|
-
console.log("[DEBUG] Test job completed with result:", result);
|
|
175
|
-
return result;
|
|
176
|
-
} catch (e) {
|
|
177
|
-
console.error("[ERROR] Test job failed:", e);
|
|
178
|
-
return {
|
|
179
|
-
failed: true,
|
|
180
|
-
fails: 1,
|
|
181
|
-
artifacts: [],
|
|
182
|
-
logPromise: Promise.resolve(),
|
|
183
|
-
features: []
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
var Pure_default = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
189
|
-
return new PureTesteranto(
|
|
190
|
-
input,
|
|
191
|
-
testSpecification,
|
|
192
|
-
testImplementation,
|
|
193
|
-
testResourceRequirement,
|
|
194
|
-
testAdapter
|
|
195
|
-
);
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export {
|
|
199
|
-
Pure_default
|
|
200
|
-
};
|