testeranto 0.62.0 → 0.73.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 +38 -26
- package/dist/cjs-shim.js +2 -2
- package/dist/common/Node.js +14 -51
- package/dist/common/PM/index.js +71 -0
- package/dist/common/PM/main.js +361 -0
- package/dist/common/PM/node.js +176 -0
- package/dist/common/PM/web.js +174 -0
- package/dist/common/Project.js +121 -266
- package/dist/common/Puppeteer.js +109 -0
- package/dist/common/Reporter.js +119 -0
- package/dist/common/Scheduler.js +1 -0
- package/dist/common/SubPackages/puppeteer.js +3 -1
- package/dist/common/SubPackages/react-dom/component/web.js +98 -45
- package/dist/common/SubPackages/react-dom/jsx/web.js +15 -7
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +1 -1
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +1 -1
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +1 -3
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +1 -1
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +1 -1
- package/dist/common/Types.js +2 -32
- package/dist/common/Web.js +25 -37
- package/dist/common/esbuildConfigs/index.js +5 -5
- package/dist/common/esbuildConfigs/node.js +17 -15
- package/dist/common/esbuildConfigs/report.js +12 -47
- package/dist/common/esbuildConfigs/tests.js +0 -1
- package/dist/common/esbuildConfigs/web.js +17 -12
- package/dist/common/lib/abstractBase.js +190 -35
- package/dist/common/lib/basebuilder.js +56 -29
- package/dist/common/lib/classBuilder.js +8 -5
- package/dist/common/lib/core.js +42 -17
- package/dist/common/lib/index.js +11 -8
- package/dist/common/lib/types.js +2 -0
- package/dist/common/preload.js +14 -28
- package/dist/common/puppeteerConfiger.js +24 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Node.js +14 -51
- package/dist/module/PM/index.js +67 -0
- package/dist/module/PM/main.js +331 -0
- package/dist/module/PM/node.js +168 -0
- package/dist/module/PM/web.js +167 -0
- package/dist/module/Project.js +122 -267
- package/dist/module/Puppeteer.js +104 -0
- package/dist/module/Reporter.js +114 -0
- package/dist/module/Scheduler.js +1 -0
- package/dist/module/SubPackages/puppeteer.js +3 -1
- package/dist/module/SubPackages/react/jsx/node.js +1 -1
- package/dist/module/SubPackages/react/jsx/web.js +1 -1
- package/dist/module/SubPackages/react-dom/component/node.js +2 -2
- package/dist/module/SubPackages/react-dom/component/web.js +98 -45
- package/dist/module/SubPackages/react-dom/jsx/web.js +17 -9
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +1 -3
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +1 -1
- package/dist/module/Types.js +3 -30
- package/dist/module/Web.js +26 -38
- package/dist/module/esbuildConfigs/index.js +5 -5
- package/dist/module/esbuildConfigs/node.js +17 -15
- package/dist/module/esbuildConfigs/report.js +11 -48
- package/dist/module/esbuildConfigs/tests.js +0 -1
- package/dist/module/esbuildConfigs/web.js +17 -12
- package/dist/module/lib/abstractBase.js +190 -35
- package/dist/module/lib/basebuilder.js +56 -29
- package/dist/module/lib/classBuilder.js +8 -5
- package/dist/module/lib/core.js +44 -19
- package/dist/module/lib/index.js +11 -8
- package/dist/module/preload.js +15 -27
- package/dist/module/puppeteerConfiger.js +19 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Report.css +1616 -584
- package/dist/prebuild/Report.js +2635 -2506
- package/dist/types/Node.d.ts +3 -2
- package/dist/types/PM/index.d.ts +19 -0
- package/dist/types/PM/main.d.ts +28 -0
- package/dist/types/PM/node.d.ts +26 -0
- package/dist/types/PM/web.d.ts +24 -0
- package/dist/types/Project.d.ts +1 -2
- package/dist/types/Puppeteer.d.ts +1 -0
- package/dist/types/Reporter.d.ts +1 -0
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/puppeteer.d.ts +3 -3
- package/dist/types/SubPackages/react/component/node.d.ts +1 -1
- package/dist/types/SubPackages/react/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/index.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/node.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/web.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/component/node.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +1 -1
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +3 -3
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +1 -1
- package/dist/types/Types.d.ts +19 -100
- package/dist/types/Web.d.ts +3 -2
- package/dist/types/esbuildConfigs/features.d.ts +1 -1
- package/dist/types/esbuildConfigs/index.d.ts +1 -1
- package/dist/types/esbuildConfigs/node.d.ts +1 -1
- package/dist/types/esbuildConfigs/report.d.ts +4 -0
- package/dist/types/esbuildConfigs/tests.d.ts +1 -1
- package/dist/types/esbuildConfigs/web.d.ts +1 -1
- package/dist/types/lib/abstractBase.d.ts +26 -24
- package/dist/types/lib/basebuilder.d.ts +10 -7
- package/dist/types/lib/classBuilder.d.ts +4 -3
- package/dist/types/lib/core.d.ts +5 -4
- package/dist/types/lib/index.d.ts +7 -5
- package/dist/types/lib/types.d.ts +62 -0
- package/dist/types/preload.d.ts +0 -1
- package/dist/types/puppeteerConfiger.d.ts +4 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/src/Node.ts +30 -85
- package/src/PM/index.ts +102 -0
- package/src/PM/main.ts +420 -0
- package/src/PM/node.ts +515 -0
- package/src/PM/web.ts +497 -0
- package/src/Project.ts +183 -619
- package/src/Puppeteer.ts +131 -0
- package/src/Report.tsx +158 -44
- package/src/Reporter.ts +134 -0
- package/src/Scheduler.ts +0 -0
- package/src/SubPackages/puppeteer.ts +19 -14
- package/src/SubPackages/react/component/node.ts +20 -32
- package/src/SubPackages/react/component/web.ts +20 -30
- package/src/SubPackages/react/jsx/index.ts +13 -24
- package/src/SubPackages/react/jsx/node.ts +5 -8
- package/src/SubPackages/react/jsx/web.ts +10 -8
- package/src/SubPackages/react-dom/component/node.ts +17 -23
- package/src/SubPackages/react-dom/component/web.ts +134 -95
- package/src/SubPackages/react-dom/jsx/web.ts +41 -48
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +27 -37
- package/src/SubPackages/react-test-renderer/component/index.ts +16 -30
- package/src/SubPackages/react-test-renderer/component/node.ts +5 -11
- package/src/SubPackages/react-test-renderer/component/web.ts +5 -11
- package/src/SubPackages/react-test-renderer/fc/node.ts +36 -50
- package/src/SubPackages/react-test-renderer/fc/web.ts +37 -50
- package/src/SubPackages/react-test-renderer/jsx/index.ts +15 -21
- package/src/SubPackages/react-test-renderer/jsx/node.ts +6 -10
- package/src/SubPackages/react-test-renderer/jsx/web.ts +7 -7
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +13 -16
- package/src/Types.ts +73 -307
- package/src/Web.ts +40 -81
- package/src/cjs-shim.js +2 -2
- package/src/esbuildConfigs/features.ts +3 -4
- package/src/esbuildConfigs/index.ts +8 -8
- package/src/esbuildConfigs/node.ts +21 -20
- package/src/esbuildConfigs/report.ts +15 -51
- package/src/esbuildConfigs/tests.ts +3 -9
- package/src/esbuildConfigs/web.ts +22 -20
- package/src/lib/abstractBase.ts +312 -164
- package/src/lib/basebuilder.ts +123 -127
- package/src/lib/classBuilder.ts +30 -48
- package/src/lib/core.ts +115 -84
- package/src/lib/index.ts +58 -56
- package/src/lib/types.ts +197 -0
- package/src/preload.ts +14 -30
- package/src/puppeteerConfiger.ts +26 -0
- package/src/web.html.ts +1 -1
- package/dist/common/NodeWriter.js +0 -56
- package/dist/common/electron.js +0 -196
- package/dist/common/lib/browser.js +0 -26
- package/dist/common/nodeWriterElectron.js +0 -55
- package/dist/module/NodeWriter.js +0 -50
- package/dist/module/electron.js +0 -191
- package/dist/module/lib/browser.js +0 -22
- package/dist/module/nodeWriterElectron.js +0 -52
- package/dist/types/NodeWriter.d.ts +0 -2
- package/dist/types/lib/browser.d.ts +0 -6
- package/dist/types/nodeWriterElectron.d.ts +0 -2
- package/src/NodeWriter.ts +0 -69
- package/src/electron.ts +0 -250
- package/src/lib/browser.ts +0 -34
- package/src/nodeWriterElectron.ts +0 -71
- package/yarn-error.log +0 -3144
- /package/dist/{types/electron.d.ts → module/lib/types.js} +0 -0
|
@@ -7,54 +7,107 @@ const react_1 = require("react");
|
|
|
7
7
|
const client_1 = __importDefault(require("react-dom/client"));
|
|
8
8
|
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
9
9
|
exports.default = (testInput, testSpecifications, testImplementations) => {
|
|
10
|
+
class TesterantoComponent extends testInput {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.done = props.done;
|
|
14
|
+
}
|
|
15
|
+
componentDidMount() {
|
|
16
|
+
super.componentDidMount && super.componentDidMount();
|
|
17
|
+
return this.done(this);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const t = (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
21
|
+
beforeAll: async (initialProps, artificer) => {
|
|
22
|
+
console.log("mark5", initialProps);
|
|
23
|
+
return await new Promise((resolve, rej) => {
|
|
24
|
+
const htmlElement = document.getElementById("root");
|
|
25
|
+
if (htmlElement) {
|
|
26
|
+
const domRoot = client_1.default.createRoot(htmlElement);
|
|
27
|
+
// Ignore these type errors
|
|
28
|
+
domRoot.render((0, react_1.createElement)(TesterantoComponent, Object.assign(Object.assign({}, initialProps), { done: (reactElement) => {
|
|
29
|
+
resolve({
|
|
30
|
+
htmlElement,
|
|
31
|
+
reactElement,
|
|
32
|
+
domRoot,
|
|
33
|
+
});
|
|
34
|
+
} }), []));
|
|
35
|
+
// resolve({ htmlElement });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
// beforeEach: async (
|
|
40
|
+
// s,
|
|
41
|
+
// initializer,
|
|
42
|
+
// testResource,
|
|
43
|
+
// artificer,
|
|
44
|
+
// initialValues
|
|
45
|
+
// ): Promise<IStore> => {
|
|
46
|
+
// return new Promise((resolve, rej) => {
|
|
47
|
+
// console.log("beforeEach" + TesterantoComponent);
|
|
48
|
+
// // const domRoot = ReactDom.createRoot(htmlElement);
|
|
49
|
+
// // // Ignore these type errors
|
|
50
|
+
// // domRoot.render(
|
|
51
|
+
// // createElement(
|
|
52
|
+
// // TesterantoComponent,
|
|
53
|
+
// // {
|
|
54
|
+
// // ...initializer,
|
|
55
|
+
// // done: (reactElement) => {
|
|
56
|
+
// // resolve({
|
|
57
|
+
// // htmlElement,
|
|
58
|
+
// // reactElement,
|
|
59
|
+
// // domRoot,
|
|
60
|
+
// // });
|
|
61
|
+
// // },
|
|
62
|
+
// // },
|
|
63
|
+
// // []
|
|
64
|
+
// // )
|
|
65
|
+
// // );
|
|
66
|
+
// });
|
|
67
|
+
// },
|
|
68
|
+
andWhen: function (s, whenCB) {
|
|
69
|
+
return whenCB(s);
|
|
70
|
+
},
|
|
71
|
+
butThen: async function (s, thenCB) {
|
|
72
|
+
return thenCB(s);
|
|
73
|
+
},
|
|
74
|
+
afterEach: async function (store, ndx, artificer, utils) {
|
|
75
|
+
console.log("afterEach", store);
|
|
76
|
+
utils.writeFileSync("aftereachlog", store.toString());
|
|
77
|
+
const page = (await utils.browser.pages()).filter((x) => {
|
|
78
|
+
const parsedUrl = new URL(x.url());
|
|
79
|
+
parsedUrl.search = "";
|
|
80
|
+
const strippedUrl = parsedUrl.toString();
|
|
81
|
+
return (strippedUrl ===
|
|
82
|
+
"file:///Users/adam/Code/kokomoBay/docs/web/src/ClassicalComponent/react-dom/client.web.test.html");
|
|
83
|
+
// return true;
|
|
84
|
+
})[0];
|
|
85
|
+
const x = await page.screenshot({
|
|
86
|
+
path: "afterEachLog.jpg",
|
|
87
|
+
});
|
|
88
|
+
console.log("x", x);
|
|
89
|
+
// debugger;
|
|
90
|
+
// const div_root = document.getElementById("root");
|
|
91
|
+
// store.domRoot && store.domRoot.unmount(); //React 18
|
|
92
|
+
// store.remove();
|
|
93
|
+
// store.htmlElement.remove();
|
|
94
|
+
// store.htmlElement = document.createElement("root");
|
|
95
|
+
return store;
|
|
96
|
+
},
|
|
97
|
+
afterAll: async (store, artificer, utils) => {
|
|
98
|
+
// setTimeout(() => {
|
|
99
|
+
// console.log("This will run after 1 second");
|
|
100
|
+
// }, 1000); // 1000 milliseconds = 1 second
|
|
101
|
+
// store.htmlElement.remove();
|
|
102
|
+
// store.htmlElement = document.createElement("root");
|
|
103
|
+
return store;
|
|
104
|
+
},
|
|
105
|
+
});
|
|
10
106
|
document.addEventListener("DOMContentLoaded", function () {
|
|
11
107
|
const elem = document.getElementById("root");
|
|
12
108
|
if (elem) {
|
|
13
|
-
|
|
14
|
-
constructor(props) {
|
|
15
|
-
super(props);
|
|
16
|
-
this.done = props.done;
|
|
17
|
-
}
|
|
18
|
-
componentDidMount() {
|
|
19
|
-
super.componentDidMount && super.componentDidMount();
|
|
20
|
-
return this.done(this);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
24
|
-
beforeAll: async (initialProps, artificer) => {
|
|
25
|
-
console.log("mark5", initialProps);
|
|
26
|
-
return await new Promise((resolve, rej) => {
|
|
27
|
-
const elem = document.getElementById("root");
|
|
28
|
-
if (elem) {
|
|
29
|
-
resolve({ htmlElement: elem });
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
beforeEach: async ({ htmlElement }, initializer, testResource, artificer, initialValues) => {
|
|
34
|
-
return new Promise((resolve, rej) => {
|
|
35
|
-
// console.log("beforeEach" + JSON.stringify(initializer) + JSON.stringify(initialValues));
|
|
36
|
-
// Ignore these type errors
|
|
37
|
-
client_1.default.createRoot(htmlElement).render((0, react_1.createElement)(TesterantoComponent, Object.assign(Object.assign({}, initializer.props), { done: (reactElement) => {
|
|
38
|
-
resolve({
|
|
39
|
-
htmlElement,
|
|
40
|
-
reactElement,
|
|
41
|
-
});
|
|
42
|
-
} }), []));
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
andWhen: function (s, whenCB) {
|
|
46
|
-
return whenCB(s);
|
|
47
|
-
},
|
|
48
|
-
butThen: async function (s) {
|
|
49
|
-
return s;
|
|
50
|
-
},
|
|
51
|
-
afterEach: async function (store, ndx, artificer) {
|
|
52
|
-
return {};
|
|
53
|
-
},
|
|
54
|
-
afterAll: (store, artificer) => {
|
|
55
|
-
return;
|
|
56
|
-
},
|
|
57
|
-
});
|
|
109
|
+
return t;
|
|
58
110
|
}
|
|
59
111
|
});
|
|
112
|
+
return t;
|
|
60
113
|
};
|
|
@@ -33,13 +33,13 @@ exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
|
33
33
|
document.addEventListener("DOMContentLoaded", function () {
|
|
34
34
|
const rootElement = document.getElementById("root");
|
|
35
35
|
if (rootElement) {
|
|
36
|
-
const TesterantoComponent = function ({ done, innerComp }) {
|
|
36
|
+
const TesterantoComponent = function ({ done, innerComp, }) {
|
|
37
37
|
const myContainer = (0, react_1.useRef)(null);
|
|
38
38
|
(0, react_1.useEffect)(() => {
|
|
39
39
|
console.log("useEffect called", myContainer.current);
|
|
40
40
|
done(myContainer.current);
|
|
41
41
|
}, []);
|
|
42
|
-
return react_1.default.createElement(
|
|
42
|
+
return react_1.default.createElement("div", { ref: myContainer }, innerComp());
|
|
43
43
|
};
|
|
44
44
|
(0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
45
45
|
beforeAll: async (input, artificer) => {
|
|
@@ -55,28 +55,36 @@ exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
|
55
55
|
process.nextTick(() => {
|
|
56
56
|
resolve(reactElement);
|
|
57
57
|
});
|
|
58
|
-
}
|
|
58
|
+
},
|
|
59
59
|
}), rootElement);
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
andWhen: function (s, whenCB) {
|
|
63
63
|
return new Promise((resolve, rej) => {
|
|
64
|
-
process.nextTick(() => {
|
|
64
|
+
process.nextTick(() => {
|
|
65
|
+
resolve(whenCB()(s));
|
|
66
|
+
});
|
|
65
67
|
});
|
|
66
68
|
},
|
|
67
69
|
butThen: async function (s) {
|
|
68
70
|
return new Promise((resolve, rej) => {
|
|
69
|
-
process.nextTick(() => {
|
|
71
|
+
process.nextTick(() => {
|
|
72
|
+
resolve(s);
|
|
73
|
+
});
|
|
70
74
|
});
|
|
71
75
|
},
|
|
72
76
|
afterEach: async function (store, ndx, artificer) {
|
|
73
77
|
return new Promise((resolve, rej) => {
|
|
74
|
-
process.nextTick(() => {
|
|
78
|
+
process.nextTick(() => {
|
|
79
|
+
resolve({});
|
|
80
|
+
});
|
|
75
81
|
});
|
|
76
82
|
},
|
|
77
83
|
afterAll: (store, artificer) => {
|
|
78
84
|
return new Promise((resolve, rej) => {
|
|
79
|
-
process.nextTick(() => {
|
|
85
|
+
process.nextTick(() => {
|
|
86
|
+
resolve({});
|
|
87
|
+
});
|
|
80
88
|
});
|
|
81
89
|
},
|
|
82
90
|
});
|
|
@@ -26,9 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const Node_1 = __importDefault(require("../../../Node"));
|
|
30
29
|
const react_1 = __importDefault(require("react"));
|
|
31
30
|
const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
31
|
+
const Node_1 = __importDefault(require("../../../Node"));
|
|
32
32
|
exports.default = (testImplementations, testSpecifications, testInput) => (0, Node_1.default)(testInput, testSpecifications, testImplementations, {
|
|
33
33
|
beforeEach: function (CComponent, props) {
|
|
34
34
|
let component;
|
|
@@ -26,9 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
30
29
|
const react_1 = __importDefault(require("react"));
|
|
31
30
|
const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
31
|
+
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
32
32
|
exports.default = (testImplementations, testSpecifications, testInput) => (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
33
33
|
beforeEach: function (CComponent, props) {
|
|
34
34
|
return new Promise((res, rej) => {
|
|
@@ -32,11 +32,9 @@ const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
|
32
32
|
exports.testInterface = {
|
|
33
33
|
butThen: async function (s, thenCB, tr) {
|
|
34
34
|
console.log("butThen", thenCB.toString());
|
|
35
|
-
// debugger
|
|
36
35
|
return thenCB(s);
|
|
37
36
|
},
|
|
38
37
|
beforeEach: function (CComponent, props) {
|
|
39
|
-
console.log("ASDASDx");
|
|
40
38
|
let component;
|
|
41
39
|
(0, react_test_renderer_1.act)(() => {
|
|
42
40
|
component = react_test_renderer_1.default.create(react_1.default.createElement(CComponent, props, []));
|
|
@@ -46,5 +44,5 @@ exports.testInterface = {
|
|
|
46
44
|
andWhen: async function (renderer, whenCB) {
|
|
47
45
|
await (0, react_test_renderer_1.act)(() => whenCB(renderer));
|
|
48
46
|
return renderer;
|
|
49
|
-
}
|
|
47
|
+
},
|
|
50
48
|
};
|
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const index_js_1 = require("./index.js");
|
|
7
6
|
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
7
|
+
const index_js_1 = require("./index.js");
|
|
8
8
|
exports.default = (testImplementations, testSpecifications, testInput, testInterface2 = index_js_1.testInterface) => {
|
|
9
9
|
return (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, testInterface2);
|
|
10
10
|
};
|
package/dist/common/Types.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
// // screenshot(options?: puppeteer.ScreenshotOptions) {
|
|
6
|
-
// // return super.screenshot({
|
|
7
|
-
// // ...options,
|
|
8
|
-
// // path: "dist/" + (options ? options : { path: "" }).path,
|
|
9
|
-
// // });
|
|
10
|
-
// // }
|
|
11
|
-
// }
|
|
12
|
-
class TBrowser {
|
|
13
|
-
constructor(browser) {
|
|
14
|
-
this.browser = browser;
|
|
15
|
-
}
|
|
16
|
-
pages() {
|
|
17
|
-
return new Promise(async (res, rej) => {
|
|
18
|
-
res((await this.browser.pages()).map((p) => {
|
|
19
|
-
// const handler = {
|
|
20
|
-
// apply: function (target, thisArg, argumentsList) {
|
|
21
|
-
// console.log('screenshot was called with ' + JSON.stringify(argumentsList));
|
|
22
|
-
// const x: ScreenshotOptions = argumentsList[0]
|
|
23
|
-
// x.path = "./dist/" + x.path;
|
|
24
|
-
// console.log('x.path' + x.path, target, thisArg);
|
|
25
|
-
// return target(...argumentsList);
|
|
26
|
-
// }
|
|
27
|
-
// };
|
|
28
|
-
// p.screenshot = new Proxy(p.screenshot, handler);
|
|
29
|
-
return p;
|
|
30
|
-
}));
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.TBrowser = TBrowser;
|
|
3
|
+
// export type ITTestShape = {
|
|
4
|
+
// };
|
package/dist/common/Web.js
CHANGED
|
@@ -3,50 +3,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const web_1 = require("./PM/web");
|
|
6
7
|
const core_js_1 = __importDefault(require("./lib/core.js"));
|
|
7
8
|
const index_js_1 = require("./lib/index.js");
|
|
8
|
-
const remote = require('@electron/remote');
|
|
9
9
|
class WebTesteranto extends core_js_1.default {
|
|
10
10
|
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
11
|
-
super(input, testSpecification, testImplementation, testResourceRequirement,
|
|
12
|
-
if (process.argv[2]) {
|
|
13
|
-
const testResourceArg = decodeURIComponent(new URLSearchParams(location.search).get('requesting') || '');
|
|
14
|
-
try {
|
|
15
|
-
const partialTestResource = JSON.parse(testResourceArg);
|
|
16
|
-
this.receiveTestResourceConfig(this.testJobs[0], partialTestResource);
|
|
17
|
-
}
|
|
18
|
-
catch (e) {
|
|
19
|
-
console.error(e);
|
|
20
|
-
// process.exit(-1);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
// no-op
|
|
25
|
-
}
|
|
26
|
-
const requesting = new URLSearchParams(location.search).get('requesting');
|
|
27
|
-
if (requesting) {
|
|
28
|
-
const testResourceArg = decodeURIComponent(requesting);
|
|
29
|
-
try {
|
|
30
|
-
const partialTestResource = JSON.parse(testResourceArg);
|
|
31
|
-
console.log("initial test resource", partialTestResource);
|
|
32
|
-
this.receiveTestResourceConfig(this.testJobs[0], partialTestResource);
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
console.error(e);
|
|
36
|
-
// process.exit(-1);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// const t: ITestJob = this.testJobs[0];
|
|
11
|
+
super(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
40
12
|
}
|
|
41
|
-
async receiveTestResourceConfig(
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
13
|
+
async receiveTestResourceConfig(partialTestResource) {
|
|
14
|
+
const t = partialTestResource; //JSON.parse(partialTestResource);
|
|
15
|
+
const pm = new web_1.PM_Web(t);
|
|
16
|
+
const { failed, artifacts, logPromise } = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
17
|
+
console.log("test is done, awaiting test result write to fs");
|
|
18
|
+
pm.customclose();
|
|
19
|
+
// Promise.all([...artifacts, logPromise]).then(async () => {
|
|
20
|
+
// console.log("hello world");
|
|
21
|
+
// pm.customclose();
|
|
22
|
+
// // we can't close the window becuase we might be taking a screenshot
|
|
23
|
+
// // window.close();
|
|
24
|
+
// // console.log(
|
|
25
|
+
// // "(window as any).browser",
|
|
26
|
+
// // JSON.stringify(await (window as any).browser)
|
|
27
|
+
// // );
|
|
28
|
+
// // var currentWindow = (await (window as any).browser).getCurrentWindow();
|
|
29
|
+
// // window.close();
|
|
30
|
+
// // var customWindow = window.open("", "_blank", "");
|
|
31
|
+
// // customWindow.close();
|
|
32
|
+
// // this.puppetMaster.browser.page
|
|
33
|
+
// // window["customclose"]();
|
|
34
|
+
// // console.log("goodbye", window["customclose"]());
|
|
35
|
+
// });
|
|
47
36
|
}
|
|
48
37
|
}
|
|
49
|
-
;
|
|
50
38
|
exports.default = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = index_js_1.defaultTestResourceRequirement) => {
|
|
51
39
|
return new WebTesteranto(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
52
40
|
};
|
|
@@ -5,16 +5,16 @@ exports.default = (config) => {
|
|
|
5
5
|
target: "esnext",
|
|
6
6
|
format: "esm",
|
|
7
7
|
splitting: true,
|
|
8
|
-
outExtension: {
|
|
8
|
+
outExtension: { ".js": ".mjs" },
|
|
9
9
|
outbase: config.outbase,
|
|
10
|
-
jsx:
|
|
10
|
+
jsx: "transform",
|
|
11
11
|
bundle: true,
|
|
12
12
|
minify: config.minify === true,
|
|
13
13
|
write: true,
|
|
14
14
|
loader: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
".js": "jsx",
|
|
16
|
+
".png": "binary",
|
|
17
|
+
".jpg": "binary",
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
};
|
|
@@ -4,32 +4,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const index_js_1 = __importDefault(require("./index.js"));
|
|
7
|
-
// const jsonConfig = jsonc.parse((await fs.readFileSync("./testeranto.json")).toString()) as IJsonConfig;
|
|
8
7
|
exports.default = (config, entryPoints) => {
|
|
9
|
-
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { outdir: config.outdir + "/node", inject: [`./node_modules/testeranto/dist/cjs-shim.js`], supported: {
|
|
10
|
-
"dynamic-import": true
|
|
8
|
+
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { splitting: true, outdir: config.outdir + "/node", inject: [`./node_modules/testeranto/dist/cjs-shim.js`], supported: {
|
|
9
|
+
"dynamic-import": true,
|
|
11
10
|
}, define: {
|
|
12
|
-
"process.env.FLUENTFFMPEG_COV": "0"
|
|
11
|
+
"process.env.FLUENTFFMPEG_COV": "0",
|
|
13
12
|
}, absWorkingDir: process.cwd(), banner: {
|
|
14
|
-
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url)
|
|
13
|
+
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
15
14
|
}, platform: "node", external: [
|
|
16
|
-
"testeranto.json",
|
|
17
|
-
"features.test.js",
|
|
18
|
-
"react",
|
|
19
|
-
"events",
|
|
15
|
+
// "testeranto.json",
|
|
16
|
+
// "features.test.js",
|
|
17
|
+
// "react",
|
|
18
|
+
// "events",
|
|
20
19
|
// "ganache"
|
|
21
|
-
...config.externals
|
|
20
|
+
...config.externals,
|
|
22
21
|
], entryPoints: [...entryPoints], plugins: [
|
|
23
22
|
...(config.nodePlugins || []),
|
|
24
23
|
{
|
|
25
|
-
name:
|
|
24
|
+
name: "rebuild-notify",
|
|
26
25
|
setup(build) {
|
|
27
|
-
build.onEnd(result => {
|
|
26
|
+
build.onEnd((result) => {
|
|
28
27
|
console.log(`node build ended with ${result.errors.length} errors`);
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (result.errors.length > 0) {
|
|
29
|
+
console.log(result);
|
|
30
|
+
}
|
|
31
|
+
// console.log(result);
|
|
32
|
+
// result.errors.length !== 0 && process.exit(-1);
|
|
31
33
|
});
|
|
32
|
-
}
|
|
34
|
+
},
|
|
33
35
|
},
|
|
34
36
|
] });
|
|
35
37
|
};
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// outbase: config.outbase,
|
|
15
|
-
// write: true,
|
|
16
|
-
// outfile: `${jsonConfig.outdir}/report.js`,
|
|
17
|
-
// external: [
|
|
18
|
-
// "tests.json",
|
|
19
|
-
// "features.test.js"
|
|
20
|
-
// ],
|
|
21
|
-
// // plugins: [
|
|
22
|
-
// // CssModulesPlugin({
|
|
23
|
-
// // // @see https://github.com/indooorsman/esbuild-css-modules-plugin/blob/main/index.d.ts for more details
|
|
24
|
-
// // force: true,
|
|
25
|
-
// // emitDeclarationFile: true,
|
|
26
|
-
// // localsConvention: 'camelCaseOnly',
|
|
27
|
-
// // namedExports: true,
|
|
28
|
-
// // inject: false
|
|
29
|
-
// // })
|
|
30
|
-
// // ]
|
|
31
|
-
// }
|
|
32
|
-
// // return {
|
|
33
|
-
// // bundle: true,
|
|
34
|
-
// // entryPoints: [
|
|
35
|
-
// // "./node_modules/testeranto/dist/module/Report.js",
|
|
36
|
-
// // jsonConfig.features
|
|
37
|
-
// // ],
|
|
38
|
-
// // minify: config.minify === true,
|
|
39
|
-
// // outbase: ".",
|
|
40
|
-
// // outdir: 'docs',
|
|
41
|
-
// // write: true,
|
|
42
|
-
// // // outfile: `${jsonConfig.outdir}/Report.js`,
|
|
43
|
-
// // external: [
|
|
44
|
-
// // "features.test.js",
|
|
45
|
-
// // "testeranto.json"
|
|
46
|
-
// // ]
|
|
47
|
-
// // }
|
|
48
|
-
// }
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = (config) => {
|
|
4
|
+
return {
|
|
5
|
+
bundle: true,
|
|
6
|
+
entryPoints: ["./node_modules/testeranto/dist/module/report.js"],
|
|
7
|
+
minify: config.minify === true,
|
|
8
|
+
outbase: config.outbase,
|
|
9
|
+
write: true,
|
|
10
|
+
outfile: `${config.outdir}/report.js`,
|
|
11
|
+
external: ["tests.json", "features.test.js"],
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -5,21 +5,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const index_js_1 = __importDefault(require("./index.js"));
|
|
8
|
-
// const jsonConfig = jsonc.parse((await fs.readFileSync("./testeranto.json")).toString()) as IJsonConfig;
|
|
9
8
|
exports.default = (config, entryPoints) => {
|
|
10
9
|
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), {
|
|
11
|
-
// inject: [
|
|
10
|
+
// inject: ["./node_modules/testeranto/dist/cjs-shim.js"],
|
|
12
11
|
// banner: {
|
|
13
|
-
// js: `import { createRequire } from 'module';const require = createRequire(import.meta.url)
|
|
12
|
+
// js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
14
13
|
// },
|
|
14
|
+
// splitting: true,
|
|
15
15
|
outdir: config.outdir + "/web", alias: {
|
|
16
|
-
react: path_1.default.resolve("./node_modules/react")
|
|
16
|
+
react: path_1.default.resolve("./node_modules/react"),
|
|
17
17
|
}, external: [
|
|
18
18
|
"testeranto.json",
|
|
19
19
|
"features.test.ts",
|
|
20
|
-
// "url",
|
|
20
|
+
// "url",
|
|
21
21
|
"react",
|
|
22
|
-
"electron",
|
|
23
22
|
"path",
|
|
24
23
|
"fs",
|
|
25
24
|
"stream",
|
|
@@ -33,18 +32,24 @@ exports.default = (config, entryPoints) => {
|
|
|
33
32
|
"readline",
|
|
34
33
|
"zlib",
|
|
35
34
|
"crypto",
|
|
36
|
-
"https"
|
|
35
|
+
"https",
|
|
36
|
+
"util",
|
|
37
|
+
"process",
|
|
38
|
+
"dns",
|
|
37
39
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
38
40
|
...(config.webPlugins || []),
|
|
39
41
|
{
|
|
40
|
-
name:
|
|
42
|
+
name: "rebuild-notify",
|
|
41
43
|
setup(build) {
|
|
42
|
-
build.onEnd(result => {
|
|
44
|
+
build.onEnd((result) => {
|
|
43
45
|
console.log(`web build ended with ${result.errors.length} errors`);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
if (result.errors.length > 0) {
|
|
47
|
+
console.log(result);
|
|
48
|
+
}
|
|
49
|
+
// console.log(result);
|
|
50
|
+
// result.errors.length !== 0 && process.exit(-1);
|
|
46
51
|
});
|
|
47
|
-
}
|
|
52
|
+
},
|
|
48
53
|
},
|
|
49
54
|
] });
|
|
50
55
|
};
|