artes 1.0.58 → 1.0.60
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
CHANGED
|
@@ -49,7 +49,7 @@ npx artes [options]
|
|
|
49
49
|
| 🏗️ `-c, --create` | Create an example project with Artes | `artes -c` or `artes --create` |
|
|
50
50
|
| ✅ `-y, --yes` | Skip the confirmation prompt when creating an example project | `artes -c -y` or `artes --create --yes` |
|
|
51
51
|
| 📊 `-r, --report` | Run tests and generate Allure report | `artes -r` or `artes --report` |
|
|
52
|
-
| 📁 `--features` | Specify one or more feature files to run (comma-separated) | `artes --features
|
|
52
|
+
| 📁 `--features` | Specify one or more feature files' relative paths to run (comma-separated) (comma-separated) | `artes --features "tests/features/Alma, tests/features/Banan.feature"` |
|
|
53
53
|
| 🔖 `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
|
|
54
54
|
| 🌐 `--env` | Set the environment for the test run | `artes --env "dev"` |
|
|
55
55
|
| 🕶️ `--headless` | Run browser in headless mode | `artes --headless` |
|
package/cucumber.config.js
CHANGED
|
@@ -18,9 +18,11 @@ module.exports = {
|
|
|
18
18
|
default: {
|
|
19
19
|
// File paths and patterns
|
|
20
20
|
timeout: artesConfig.timeout || 30, // Default timeout in milliseconds
|
|
21
|
-
paths:
|
|
22
|
-
? path.join(moduleConfig.projectPath,
|
|
23
|
-
:
|
|
21
|
+
paths: process.env.FEATURES
|
|
22
|
+
? [path.join(moduleConfig.projectPath, process.env.FEATURES)]
|
|
23
|
+
: artesConfig.features
|
|
24
|
+
? path.join(moduleConfig.projectPath, artesConfig.features)
|
|
25
|
+
: [moduleConfig.featuresPath], // Paths to feature files
|
|
24
26
|
require: [
|
|
25
27
|
artesConfig.steps
|
|
26
28
|
? path.join(moduleConfig.projectPath, artesConfig.steps)
|
package/package.json
CHANGED
|
@@ -25,8 +25,8 @@ function showHelp() {
|
|
|
25
25
|
📊 -r, --report Run tests and generate Allure report
|
|
26
26
|
Usage: artes -r or artes --report
|
|
27
27
|
|
|
28
|
-
📁 --features Specify one or more feature files to run (comma-separated)
|
|
29
|
-
Usage: artes --features "Alma, Banan"
|
|
28
|
+
📁 --features Specify one or more feature files' relative paths to run (comma-separated)
|
|
29
|
+
Usage: artes --features "tests/features/Alma, tests/features/Banan.feature"
|
|
30
30
|
|
|
31
31
|
🔖 --tags Run tests with specified Cucumber tags
|
|
32
32
|
Usage: artes --tags "@smoke and not @wip"
|
|
@@ -6,15 +6,10 @@ function runTests(args, flags) {
|
|
|
6
6
|
const env = args[args.indexOf("--env") + 1];
|
|
7
7
|
|
|
8
8
|
const featureFiles = args[args.indexOf("--features") + 1];
|
|
9
|
-
const features =
|
|
10
|
-
flags.features &&
|
|
11
|
-
featureFiles
|
|
12
|
-
.split(",")
|
|
13
|
-
.map((f) => path.join(moduleConfig.featuresPath, `${f.trim()}.feature`));
|
|
9
|
+
const features = flags.features && featureFiles;
|
|
14
10
|
|
|
15
11
|
const tags = args[args.indexOf("--tags") + 1];
|
|
16
12
|
|
|
17
|
-
|
|
18
13
|
flags.env && console.log("Running env:", env);
|
|
19
14
|
flags.env ? (process.env.ENV = JSON.stringify(env)) : "";
|
|
20
15
|
|
|
@@ -29,7 +24,7 @@ function runTests(args, flags) {
|
|
|
29
24
|
flags.tags ? (process.env.RUN_TAGS = JSON.stringify(tags)) : "";
|
|
30
25
|
|
|
31
26
|
flags.features && console.log("Running features:", features);
|
|
32
|
-
flags.features ? (process.env.FEATURES =
|
|
27
|
+
flags.features ? (process.env.FEATURES = features) : "";
|
|
33
28
|
|
|
34
29
|
flags.headless &&
|
|
35
30
|
console.log("Running mode:", flags.headless ? "headless" : "headed");
|
|
@@ -81,21 +81,23 @@ const api = {
|
|
|
81
81
|
headers: payloadJSON ? payloadJSON.headers : {},
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
+
const header = await res.headers();
|
|
85
|
+
let body;
|
|
84
86
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const response = {
|
|
89
|
-
url: res.url(),
|
|
90
|
-
response: res,
|
|
91
|
-
responseHeaders: header,
|
|
92
|
-
responseBody: body,
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
context.response = response;
|
|
96
|
-
} catch (error) {
|
|
97
|
-
throw new Error(`Error processing response: ${error.message}`);
|
|
87
|
+
body = await res.json();
|
|
88
|
+
} catch (e) {
|
|
89
|
+
body = await res.text();
|
|
98
90
|
}
|
|
91
|
+
|
|
92
|
+
const response = {
|
|
93
|
+
url: res.url(),
|
|
94
|
+
requestHeaders: payloadJSON.headers,
|
|
95
|
+
response: res,
|
|
96
|
+
responseHeaders: header,
|
|
97
|
+
responseBody: body,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
context.response = response;
|
|
99
101
|
},
|
|
100
102
|
head: async (url) => {
|
|
101
103
|
const URL = await selector(url);
|
|
@@ -103,20 +105,22 @@ const api = {
|
|
|
103
105
|
|
|
104
106
|
const res = await context.request.head(resolvedURL);
|
|
105
107
|
|
|
108
|
+
const header = await res.headers();
|
|
109
|
+
let body;
|
|
106
110
|
try {
|
|
107
|
-
|
|
111
|
+
body = await res.json();
|
|
112
|
+
} catch (e) {
|
|
113
|
+
body = await res.text();
|
|
114
|
+
}
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
const response = {
|
|
117
|
+
url: res.url(),
|
|
118
|
+
response: res,
|
|
119
|
+
responseHeaders: header,
|
|
120
|
+
responseBody: body,
|
|
121
|
+
};
|
|
115
122
|
|
|
116
|
-
|
|
117
|
-
} catch (error) {
|
|
118
|
-
throw new Error(`Error processing response: ${error.message}`);
|
|
119
|
-
}
|
|
123
|
+
context.response = response;
|
|
120
124
|
},
|
|
121
125
|
post: async (url, payload, bodyType) => {
|
|
122
126
|
const URL = await selector(url);
|
|
@@ -148,22 +152,23 @@ const api = {
|
|
|
148
152
|
|
|
149
153
|
const res = await context.request.post(resolvedURL, requestBody);
|
|
150
154
|
|
|
155
|
+
const header = await res.headers();
|
|
156
|
+
let body;
|
|
151
157
|
try {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const response = {
|
|
156
|
-
url: res.url(),
|
|
157
|
-
requestHeaders: payloadJSON.headers,
|
|
158
|
-
requestBody: payloadJSON.body,
|
|
159
|
-
response: res,
|
|
160
|
-
responseHeaders: header,
|
|
161
|
-
responseBody: body,
|
|
162
|
-
};
|
|
163
|
-
context.response = response;
|
|
164
|
-
} catch (error) {
|
|
165
|
-
throw new Error(`Error processing response: ${error.message}`);
|
|
158
|
+
body = await res.json();
|
|
159
|
+
} catch (e) {
|
|
160
|
+
body = await res.text();
|
|
166
161
|
}
|
|
162
|
+
|
|
163
|
+
const response = {
|
|
164
|
+
url: res.url(),
|
|
165
|
+
requestHeaders: payloadJSON.headers,
|
|
166
|
+
requestBody: payloadJSON.body,
|
|
167
|
+
response: res,
|
|
168
|
+
responseHeaders: header,
|
|
169
|
+
responseBody: body,
|
|
170
|
+
};
|
|
171
|
+
context.response = response;
|
|
167
172
|
},
|
|
168
173
|
put: async (url, payload, bodyType) => {
|
|
169
174
|
const URL = await selector(url);
|
|
@@ -195,22 +200,23 @@ const api = {
|
|
|
195
200
|
|
|
196
201
|
const res = await context.request.put(resolvedURL, requestBody);
|
|
197
202
|
|
|
203
|
+
const header = await res.headers();
|
|
204
|
+
let body;
|
|
198
205
|
try {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const response = {
|
|
203
|
-
url: res.url(),
|
|
204
|
-
requestHeaders: payloadJSON.headers,
|
|
205
|
-
requestBody: payloadJSON.body,
|
|
206
|
-
response: res,
|
|
207
|
-
responseHeaders: header,
|
|
208
|
-
responseBody: body,
|
|
209
|
-
};
|
|
210
|
-
context.response = response;
|
|
211
|
-
} catch (error) {
|
|
212
|
-
throw new Error(`Error processing response: ${error.message}`);
|
|
206
|
+
body = await res.json();
|
|
207
|
+
} catch (e) {
|
|
208
|
+
body = await res.text();
|
|
213
209
|
}
|
|
210
|
+
|
|
211
|
+
const response = {
|
|
212
|
+
url: res.url(),
|
|
213
|
+
requestHeaders: payloadJSON.headers,
|
|
214
|
+
requestBody: payloadJSON.body,
|
|
215
|
+
response: res,
|
|
216
|
+
responseHeaders: header,
|
|
217
|
+
responseBody: body,
|
|
218
|
+
};
|
|
219
|
+
context.response = response;
|
|
214
220
|
},
|
|
215
221
|
patch: async (url, payload, bodyType) => {
|
|
216
222
|
const URL = await selector(url);
|
|
@@ -242,22 +248,23 @@ const api = {
|
|
|
242
248
|
|
|
243
249
|
const res = await context.request.patch(resolvedURL, requestBody);
|
|
244
250
|
|
|
251
|
+
const header = await res.headers();
|
|
252
|
+
let body;
|
|
245
253
|
try {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const response = {
|
|
250
|
-
url: res.url(),
|
|
251
|
-
requestHeaders: payloadJSON.headers,
|
|
252
|
-
requestBody: payloadJSON.body,
|
|
253
|
-
response: res,
|
|
254
|
-
responseHeaders: header,
|
|
255
|
-
responseBody: body,
|
|
256
|
-
};
|
|
257
|
-
context.response = response;
|
|
258
|
-
} catch (error) {
|
|
259
|
-
throw new Error(`Error processing response: ${error.message}`);
|
|
254
|
+
body = await res.json();
|
|
255
|
+
} catch (e) {
|
|
256
|
+
body = await res.text();
|
|
260
257
|
}
|
|
258
|
+
|
|
259
|
+
const response = {
|
|
260
|
+
url: res.url(),
|
|
261
|
+
requestHeaders: payloadJSON.headers,
|
|
262
|
+
requestBody: payloadJSON.body,
|
|
263
|
+
response: res,
|
|
264
|
+
responseHeaders: header,
|
|
265
|
+
responseBody: body,
|
|
266
|
+
};
|
|
267
|
+
context.response = response;
|
|
261
268
|
},
|
|
262
269
|
delete: async (url, payload) => {
|
|
263
270
|
const URL = await selector(url);
|
|
@@ -270,21 +277,23 @@ const api = {
|
|
|
270
277
|
headers: payloadJSON.headers,
|
|
271
278
|
});
|
|
272
279
|
|
|
280
|
+
const header = await res.headers();
|
|
281
|
+
let body;
|
|
273
282
|
try {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const response = {
|
|
278
|
-
url: res.url(),
|
|
279
|
-
response: res,
|
|
280
|
-
responseHeaders: header,
|
|
281
|
-
responseBody: body,
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
context.response = response;
|
|
285
|
-
} catch (error) {
|
|
286
|
-
throw new Error(`Error processing response: ${error.message}`);
|
|
283
|
+
body = await res.json();
|
|
284
|
+
} catch (e) {
|
|
285
|
+
body = await res.text();
|
|
287
286
|
}
|
|
287
|
+
|
|
288
|
+
const response = {
|
|
289
|
+
url: res.url(),
|
|
290
|
+
requestHeaders: payloadJSON.headers,
|
|
291
|
+
response: res,
|
|
292
|
+
responseHeaders: header,
|
|
293
|
+
responseBody: body,
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
context.response = response;
|
|
288
297
|
},
|
|
289
298
|
vars: () => {
|
|
290
299
|
return context.vars;
|