artes 1.4.7 → 1.4.9
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 +668 -668
- package/cucumber.config.js +223 -223
- package/docs/emulationDevicesList.md +152 -152
- package/docs/functionDefinitions.md +2401 -2401
- package/docs/stepDefinitions.md +402 -402
- package/executer.js +479 -479
- package/index.js +50 -50
- package/package.json +52 -52
- package/src/helper/contextManager/browserManager.js +74 -74
- package/src/helper/contextManager/requestManager.js +23 -23
- package/src/helper/controller/elementController.js +203 -185
- package/src/helper/controller/pomCollector.js +82 -82
- package/src/helper/executers/cleaner.js +19 -19
- package/src/helper/executers/exporter.js +15 -15
- package/src/helper/executers/helper.js +110 -110
- package/src/helper/executers/projectCreator.js +206 -206
- package/src/helper/executers/reportGenerator.js +70 -70
- package/src/helper/executers/testRunner.js +28 -28
- package/src/helper/executers/versionChecker.js +31 -31
- package/src/helper/imports/commons.js +57 -57
- package/src/helper/stepFunctions/APIActions.js +495 -495
- package/src/helper/stepFunctions/assertions.js +989 -989
- package/src/helper/stepFunctions/browserActions.js +22 -22
- package/src/helper/stepFunctions/elementInteractions.js +60 -60
- package/src/helper/stepFunctions/exporter.js +19 -19
- package/src/helper/stepFunctions/frameActions.js +72 -72
- package/src/helper/stepFunctions/keyboardActions.js +66 -66
- package/src/helper/stepFunctions/mouseActions.js +83 -83
- package/src/helper/stepFunctions/pageActions.js +43 -43
- package/src/hooks/context.js +15 -15
- package/src/hooks/hooks.js +215 -215
- package/src/stepDefinitions/API.steps.js +310 -310
- package/src/stepDefinitions/assertions.steps.js +1092 -1092
- package/src/stepDefinitions/browser.steps.js +7 -7
- package/src/stepDefinitions/frameActions.steps.js +76 -76
- package/src/stepDefinitions/keyboardActions.steps.js +265 -265
- package/src/stepDefinitions/mouseActions.steps.js +378 -378
- package/src/stepDefinitions/page.steps.js +71 -71
- package/src/stepDefinitions/random.steps.js +188 -188
- package/status-formatter.js +138 -138
|
@@ -1,185 +1,203 @@
|
|
|
1
|
-
const { context } = require("../../hooks/context");
|
|
2
|
-
|
|
3
|
-
let elements = {};
|
|
4
|
-
|
|
5
|
-
function addElements(newElements) {
|
|
6
|
-
elements = { ...elements, ...newElements };
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// async function locatorExistenceChecker(locator){
|
|
10
|
-
// const locatorCount = await locator.count();
|
|
11
|
-
// console.log(locator, locatorCount)
|
|
12
|
-
// return locatorCount ==0 ? false : true;
|
|
13
|
-
// }
|
|
14
|
-
|
|
15
|
-
function selectorSeparator(element) {
|
|
16
|
-
if (typeof element !== "string") return element;
|
|
17
|
-
|
|
18
|
-
const selector = element?.split("=");
|
|
19
|
-
const validTypes = [
|
|
20
|
-
"xpath",
|
|
21
|
-
"name",
|
|
22
|
-
"placeholder",
|
|
23
|
-
"text",
|
|
24
|
-
"label",
|
|
25
|
-
"role",
|
|
26
|
-
"alt",
|
|
27
|
-
"title",
|
|
28
|
-
"testid",
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
if (selector && validTypes.includes(selector[0]?.trim())) {
|
|
32
|
-
return [
|
|
33
|
-
selector[0].trim(),
|
|
34
|
-
selector[1] !== undefined ? selector[1].trim() : "",
|
|
35
|
-
];
|
|
36
|
-
} else {
|
|
37
|
-
return selector.join("=");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getSelector(element) {
|
|
42
|
-
|
|
43
|
-
element = resolveVariable(element)
|
|
44
|
-
|
|
45
|
-
const selector =
|
|
46
|
-
elements?.[element]?.selector || elements?.[element] || element;
|
|
47
|
-
return resolveVariable(selectorSeparator(selector));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function getElement(element) {
|
|
51
|
-
if (!context.page) {
|
|
52
|
-
throw new Error("Page context is not initialized.");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const selector = getSelector(element);
|
|
56
|
-
const waitTime = elements[element]?.waitTime * 1000 || 0;
|
|
57
|
-
|
|
58
|
-
let locator;
|
|
59
|
-
switch (selector[0]) {
|
|
60
|
-
case "xpath":
|
|
61
|
-
locator = context.page.locator(`xpath=${selector[1]}`, { exact: true });
|
|
62
|
-
break;
|
|
63
|
-
case "name":
|
|
64
|
-
locator = context.page.locator(`[name="${selector[1]}"]`, {
|
|
65
|
-
exact: true,
|
|
66
|
-
});
|
|
67
|
-
break;
|
|
68
|
-
case "placeholder":
|
|
69
|
-
locator = context.page.getByPlaceholder(selector[1], { exact: true });
|
|
70
|
-
break;
|
|
71
|
-
case "text":
|
|
72
|
-
locator = context.page.getByText(selector[1], { exact: true });
|
|
73
|
-
break;
|
|
74
|
-
case "label":
|
|
75
|
-
locator = context.page.getByLabel(selector[1], { exact: true });
|
|
76
|
-
break;
|
|
77
|
-
case "role":
|
|
78
|
-
locator = context.page.getByRole(selector[1], { exact: true });
|
|
79
|
-
break;
|
|
80
|
-
case "alt":
|
|
81
|
-
locator = context.page.getByAltText(selector[1], { exact: true });
|
|
82
|
-
break;
|
|
83
|
-
case "title":
|
|
84
|
-
locator = context.page.getByTitle(selector[1], { exact: true });
|
|
85
|
-
break;
|
|
86
|
-
case "testid":
|
|
87
|
-
locator = context.page.getByTestId(selector[1], { exact: true });
|
|
88
|
-
break;
|
|
89
|
-
default:
|
|
90
|
-
locator = context.page.locator(selector, { exact: true });
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return locator;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function extractVarsFromResponse(responseBody, vars,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
1
|
+
const { context } = require("../../hooks/context");
|
|
2
|
+
|
|
3
|
+
let elements = {};
|
|
4
|
+
|
|
5
|
+
function addElements(newElements) {
|
|
6
|
+
elements = { ...elements, ...newElements };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// async function locatorExistenceChecker(locator){
|
|
10
|
+
// const locatorCount = await locator.count();
|
|
11
|
+
// console.log(locator, locatorCount)
|
|
12
|
+
// return locatorCount ==0 ? false : true;
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
function selectorSeparator(element) {
|
|
16
|
+
if (typeof element !== "string") return element;
|
|
17
|
+
|
|
18
|
+
const selector = element?.split("=");
|
|
19
|
+
const validTypes = [
|
|
20
|
+
"xpath",
|
|
21
|
+
"name",
|
|
22
|
+
"placeholder",
|
|
23
|
+
"text",
|
|
24
|
+
"label",
|
|
25
|
+
"role",
|
|
26
|
+
"alt",
|
|
27
|
+
"title",
|
|
28
|
+
"testid",
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
if (selector && validTypes.includes(selector[0]?.trim())) {
|
|
32
|
+
return [
|
|
33
|
+
selector[0].trim(),
|
|
34
|
+
selector[1] !== undefined ? selector[1].trim() : "",
|
|
35
|
+
];
|
|
36
|
+
} else {
|
|
37
|
+
return selector.join("=");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getSelector(element) {
|
|
42
|
+
|
|
43
|
+
element = resolveVariable(element)
|
|
44
|
+
|
|
45
|
+
const selector =
|
|
46
|
+
elements?.[element]?.selector || elements?.[element] || element;
|
|
47
|
+
return resolveVariable(selectorSeparator(selector));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getElement(element) {
|
|
51
|
+
if (!context.page) {
|
|
52
|
+
throw new Error("Page context is not initialized.");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const selector = getSelector(element);
|
|
56
|
+
const waitTime = elements[element]?.waitTime * 1000 || 0;
|
|
57
|
+
|
|
58
|
+
let locator;
|
|
59
|
+
switch (selector[0]) {
|
|
60
|
+
case "xpath":
|
|
61
|
+
locator = context.page.locator(`xpath=${selector[1]}`, { exact: true });
|
|
62
|
+
break;
|
|
63
|
+
case "name":
|
|
64
|
+
locator = context.page.locator(`[name="${selector[1]}"]`, {
|
|
65
|
+
exact: true,
|
|
66
|
+
});
|
|
67
|
+
break;
|
|
68
|
+
case "placeholder":
|
|
69
|
+
locator = context.page.getByPlaceholder(selector[1], { exact: true });
|
|
70
|
+
break;
|
|
71
|
+
case "text":
|
|
72
|
+
locator = context.page.getByText(selector[1], { exact: true });
|
|
73
|
+
break;
|
|
74
|
+
case "label":
|
|
75
|
+
locator = context.page.getByLabel(selector[1], { exact: true });
|
|
76
|
+
break;
|
|
77
|
+
case "role":
|
|
78
|
+
locator = context.page.getByRole(selector[1], { exact: true });
|
|
79
|
+
break;
|
|
80
|
+
case "alt":
|
|
81
|
+
locator = context.page.getByAltText(selector[1], { exact: true });
|
|
82
|
+
break;
|
|
83
|
+
case "title":
|
|
84
|
+
locator = context.page.getByTitle(selector[1], { exact: true });
|
|
85
|
+
break;
|
|
86
|
+
case "testid":
|
|
87
|
+
locator = context.page.getByTestId(selector[1], { exact: true });
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
locator = context.page.locator(selector, { exact: true });
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return locator;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function extractVarsFromResponse(responseBody, vars, customVarNames) {
|
|
98
|
+
|
|
99
|
+
function getValueByPath(obj, path) {
|
|
100
|
+
const keys = path.split(".");
|
|
101
|
+
let current = obj;
|
|
102
|
+
|
|
103
|
+
if (typeof obj === "string") return obj;
|
|
104
|
+
|
|
105
|
+
for (const key of keys) {
|
|
106
|
+
if (current && typeof current === "object" && key in current) {
|
|
107
|
+
current = current[key];
|
|
108
|
+
} else {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return current;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
const varPaths = vars.split(",").map(v => v.trim());
|
|
118
|
+
let customNames = [];
|
|
119
|
+
|
|
120
|
+
if (typeof customVarNames === "string") {
|
|
121
|
+
customNames = customVarNames.split(",").map(n => n.trim());
|
|
122
|
+
} else if (Array.isArray(customVarNames)) {
|
|
123
|
+
customNames = customVarNames;
|
|
124
|
+
} else {
|
|
125
|
+
throw new Error("customVarNames must be a string or an array");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if (customNames.length !== varPaths.length) {
|
|
130
|
+
customNames = varPaths;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
varPaths.forEach((path, index) => {
|
|
135
|
+
const value = getValueByPath(responseBody, path);
|
|
136
|
+
if (value !== undefined) {
|
|
137
|
+
saveVar(value, customNames[index], path);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function saveVar(value, customName, path) {
|
|
143
|
+
if (!customName) {
|
|
144
|
+
const flatKey = path
|
|
145
|
+
.split(".")
|
|
146
|
+
.map((part, i) =>
|
|
147
|
+
i === 0 ? part : part[0].toUpperCase() + part.slice(1),
|
|
148
|
+
)
|
|
149
|
+
.join("");
|
|
150
|
+
|
|
151
|
+
context.vars[flatKey] = value;
|
|
152
|
+
} else {
|
|
153
|
+
context.vars[customName] = value;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function resolveVariable(template) {
|
|
158
|
+
if (typeof template === "string") {
|
|
159
|
+
return template.replace(/{{\s*(\w+)\s*}}/g, (_, varName) => {
|
|
160
|
+
let value = context.vars[varName];
|
|
161
|
+
|
|
162
|
+
if (value !== undefined) {
|
|
163
|
+
if (typeof value !== "string") {
|
|
164
|
+
try {
|
|
165
|
+
value = JSON.stringify(value);
|
|
166
|
+
} catch {
|
|
167
|
+
value = String(value);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return value
|
|
172
|
+
.replace(/\n/g, "\\n")
|
|
173
|
+
.replace(/\r/g, "\\r")
|
|
174
|
+
.replace(/\t/g, "\\t");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return `{{${varName}}}`;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (Array.isArray(template)) {
|
|
182
|
+
return template.map((item) => resolveVariable(item));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (template && typeof template === "object") {
|
|
186
|
+
const result = {};
|
|
187
|
+
for (const key in template) {
|
|
188
|
+
result[key] = resolveVariable(template[key]);
|
|
189
|
+
}
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return template;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
module.exports = {
|
|
197
|
+
getElement,
|
|
198
|
+
addElements,
|
|
199
|
+
getSelector,
|
|
200
|
+
extractVarsFromResponse,
|
|
201
|
+
saveVar,
|
|
202
|
+
resolveVariable,
|
|
203
|
+
};
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
const { addElements } = require("./elementController");
|
|
2
|
-
const cucumberConfig = require("../../../cucumber.config");
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const { moduleConfig } = require("../../helper/imports/commons");
|
|
6
|
-
|
|
7
|
-
const duplicateWarnings = [];
|
|
8
|
-
const keyRegistry = {};
|
|
9
|
-
|
|
10
|
-
function pomCollector() {
|
|
11
|
-
const pomPath = cucumberConfig.default.pomPath;
|
|
12
|
-
|
|
13
|
-
if (!fs.existsSync(pomPath)) return;
|
|
14
|
-
|
|
15
|
-
fs.readdirSync(pomPath).forEach((file) => {
|
|
16
|
-
const filePath = path.join(pomPath, file);
|
|
17
|
-
|
|
18
|
-
let parsed;
|
|
19
|
-
try {
|
|
20
|
-
parsed = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.log(`Error parsing POM file ${file}: ${error.message}`);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
Object.keys(parsed).forEach((key) => {
|
|
27
|
-
if (keyRegistry[key]) {
|
|
28
|
-
duplicateWarnings.push(
|
|
29
|
-
`${key} in ${file} has the same key with ${key} in ${keyRegistry[key]}`,
|
|
30
|
-
);
|
|
31
|
-
} else {
|
|
32
|
-
keyRegistry[key] = file;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
addElements(parsed);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const duplicationFilePath = path.join(
|
|
40
|
-
moduleConfig.projectPath,
|
|
41
|
-
"node_modules",
|
|
42
|
-
"artes",
|
|
43
|
-
"pomDuplicateWarnings.json",
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
if (duplicateWarnings.length > 0) {
|
|
47
|
-
fs.mkdirSync(path.dirname(duplicationFilePath), { recursive: true });
|
|
48
|
-
fs.writeFileSync(
|
|
49
|
-
duplicationFilePath,
|
|
50
|
-
JSON.stringify(duplicateWarnings, null, 2),
|
|
51
|
-
"utf8",
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function logPomWarnings() {
|
|
57
|
-
if (
|
|
58
|
-
!fs.existsSync(
|
|
59
|
-
path.join(moduleConfig.modulePath, "pomDuplicateWarnings.json"),
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
return;
|
|
63
|
-
|
|
64
|
-
const duplicateWarnings = JSON.parse(
|
|
65
|
-
fs.readFileSync(
|
|
66
|
-
path.join(moduleConfig.modulePath, "pomDuplicateWarnings.json"),
|
|
67
|
-
"utf8",
|
|
68
|
-
),
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
console.warn(
|
|
72
|
-
"\n\x1b[33m[WARNING] POM DUPLICATE KEY WARNINGS: This may break your tests or cause flaky behavior.",
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
duplicateWarnings.forEach((warning) => {
|
|
76
|
-
console.warn(`- ${warning}`);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
console.log("\x1b[0m");
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
module.exports = { pomCollector, logPomWarnings };
|
|
1
|
+
const { addElements } = require("./elementController");
|
|
2
|
+
const cucumberConfig = require("../../../cucumber.config");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const { moduleConfig } = require("../../helper/imports/commons");
|
|
6
|
+
|
|
7
|
+
const duplicateWarnings = [];
|
|
8
|
+
const keyRegistry = {};
|
|
9
|
+
|
|
10
|
+
function pomCollector() {
|
|
11
|
+
const pomPath = cucumberConfig.default.pomPath;
|
|
12
|
+
|
|
13
|
+
if (!fs.existsSync(pomPath)) return;
|
|
14
|
+
|
|
15
|
+
fs.readdirSync(pomPath).forEach((file) => {
|
|
16
|
+
const filePath = path.join(pomPath, file);
|
|
17
|
+
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.log(`Error parsing POM file ${file}: ${error.message}`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Object.keys(parsed).forEach((key) => {
|
|
27
|
+
if (keyRegistry[key]) {
|
|
28
|
+
duplicateWarnings.push(
|
|
29
|
+
`${key} in ${file} has the same key with ${key} in ${keyRegistry[key]}`,
|
|
30
|
+
);
|
|
31
|
+
} else {
|
|
32
|
+
keyRegistry[key] = file;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
addElements(parsed);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const duplicationFilePath = path.join(
|
|
40
|
+
moduleConfig.projectPath,
|
|
41
|
+
"node_modules",
|
|
42
|
+
"artes",
|
|
43
|
+
"pomDuplicateWarnings.json",
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
if (duplicateWarnings.length > 0) {
|
|
47
|
+
fs.mkdirSync(path.dirname(duplicationFilePath), { recursive: true });
|
|
48
|
+
fs.writeFileSync(
|
|
49
|
+
duplicationFilePath,
|
|
50
|
+
JSON.stringify(duplicateWarnings, null, 2),
|
|
51
|
+
"utf8",
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function logPomWarnings() {
|
|
57
|
+
if (
|
|
58
|
+
!fs.existsSync(
|
|
59
|
+
path.join(moduleConfig.modulePath, "pomDuplicateWarnings.json"),
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
return;
|
|
63
|
+
|
|
64
|
+
const duplicateWarnings = JSON.parse(
|
|
65
|
+
fs.readFileSync(
|
|
66
|
+
path.join(moduleConfig.modulePath, "pomDuplicateWarnings.json"),
|
|
67
|
+
"utf8",
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
console.warn(
|
|
72
|
+
"\n\x1b[33m[WARNING] POM DUPLICATE KEY WARNINGS: This may break your tests or cause flaky behavior.",
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
duplicateWarnings.forEach((warning) => {
|
|
76
|
+
console.warn(`- ${warning}`);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
console.log("\x1b[0m");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = { pomCollector, logPomWarnings };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const { moduleConfig } = require("../imports/commons");
|
|
2
|
-
const { spawnSync } = require("child_process");
|
|
3
|
-
|
|
4
|
-
function cleanUp() {
|
|
5
|
-
try {
|
|
6
|
-
spawnSync("rimraf", [moduleConfig.cleanUpPaths], {
|
|
7
|
-
cwd: moduleConfig.modulePath,
|
|
8
|
-
stdio: "ignore",
|
|
9
|
-
shell: true,
|
|
10
|
-
});
|
|
11
|
-
} catch (error) {
|
|
12
|
-
console.error("❌ Error in cleanup:", error.message);
|
|
13
|
-
process.env.EXIT_CODE = 1;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
cleanUp,
|
|
19
|
-
};
|
|
1
|
+
const { moduleConfig } = require("../imports/commons");
|
|
2
|
+
const { spawnSync } = require("child_process");
|
|
3
|
+
|
|
4
|
+
function cleanUp() {
|
|
5
|
+
try {
|
|
6
|
+
spawnSync("rimraf", [moduleConfig.cleanUpPaths], {
|
|
7
|
+
cwd: moduleConfig.modulePath,
|
|
8
|
+
stdio: "ignore",
|
|
9
|
+
shell: true,
|
|
10
|
+
});
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.error("❌ Error in cleanup:", error.message);
|
|
13
|
+
process.env.EXIT_CODE = 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
cleanUp,
|
|
19
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const { showHelp } = require("./helper");
|
|
2
|
-
const { createProject } = require("./projectCreator");
|
|
3
|
-
const { generateReport } = require("./reportGenerator");
|
|
4
|
-
const { runTests } = require("./testRunner");
|
|
5
|
-
const { showVersion } = require("./versionChecker");
|
|
6
|
-
const { cleanUp } = require("./cleaner");
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
createProject,
|
|
10
|
-
generateReport,
|
|
11
|
-
runTests,
|
|
12
|
-
showHelp,
|
|
13
|
-
showVersion,
|
|
14
|
-
cleanUp,
|
|
15
|
-
};
|
|
1
|
+
const { showHelp } = require("./helper");
|
|
2
|
+
const { createProject } = require("./projectCreator");
|
|
3
|
+
const { generateReport } = require("./reportGenerator");
|
|
4
|
+
const { runTests } = require("./testRunner");
|
|
5
|
+
const { showVersion } = require("./versionChecker");
|
|
6
|
+
const { cleanUp } = require("./cleaner");
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
createProject,
|
|
10
|
+
generateReport,
|
|
11
|
+
runTests,
|
|
12
|
+
showHelp,
|
|
13
|
+
showVersion,
|
|
14
|
+
cleanUp,
|
|
15
|
+
};
|