artes 1.6.0 → 1.6.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/executer.js CHANGED
@@ -191,12 +191,18 @@ async function main() {
191
191
 
192
192
  runTests();
193
193
 
194
+ const testCoverage = testCoverageCalculator();
195
+
196
+ if (testCoverage.totalTests === 0) {
197
+ console.log("\x1b[33mNo tests were run (0 scenarios). Skipping report generation and upload.\x1b[0m");
198
+ cleanUp();
199
+ process.exit(process.env.EXIT_CODE);
200
+ }
201
+
194
202
  logPomWarnings();
195
203
 
196
204
  findDuplicateTestNames();
197
205
 
198
- const testCoverage = testCoverageCalculator();
199
-
200
206
  const testPercentage = process.env.PERCENTAGE
201
207
  ? Number(process.env.PERCENTAGE)
202
208
  : artesConfig.testPercentage || 0;
@@ -229,16 +235,17 @@ async function main() {
229
235
  fs.renameSync(source, destination);
230
236
  }
231
237
 
232
- if (
233
- flags.reportWithTrace ||
234
- artesConfig.reportWithTrace ||
235
- flags.report ||
236
- artesConfig.report
237
- ) {
238
- getExecutor();
239
- getEnvInfo();
240
- generateReport();
241
- }
238
+ if (
239
+ flags.reportWithTrace ||
240
+ artesConfig.reportWithTrace ||
241
+ flags.report ||
242
+ artesConfig.report
243
+ ) {
244
+ getExecutor();
245
+ getEnvInfo();
246
+ generateReport();
247
+ }
248
+
242
249
 
243
250
  if (
244
251
  !(process.env.TRACE === "true"
@@ -251,18 +258,23 @@ async function main() {
251
258
  });
252
259
  }
253
260
 
254
- if (flags.uploadReport || artesConfig.uploadReport) {
255
- await uploadReport({
256
- reporterURL: reporterURL || artesConfig.reporterURL,
257
- projectName: projectName || artesConfig.projectName || "Artes Report",
258
- projectType: projectType || artesConfig.projectType || "Artes",
259
- reportName: reportName || artesConfig.reportName || "Artes Report",
260
- reportPath: reportPath || artesConfig.reportPath || path.join(process.cwd(), "report.zip")
261
- });
262
- }
261
+ try {
262
+ if (flags.uploadReport || artesConfig.uploadReport) {
263
+ await uploadReport({
264
+ reporterURL: reporterURL || artesConfig.reporterURL,
265
+ projectName: projectName || artesConfig.projectName || "Artes Report",
266
+ projectType: projectType || artesConfig.projectType || "Artes",
267
+ reportName: reportName || artesConfig.reportName || "Artes Report",
268
+ reportPath: reportPath || artesConfig.reportPath || path.join(process.cwd(), "report.zip")
269
+ });
270
+ }
271
+ } catch (err) {
272
+ console.error("Upload failed:", err.message);
273
+ } finally {
274
+ cleanUp();
275
+ process.exit(process.env.EXIT_CODE);
276
+ }
263
277
 
264
- cleanUp();
265
- process.exit(process.env.EXIT_CODE);
266
278
  }
267
279
 
268
280
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.6.0",
3
+ "version": "1.6.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": {
@@ -16,6 +16,7 @@ async function getEnvInfo() {
16
16
  baseURL = cucumberConfig.baseURL;
17
17
  }
18
18
 
19
+ let browserInfo = null;
19
20
  if (fs.existsSync(path.join(moduleConfig.modulePath, "browser-info.json"))) {
20
21
  browserInfo = JSON.parse(
21
22
  fs.readFileSync(
@@ -44,8 +45,8 @@ async function getEnvInfo() {
44
45
 
45
46
  // ── Browser ─────────────────────────────
46
47
  Browser_Name: cucumberConfig.browser.browserType,
47
- Browser_Version: browserInfo.BROWSER_VERSION,
48
- Screen_Size: `w: ${browserInfo.BROWSER_WIDTH}px h:${browserInfo.BROWSER_HEIGHT}px`,
48
+ Browser_Version: browserInfo?.BROWSER_VERSION ?? "N/A",
49
+ Screen_Size: `w: ${browserInfo?.BROWSER_WIDTH ?? "N/A"}px h:${browserInfo?.BROWSER_HEIGHT ?? "N/A"}px`,
49
50
  Headless: cucumberConfig.browser.headless ?? "N/A",
50
51
 
51
52
  // ── Test Config ─────────────────────────
@@ -83,4 +84,4 @@ async function getEnvInfo() {
83
84
  return environment;
84
85
  }
85
86
 
86
- module.exports = { getEnvInfo };
87
+ module.exports = { getEnvInfo };
@@ -17,7 +17,7 @@ async function uploadReport({
17
17
  formData.append("project", projectName);
18
18
  formData.append("type", projectType);
19
19
 
20
- const response = await fetch(`${reporterURL}/api/report`, {
20
+ const response = await fetch(reporterURL, {
21
21
  method: "POST",
22
22
  body: formData,
23
23
  });