haven-cypress-integration 1.3.2 → 1.4.0

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
@@ -26,12 +26,35 @@ it("User registration @TC-AUTO-124, @p1", () => {
26
26
  });
27
27
  ```
28
28
 
29
- ### 3. Build Docker Image
29
+ ### 3. Cypress Configuration (Optional Simplification)
30
+ The library automatically configures mochawesome reporting. You can use a simplified `cypress.config.js`:
31
+
32
+ ```javascript
33
+ const { defineConfig } = require("cypress");
34
+
35
+ module.exports = defineConfig({
36
+ video: false,
37
+ e2e: {
38
+ supportFile: "cypress/support/e2e.js",
39
+ setupNodeEvents(on, config) {
40
+ // Haven-cypress automatically handles:
41
+ // - mochawesome reporter configuration
42
+ // - grep functionality for tag filtering
43
+ // - proper environment variables
44
+ return config;
45
+ },
46
+ },
47
+ });
48
+ ```
49
+
50
+ **Note**: If you prefer to keep your existing cypress.config.js with manual mochawesome configuration, that's fine too! The library will respect your settings.
51
+
52
+ ### 4. Build Docker Image
30
53
  ```bash
31
54
  npx haven-cypress build --product=BE
32
55
  ```
33
56
 
34
- ### 4. Push to ECR and Deploy to Haven
57
+ ### 5. Push to ECR and Deploy to Haven
35
58
  ```bash
36
59
  npx haven-cypress build --product=BE --push
37
60
  ```
@@ -113,6 +136,7 @@ BUILD_NUMBER=456 npx haven-cypress build --product=BE --push
113
136
 
114
137
  - ✅ **Tag-based test filtering** (`@TC-AUTO-XXXX`)
115
138
  - ✅ **Product-based organization** (ECR repository management)
139
+ - ✅ **Automatic mochawesome configuration** (no manual setup required)
116
140
  - ✅ **Mochawesome reporting** with screenshots
117
141
  - ✅ **S3 artifact upload** (reports, logs, screenshots)
118
142
  - ✅ **HAVEN API integration** (result synchronization)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haven-cypress-integration",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Seamless Cypress integration with HAVEN test case management",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require("cypress");
2
+
3
+ module.exports = defineConfig({
4
+ video: false,
5
+ // Mochawesome configuration is handled automatically by haven-cypress
6
+ // No need to configure reporter or reporterOptions manually
7
+ e2e: {
8
+ supportFile: "cypress/support/e2e.js",
9
+ setupNodeEvents(on, config) {
10
+ // Custom task logging (optional)
11
+ on("task", {
12
+ log(message) {
13
+ console.log("[cy.task] " + message);
14
+ return null;
15
+ },
16
+ });
17
+
18
+ // Haven-cypress automatically configures:
19
+ // - mochawesome reporter
20
+ // - grep functionality for tag filtering
21
+ // - proper environment variables
22
+
23
+ return config;
24
+ },
25
+ },
26
+ });
@@ -50,6 +50,9 @@ echo "💡 Final grep arg: $CYPRESS_GREP"
50
50
  eval "npx cypress run \
51
51
  --headless \
52
52
  --browser chrome \
53
+ --reporter mochawesome \
54
+ --reporter-options 'reportDir=results/mochawesome,overwrite=false,html=false,json=true,timestamp=mmddyyyy_HHMMss' \
55
+ --env grepFilterSpecs=true,grepUntagged=false,grepEnabled=true \
53
56
  $CYPRESS_GREP \
54
57
  > results/logs.txt 2>&1"
55
58
 
@@ -100,7 +103,7 @@ fi
100
103
 
101
104
  # Upload zipped report to S3
102
105
  if [ -f "${ZIP_PATH}" ]; then
103
- S3_BASE_KEY="artifact/${PLAN_ID}/automation/${RUN_ID}"
106
+ S3_BASE_KEY="artifacts/${PLAN_ID}/automation/${RUN_ID}"
104
107
  S3_ZIP_KEY="${S3_BASE_KEY}/${ZIP_NAME}"
105
108
  echo "☁️ Uploading ZIP to s3://${BUCKET_NAME}/${S3_ZIP_KEY}"
106
109
  aws s3 cp "${ZIP_PATH}" "s3://${BUCKET_NAME}/${S3_ZIP_KEY}" || echo "❌ S3 ZIP upload failed"
@@ -205,7 +205,7 @@ async function uploadLogToS3(planId, runId) {
205
205
  return null;
206
206
  }
207
207
 
208
- const key = `artifact/${planId}/automation/${runId}/run_log`;
208
+ const key = `artifacts/${planId}/automation/${runId}/run_log`;
209
209
  const fileStream = fs.createReadStream(logsPath);
210
210
 
211
211
  try {