artes 1.4.0 → 1.4.2
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/docs/stepDefinitions.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artes",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"author": "VhdAghyv",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@cucumber/cucumber": "11.0
|
|
21
|
+
"@cucumber/cucumber": "^11.3.0",
|
|
22
22
|
"@cucumber/messages": "26.0.1",
|
|
23
23
|
"@faker-js/faker": "9.8.0",
|
|
24
24
|
"@types/node": "22.9.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"archiver": "^7.0.1",
|
|
30
30
|
"dayjs": "1.11.13",
|
|
31
31
|
"deasync": "^0.1.31",
|
|
32
|
-
"playwright": "1.
|
|
32
|
+
"playwright": "^1.58.2",
|
|
33
33
|
"rimraf": "6.0.1"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
@@ -58,7 +58,7 @@ function generateReport() {
|
|
|
58
58
|
|
|
59
59
|
require("deasync").loopWhile(() => !done);
|
|
60
60
|
|
|
61
|
-
console.log(`🗜️ Zipped in ${moduleConfig.
|
|
61
|
+
console.log(`🗜️ Zipped in ${moduleConfig.projectPath}/report.zip!`);
|
|
62
62
|
if (error) throw error;
|
|
63
63
|
}
|
|
64
64
|
} catch (err) {
|
|
@@ -483,8 +483,12 @@ const api = {
|
|
|
483
483
|
|
|
484
484
|
context.response = await response;
|
|
485
485
|
},
|
|
486
|
-
vars: () => {
|
|
487
|
-
|
|
486
|
+
vars: (variable) => {
|
|
487
|
+
if(!variable){
|
|
488
|
+
return context.vars;
|
|
489
|
+
}else{
|
|
490
|
+
return { [variable]: context.vars[variable] };
|
|
491
|
+
}
|
|
488
492
|
},
|
|
489
493
|
};
|
|
490
494
|
|
package/src/hooks/hooks.js
CHANGED
|
@@ -176,21 +176,6 @@ After(async function ({ pickle, result }) {
|
|
|
176
176
|
if (cucumberConfig.default.reportWithTrace) {
|
|
177
177
|
await allure.attachTrace("Trace", tracePath);
|
|
178
178
|
|
|
179
|
-
if (!cucumberConfig.default.trace) {
|
|
180
|
-
spawnSync(
|
|
181
|
-
"npx",
|
|
182
|
-
[
|
|
183
|
-
"rimraf",
|
|
184
|
-
"--no-glob",
|
|
185
|
-
path.join(moduleConfig.projectPath, "./traces"),
|
|
186
|
-
],
|
|
187
|
-
{
|
|
188
|
-
cwd: moduleConfig.projectPath,
|
|
189
|
-
stdio: "inherit",
|
|
190
|
-
shell: false,
|
|
191
|
-
},
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
179
|
}
|
|
195
180
|
}
|
|
196
181
|
|
|
@@ -228,6 +213,22 @@ AfterAll(async () => {
|
|
|
228
213
|
|
|
229
214
|
logPomWarnings();
|
|
230
215
|
|
|
216
|
+
if (!cucumberConfig.default.trace) {
|
|
217
|
+
spawnSync(
|
|
218
|
+
"npx",
|
|
219
|
+
[
|
|
220
|
+
"rimraf",
|
|
221
|
+
"--no-glob",
|
|
222
|
+
path.join(moduleConfig.projectPath, "./traces"),
|
|
223
|
+
],
|
|
224
|
+
{
|
|
225
|
+
cwd: moduleConfig.projectPath,
|
|
226
|
+
stdio: "inherit",
|
|
227
|
+
shell: false,
|
|
228
|
+
},
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
231
232
|
if (!fs.existsSync(statusDir)) return;
|
|
232
233
|
|
|
233
234
|
const files = fs.readdirSync(statusDir);
|
|
@@ -5,6 +5,7 @@ const {
|
|
|
5
5
|
saveVar,
|
|
6
6
|
time,
|
|
7
7
|
random,
|
|
8
|
+
moduleConfig,
|
|
8
9
|
} = require("../helper/imports/commons");
|
|
9
10
|
const { api } = require("../helper/stepFunctions/exporter");
|
|
10
11
|
const path = require("path");
|
|
@@ -222,7 +223,11 @@ When(
|
|
|
222
223
|
);
|
|
223
224
|
|
|
224
225
|
When("User wants to see saved variables", async function () {
|
|
225
|
-
console.log("\nVariables:", api.vars(), "\n");
|
|
226
|
+
console.log("\nVariables:", api.vars(null), "\n");
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
When("User wants to see {string} variable", async function (variable) {
|
|
230
|
+
console.log(api.vars(variable), "\n");
|
|
226
231
|
});
|
|
227
232
|
|
|
228
233
|
When("User wants to see request body", async function () {
|