-
Notifications
You must be signed in to change notification settings - Fork 52
89 lines (75 loc) · 2.37 KB
/
e2e-cypress-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: End to End Cypress Test
on:
push:
branches:
- zango_setup_for_cypress
# paths:
# - "frontend/**"
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout
uses: actions/checkout@v3
# Step 2: Set up python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
# Step 3: Set up Zango
- name: Set up Zango project
run: |
export UID=$(id -u)
export GID=$(id -g)
python3 setup_project.py
# Step 4: Set up Zango
- name: Start Zango project server
run: |
cd zproject
DOCKER_BUILDKIT=0 HOST_UID=$(id -u) HOST_GID=$(id -g) docker-compose build
docker-compose up
# Step 5: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
# Step 6: Install dependencies
- name: Install cypress dependencies
run: npm install
working-directory: e2e-tests
# Step 7: Run Cypress tests and record results
- name: Run Cypress tests
uses: cypress-io/github-action@v6.5.0
with:
working-directory: e2e-tests
record: true
wait-on: 'http://localhost:8080/'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Step 8: Generate Cucumber HTML Report
- name: Generate Cucumber HTML Report
run: node cucumber-html-report.js
working-directory: e2e-tests
# Step 9: Upload Cypress screenshots on failure
- name: Upload Cypress screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: e2e-tests/cypress/screenshots
if-no-files-found: ignore
# Step 10: Upload Cypress videos
- name: Upload Cypress videos
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: e2e-tests/cypress/videos
if-no-files-found: ignore
# Step 11: Upload Cucumber HTML Report
- name: Upload Cucumber HTML Report
uses: actions/upload-artifact@v3
with:
name: cucumber-html-report
path: e2e-tests/cucumber-html-report.html
if-no-files-found: ignore