artes 1.7.16 → 1.7.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.7.16",
3
+ "version": "1.7.18",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,6 +21,9 @@ function reportCustomizer() {
21
21
  ? report.reportName
22
22
  : report.reportName.name || "";
23
23
 
24
+
25
+ writeProcessStatus();
26
+
24
27
  const { buffer: faviconBuffer, mime: faviconMime } =
25
28
  readFileAsBuffer(defaultLogoPath());
26
29
  const faviconDataUrl = `data:${faviconMime};base64,${faviconBuffer.toString("base64")}`;
@@ -28,9 +31,11 @@ function reportCustomizer() {
28
31
  if (isRemoteUrl(report.logo)) {
29
32
  return fetchRemoteLogo(report.logo)
30
33
  .catch((err) => {
34
+
31
35
  console.warn(
32
- `[artes] Warning: failed to fetch logo from "${report.logo}": ${err.message}. Falling back to default logo.`,
36
+ `\n\x1b[33m Warning: failed to fetch logo from "${report.logo}": ${err.message}. Falling back to default logo.`,
33
37
  );
38
+ console.log("\x1b[0m");
34
39
  return readFileAsBuffer(defaultLogoPath());
35
40
  })
36
41
  .then(({ buffer, mime, filename }) => {
@@ -482,4 +487,25 @@ function updateHtml(htmlPath, report, reportName, faviconDataUrl) {
482
487
  fs.writeFileSync(htmlPath, html, "utf8");
483
488
  }
484
489
 
490
+ function writeProcessStatus() {
491
+ try {
492
+ const exitCode = process.env.EXIT_CODE || "0";
493
+ const processStatus = {
494
+ exitCode: parseInt(exitCode, 10),
495
+ };
496
+
497
+ const widgetsDir = path.resolve(__dirname, "../../../../../report/widgets");
498
+
499
+ if (!fs.existsSync(widgetsDir)) {
500
+ fs.mkdirSync(widgetsDir, { recursive: true });
501
+ }
502
+
503
+ const statusFilePath = path.join(widgetsDir, "process-status.json");
504
+ fs.writeFileSync(statusFilePath, JSON.stringify(processStatus, null, 2), "utf8");
505
+ } catch (error) {
506
+ console.warn(`\n\x1b[33m Warning: failed to write process status: ${error.message}`);
507
+ console.log("\x1b[0m");
508
+ }
509
+ }
510
+
485
511
  module.exports = { reportCustomizer };
@@ -12,6 +12,9 @@ const {
12
12
  const { api } = require("../helper/stepFunctions/exporter");
13
13
  const path = require("path");
14
14
  const fs = require("fs");
15
+ require("allure-cucumberjs");
16
+ const allure = require("allure-js-commons");
17
+
15
18
 
16
19
  When("User sends GET request to {string}", async function (url) {
17
20
  await api.get(url);