haven-cypress-integration 1.1.2 → 1.1.3

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": "haven-cypress-integration",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Seamless Cypress integration with HAVEN test case management",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -13,8 +13,19 @@ const bucketName = process.env.S3_BUCKET || "your-bucket-name";
13
13
  // Paths
14
14
  const automationCasesPath = "/shared/automation-cases.json";
15
15
  const postBaseUrlPath = "/shared/result-post-url.txt";
16
+ const triggeredByPath = "/shared/triggered-by.txt";
16
17
  const baseUrl = fs.readFileSync(postBaseUrlPath, "utf-8").trim();
17
18
 
19
+ // Read triggered_by value
20
+ let triggeredBy = null;
21
+ try {
22
+ if (fs.existsSync(triggeredByPath)) {
23
+ triggeredBy = fs.readFileSync(triggeredByPath, "utf-8").trim();
24
+ }
25
+ } catch (err) {
26
+ console.warn("⚠️ Could not read triggered-by.txt:", err.message);
27
+ }
28
+
18
29
  (async () => {
19
30
  let automationIds = null;
20
31
  const formatted = [];
@@ -69,8 +80,8 @@ const baseUrl = fs.readFileSync(postBaseUrlPath, "utf-8").trim();
69
80
  typeof test.fullTitle === "string"
70
81
  ? test.fullTitle
71
82
  : Array.isArray(test.title)
72
- ? test.title.join(" ")
73
- : test.title;
83
+ ? test.title.join(" ")
84
+ : test.title;
74
85
 
75
86
  const allTags = [...(titleCombined.match(/@[\w-]+/g) || [])];
76
87
 
@@ -78,8 +89,8 @@ const baseUrl = fs.readFileSync(postBaseUrlPath, "utf-8").trim();
78
89
  test.state === "passed" || test.pass === true
79
90
  ? "pass"
80
91
  : test.pending === true
81
- ? "skipped"
82
- : "fail";
92
+ ? "skipped"
93
+ : "fail";
83
94
 
84
95
  if (!automationIds) {
85
96
  allTags
@@ -125,6 +136,7 @@ async function postResults(formattedResults, notFoundList, planId, runId) {
125
136
  runId,
126
137
  results: formattedResults,
127
138
  not_found: notFoundList,
139
+ triggered_by: triggeredBy,
128
140
  };
129
141
 
130
142
  console.log(