testeranto 0.140.2 → 0.143.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/.aider.chat.history.md +9173 -0
- package/.aider.input.history +336 -0
- package/.aider.tags.cache.v3/{ad/3c/10f2ab1397f6d544e613d2a6acaf.val → 3d/81/8b6f0e9b98ec2952cdb8968ac386.val} +0 -0
- package/.aider.tags.cache.v3/63/f1/138061b0aadb868173d197c2a0e0.val +0 -0
- package/.aider.tags.cache.v3/be/72/19ee8e656d160afe9b31523245fe.val +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/.aider.tags.cache.v3/{a7/97/6d37fce350ad2d588f36729db0cd.val → d6/7d/1820c2d4b9330eab7017da4515e7.val} +0 -0
- package/docs/aiderTest.sh +1 -0
- package/docs/testing.ai.txt +98 -0
- package/docs/testing.prompt.txt +8 -0
- package/package.json +3 -3
- package/src/PM/PM_WithEslintAndTsc.ts +35 -21
- package/src/Pure.test.ts +299 -0
- package/src/lib/BaseSuite.test.ts +24 -5
- package/src/lib/abstractBase.test/MockGiven.ts +31 -0
- package/src/lib/abstractBase.test/MockThen.ts +20 -0
- package/src/lib/abstractBase.test/MockWhen.ts +17 -0
- package/src/lib/abstractBase.test/implementation.ts +51 -0
- package/src/lib/abstractBase.test/index.ts +19 -0
- package/src/lib/abstractBase.test/interface.ts +12 -0
- package/src/lib/abstractBase.test/specification.ts +49 -0
- package/src/lib/abstractBase.test/types.ts +19 -0
- package/src/lib/baseBuilder.test/TestBaseBuilder.ts +83 -0
- package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +133 -0
- package/src/lib/baseBuilder.test/baseBuilder.test.interface.ts +18 -0
- package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +35 -0
- package/src/lib/baseBuilder.test/baseBuilder.test.ts +13 -0
- package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +36 -0
- package/src/lib/classBuilder.test/TestClassBuilder.ts +88 -0
- package/src/lib/classBuilder.test/classBuilder.test.implementation.ts +200 -0
- package/src/lib/classBuilder.test/classBuilder.test.interface.ts +17 -0
- package/src/lib/classBuilder.test/classBuilder.test.specification.ts +112 -0
- package/src/lib/classBuilder.test/classBuilder.test.ts +14 -0
- package/src/lib/classBuilder.test/classBuilder.test.types.ts +72 -0
- package/src/lib/core.test/MockCore.ts +49 -0
- package/src/lib/core.test/core.test.implementation.ts +129 -0
- package/src/lib/core.test/core.test.interface.ts +18 -0
- package/src/lib/core.test/core.test.specification.ts +99 -0
- package/src/lib/core.test/core.test.ts +15 -0
- package/src/lib/core.test/core.test.types.ts +68 -0
- package/src/lib/core.ts +1 -1
- package/src/lib/pmProxy.test/implementation.ts +104 -0
- package/src/lib/pmProxy.test/index.ts +19 -0
- package/src/lib/pmProxy.test/interface.ts +47 -0
- package/src/lib/pmProxy.test/mockPM.ts +38 -0
- package/src/lib/pmProxy.test/mockPMBase.ts +136 -0
- package/src/lib/pmProxy.test/specification.ts +123 -0
- package/src/lib/pmProxy.test/types.ts +45 -0
- package/src/lib/pmProxy.ts +40 -193
- package/testeranto/bundles/node/allTests/chunk-2FXOXAKZ.mjs +800 -0
- package/testeranto/bundles/node/allTests/chunk-5MQGD4WC.mjs +251 -0
- package/testeranto/bundles/node/allTests/chunk-6CGAD2FD.mjs +800 -0
- package/testeranto/bundles/node/allTests/chunk-DWKHII32.mjs +800 -0
- package/testeranto/bundles/node/allTests/chunk-KYSOR62N.mjs +167 -0
- package/testeranto/bundles/node/allTests/chunk-PRPFVO6G.mjs +251 -0
- package/testeranto/bundles/node/allTests/chunk-RX4SUFXQ.mjs +251 -0
- package/testeranto/bundles/node/allTests/chunk-UED26IMH.mjs +802 -0
- package/testeranto/bundles/node/allTests/chunk-VAAIAWXC.mjs +117 -0
- package/testeranto/bundles/node/allTests/chunk-W44DUDBK.mjs +251 -0
- package/testeranto/bundles/node/allTests/chunk-YI3EGRMQ.mjs +167 -0
- package/testeranto/bundles/node/allTests/metafile.json +1072 -222
- package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +2 -1
- package/testeranto/bundles/node/allTests/src/PM/__tests__/pureSidecar.testeranto.mjs +2 -1
- package/testeranto/bundles/node/allTests/src/PM/__tests__/webSidecar.testeranto.mjs +2 -1
- package/testeranto/bundles/node/allTests/src/Pure.test.mjs +261 -0
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +22 -4
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.mjs +226 -0
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +406 -0
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +279 -0
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +4479 -0
- package/testeranto/bundles/node/allTests/src/mothership/test.mjs +4 -2
- package/testeranto/reports/allTests/config.json +40 -1
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/log.txt +0 -0
- package/testeranto/reports/allTests/src/Pure.test/node/console_log.txt +17 -0
- package/testeranto/reports/allTests/src/Pure.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/Pure.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/Pure.test/node/lint_errors.json +134 -0
- package/testeranto/reports/allTests/src/Pure.test/node/message +1 -0
- package/testeranto/reports/allTests/src/Pure.test/node/prompt.txt +7 -0
- package/testeranto/reports/allTests/src/Pure.test/node/type_errors.txt +26 -0
- package/testeranto/reports/allTests/src/lib/BaseGiven.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseGiven.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +27 -27
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +104 -104
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +47 -22
- package/testeranto/reports/allTests/src/lib/BaseThen.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseThen.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/abstractBase/index/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/abstractBase/index/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/console_log.txt +12 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/lint_errors.json +966 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/prompt.txt +11 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/type_errors.txt +52 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/console_log.txt +17 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +771 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +11 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +67 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/console_log.txt +17 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.json +416 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +11 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +54 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/console_log.txt +43 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.json +319 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/log.txt +0 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +10 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +64 -0
- package/testeranto/reports/allTests/src/mothership/test/node/console_log.txt +44 -0
- package/testeranto/reports/allTests/src/mothership/test/node/log.txt +0 -0
- package/testeranto/reports/allTests/summary.json +76 -6
- package/testeranto/reportsnode_build_errors +12 -0
- package/testeranto.config.ts +19 -2
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/lib/pmProxy.test/mockPMBase.ts
|
|
4
|
+
var MockPMBase = class {
|
|
5
|
+
constructor(configs) {
|
|
6
|
+
this.calls = {};
|
|
7
|
+
this.testResourceConfiguration = {};
|
|
8
|
+
this.configs = configs || {};
|
|
9
|
+
}
|
|
10
|
+
// Common tracking functionality
|
|
11
|
+
trackCall(method, args) {
|
|
12
|
+
if (!this.calls[method]) {
|
|
13
|
+
this.calls[method] = [];
|
|
14
|
+
}
|
|
15
|
+
this.calls[method].push(args);
|
|
16
|
+
}
|
|
17
|
+
getCallCount(method) {
|
|
18
|
+
return this.calls[method]?.length || 0;
|
|
19
|
+
}
|
|
20
|
+
getLastCall(method) {
|
|
21
|
+
const calls = this.calls[method];
|
|
22
|
+
return calls ? calls[calls.length - 1] : null;
|
|
23
|
+
}
|
|
24
|
+
// Minimal implementations of required methods
|
|
25
|
+
launchSideCar(n, testName, projectName) {
|
|
26
|
+
this.trackCall("launchSideCar", { n, testName, projectName });
|
|
27
|
+
return Promise.resolve();
|
|
28
|
+
}
|
|
29
|
+
end(uid) {
|
|
30
|
+
this.trackCall("end", { uid });
|
|
31
|
+
return Promise.resolve(true);
|
|
32
|
+
}
|
|
33
|
+
writeFileSync(path, content, testName) {
|
|
34
|
+
this.trackCall("writeFileSync", { path, content, testName });
|
|
35
|
+
return Promise.resolve(true);
|
|
36
|
+
}
|
|
37
|
+
createWriteStream(path, testName) {
|
|
38
|
+
this.trackCall("createWriteStream", { path, testName });
|
|
39
|
+
return Promise.resolve(0);
|
|
40
|
+
}
|
|
41
|
+
screencast(opts, testName, page) {
|
|
42
|
+
this.trackCall("screencast", { opts, testName, page });
|
|
43
|
+
return Promise.resolve({});
|
|
44
|
+
}
|
|
45
|
+
customScreenShot(opts, testName, pageUid) {
|
|
46
|
+
this.trackCall("customScreenShot", { opts, testName, pageUid });
|
|
47
|
+
return Promise.resolve({});
|
|
48
|
+
}
|
|
49
|
+
testArtiFactoryfileWriter(tLog, callback) {
|
|
50
|
+
return (fPath, value) => {
|
|
51
|
+
this.trackCall("testArtiFactoryfileWriter", { fPath, value });
|
|
52
|
+
callback(Promise.resolve());
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// Other required PM_Base methods with minimal implementations
|
|
56
|
+
closePage(p) {
|
|
57
|
+
return Promise.resolve();
|
|
58
|
+
}
|
|
59
|
+
$(selector, p) {
|
|
60
|
+
return Promise.resolve();
|
|
61
|
+
}
|
|
62
|
+
click(selector, page) {
|
|
63
|
+
return Promise.resolve();
|
|
64
|
+
}
|
|
65
|
+
goto(p, url) {
|
|
66
|
+
return Promise.resolve();
|
|
67
|
+
}
|
|
68
|
+
newPage() {
|
|
69
|
+
return Promise.resolve("mock-page");
|
|
70
|
+
}
|
|
71
|
+
pages() {
|
|
72
|
+
return Promise.resolve(["mock-page"]);
|
|
73
|
+
}
|
|
74
|
+
waitForSelector(p, s) {
|
|
75
|
+
return Promise.resolve(true);
|
|
76
|
+
}
|
|
77
|
+
focusOn(selector, p) {
|
|
78
|
+
return Promise.resolve();
|
|
79
|
+
}
|
|
80
|
+
typeInto(value, p) {
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
getAttribute(selector, attribute, p) {
|
|
84
|
+
return Promise.resolve();
|
|
85
|
+
}
|
|
86
|
+
getInnerHtml(selector, p) {
|
|
87
|
+
return Promise.resolve();
|
|
88
|
+
}
|
|
89
|
+
isDisabled(selector, p) {
|
|
90
|
+
return Promise.resolve(false);
|
|
91
|
+
}
|
|
92
|
+
screencastStop(s) {
|
|
93
|
+
return Promise.resolve();
|
|
94
|
+
}
|
|
95
|
+
existsSync(destFolder) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
mkdirSync(fp) {
|
|
99
|
+
return Promise.resolve();
|
|
100
|
+
}
|
|
101
|
+
write(uid, contents) {
|
|
102
|
+
return Promise.resolve(true);
|
|
103
|
+
}
|
|
104
|
+
page(p) {
|
|
105
|
+
return "mock-page";
|
|
106
|
+
}
|
|
107
|
+
doInPage(p, cb) {
|
|
108
|
+
return Promise.resolve();
|
|
109
|
+
}
|
|
110
|
+
customclose() {
|
|
111
|
+
return Promise.resolve();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
MockPMBase
|
|
117
|
+
};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
PM,
|
|
4
|
+
TesterantoCore,
|
|
5
|
+
defaultTestResourceRequirement
|
|
6
|
+
} from "./chunk-UED26IMH.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("DEPREFECATED");
|
|
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, testInterface) {
|
|
210
|
+
super(
|
|
211
|
+
input,
|
|
212
|
+
testSpecification,
|
|
213
|
+
testImplementation,
|
|
214
|
+
testResourceRequirement,
|
|
215
|
+
testInterface,
|
|
216
|
+
() => {
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
async receiveTestResourceConfig(partialTestResource) {
|
|
221
|
+
const t = JSON.parse(partialTestResource);
|
|
222
|
+
const pm = new PM_Node(t, ipcfile);
|
|
223
|
+
return await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
var testeranto = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
227
|
+
const t = new NodeTesteranto(
|
|
228
|
+
input,
|
|
229
|
+
testSpecification,
|
|
230
|
+
testImplementation,
|
|
231
|
+
testResourceRequirement,
|
|
232
|
+
testInterface
|
|
233
|
+
);
|
|
234
|
+
process.on("unhandledRejection", (reason, promise) => {
|
|
235
|
+
console.error("Unhandled Rejection at:", promise, "reason:", reason);
|
|
236
|
+
});
|
|
237
|
+
try {
|
|
238
|
+
ipcfile = process.argv[3];
|
|
239
|
+
const f = await t.receiveTestResourceConfig(process.argv[2]);
|
|
240
|
+
console.error("goodbye node with failures", f.fails);
|
|
241
|
+
process.exit(f.fails);
|
|
242
|
+
} catch (e) {
|
|
243
|
+
console.error("goodbye node with caught error", e);
|
|
244
|
+
process.exit(-1);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
var Node_default = testeranto;
|
|
248
|
+
|
|
249
|
+
export {
|
|
250
|
+
Node_default
|
|
251
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
PM,
|
|
4
|
+
Testeranto,
|
|
5
|
+
defaultTestResourceRequirement
|
|
6
|
+
} from "./chunk-6CGAD2FD.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 Testeranto {
|
|
138
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
139
|
+
super(
|
|
140
|
+
input,
|
|
141
|
+
testSpecification,
|
|
142
|
+
testImplementation,
|
|
143
|
+
testResourceRequirement,
|
|
144
|
+
testInterface,
|
|
145
|
+
() => {
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
async receiveTestResourceConfig(partialTestResource) {
|
|
150
|
+
const t = JSON.parse(partialTestResource);
|
|
151
|
+
const pm = new PM_Pure(t);
|
|
152
|
+
return await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var Pure_default = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
156
|
+
return new PureTesteranto(
|
|
157
|
+
input,
|
|
158
|
+
testSpecification,
|
|
159
|
+
testImplementation,
|
|
160
|
+
testResourceRequirement,
|
|
161
|
+
testInterface
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
Pure_default
|
|
167
|
+
};
|