artes 1.0.57 → 1.0.59

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 'Alma, Banan'` |
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` |
@@ -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: artesConfig.features
22
- ? path.join(moduleConfig.projectPath, artesConfig.features)
23
- : [moduleConfig.featuresPath], // Paths to feature files
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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"
@@ -128,7 +128,7 @@ await context.page.goto("https://www.saucedemo.com/");
128
128
  "tests/steps/*.{ts,js}",
129
129
  "node_modules/artes/src/stepDefinitions/*.{ts,js}",
130
130
  ],
131
- "cucumber.features": ["tests/features/*.features"],
131
+ "cucumber.features": ["tests/features/**/*.feature"],
132
132
  "cucumberautocomplete.syncfeatures": true,
133
133
  "cucumberautocomplete.strictGherkinCompletion": true,
134
134
  });
@@ -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`));
14
-
9
+ const features = flags.features && featureFiles;
10
+
15
11
  const tags = args[args.indexOf("--tags") + 1];
16
12
 
17
- const headless = args.includes("--headless");
18
13
 
19
14
  flags.env && console.log("Running env:", env);
20
15
  flags.env ? (process.env.ENV = JSON.stringify(env)) : "";
@@ -30,7 +25,7 @@ function runTests(args, flags) {
30
25
  flags.tags ? (process.env.RUN_TAGS = JSON.stringify(tags)) : "";
31
26
 
32
27
  flags.features && console.log("Running features:", features);
33
- flags.features ? (process.env.FEATURES = JSON.stringify(features)) : "";
28
+ flags.features ? (process.env.FEATURES = features) : "";
34
29
 
35
30
  flags.headless &&
36
31
  console.log("Running mode:", flags.headless ? "headless" : "headed");
@@ -30,7 +30,7 @@ function processForm(key, value) {
30
30
  typeof value.data === "object"
31
31
  ? JSON.stringify(value.data)
32
32
  : String(value.data);
33
- console.log("Content:", content);
33
+
34
34
  formData[key] = {
35
35
  name: value.filename || key,
36
36
  mimeType: value.contentType,
@@ -129,12 +129,14 @@ const api = {
129
129
 
130
130
  switch (bodyType) {
131
131
  case "multipart":
132
+ let combinedFormData = {};
132
133
  for (const [key, value] of Object.entries(payloadJSON.body)) {
133
- var formData = processForm(key, value);
134
+ const formData = processForm(key, value);
135
+ Object.assign(combinedFormData, formData);
134
136
  }
135
137
  requestBody = {
136
138
  headers: payloadJSON.headers,
137
- multipart: formData,
139
+ multipart: combinedFormData,
138
140
  };
139
141
  break;
140
142
  default:
@@ -174,12 +176,14 @@ const api = {
174
176
 
175
177
  switch (bodyType) {
176
178
  case "multipart":
179
+ let combinedFormData = {};
177
180
  for (const [key, value] of Object.entries(payloadJSON.body)) {
178
- var formData = processForm(key, value);
181
+ const formData = processForm(key, value);
182
+ Object.assign(combinedFormData, formData);
179
183
  }
180
184
  requestBody = {
181
185
  headers: payloadJSON.headers,
182
- multipart: formData,
186
+ multipart: combinedFormData,
183
187
  };
184
188
  break;
185
189
  default:
@@ -219,12 +223,14 @@ const api = {
219
223
 
220
224
  switch (bodyType) {
221
225
  case "multipart":
226
+ let combinedFormData = {};
222
227
  for (const [key, value] of Object.entries(payloadJSON.body)) {
223
- var formData = processForm(key, value);
228
+ const formData = processForm(key, value);
229
+ Object.assign(combinedFormData, formData);
224
230
  }
225
231
  requestBody = {
226
232
  headers: payloadJSON.headers,
227
- multipart: formData,
233
+ multipart: combinedFormData,
228
234
  };
229
235
  break;
230
236
  default: