haven-cypress-integration 1.3.3 → 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 +26 -2
- package/package.json +1 -1
- package/templates/cypress.config.js +26 -0
- package/templates/run-filtered.sh +3 -0
package/README.md
CHANGED
|
@@ -26,12 +26,35 @@ it("User registration @TC-AUTO-124, @p1", () => {
|
|
|
26
26
|
});
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
### 3.
|
|
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
|
-
###
|
|
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
|
@@ -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
|
|