1- name : E2E Tests
1+ # Require to set secrets:
2+ # - ORG_IRS_JIRA_USERNAME
3+ # - ORG_IRS_JIRA_PASSWORD
4+ name : E2E Tests - Xray
25
36on :
7+ # triggered manually by Test Manager
8+ workflow_dispatch :
9+ inputs :
10+ jira_filter_id :
11+ description : ' Jira filter ID to fetch test scenarios'
12+ required : false
13+ # by default, we use this filter: https://jira.catena-x.net/issues/?filter=11645
14+ default : 11645
15+ # or automatically by merge to main
416 push :
517 branches : [ main ]
18+ # or in PR
619 pull_request :
720
821jobs :
922 install :
1023 runs-on : ubuntu-latest
11- container :
12- # if you need to change image please make sure use the same version in all places
13- # (here and in cypress/Dockerfile)
14- image : cypress/browsers:node16.16.0-chrome107-ff107-edge
15- options : --user 1001
16-
1724 # Install YARN dependencies, cache them correctly
1825 steps :
1926 - name : Checkout
@@ -29,10 +36,28 @@ jobs:
2936 with :
3037 cmd : install # will run `yarn install` command
3138
39+ # Fetch feature files
40+ - name : Fetch .feature files from Jira Xray
41+ env :
42+ JIRA_USERNAME : ${{ secrets.ORG_IRS_JIRA_USERNAME }}
43+ JIRA_PASSWORD : ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
44+ JIRA_FILTER_ID : ${{ github.event.inputs.jira_filter_id }}
45+ run : |
46+ ./scripts/xray-download-feature-files.sh
47+
48+ - name : Save cypress/e2e folder
49+ uses : actions/upload-artifact@v3
50+ with :
51+ name : cypress - e2e
52+ if-no-files-found : error
53+ path : cypress/e2e
54+
3255 cypress-run-chrome :
3356 timeout-minutes : 15
3457 runs-on : ubuntu-latest
3558 container :
59+ # if you need to change image please make sure use the same version in all places
60+ # (here and in cypress/Dockerfile)
3661 image : cypress/browsers:node16.16.0-chrome107-ff107-edge
3762 options : --user 1001
3863 needs : install
4166 - name : Checkout
4267 uses : actions/checkout@v3
4368
69+ - name : Download the cypress/e2e folder
70+ uses : actions/download-artifact@v3
71+ with :
72+ name : cypress - e2e
73+ path : cypress/e2e
74+
4475 - name : Use Node.js 18.x
4576 uses : actions/setup-node@v3
4677 with :
5485 wait-on-timeout : 120
5586 browser : chrome
5687
88+ - name : Submit results to Xray
89+ # we don't want to submit results to xray when it was run by PR
90+ if : github.event_name != 'pull_request' && (success() || failure())
91+ env :
92+ JIRA_USERNAME : ${{ secrets.ORG_IRS_JIRA_USERNAME }}
93+ JIRA_PASSWORD : ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
94+ run : |
95+ ./scripts/xray-push-test-results.sh
96+
5797 - name : Archive cypress artifacts
5898 if : success() || failure()
5999 uses : actions/upload-artifact@v3
67107 timeout-minutes : 15
68108 runs-on : ubuntu-latest
69109 container :
110+ # if you need to change image please make sure use the same version in all places
111+ # (here and in cypress/Dockerfile)
70112 image : cypress/browsers:node16.16.0-chrome107-ff107-edge
71113 options : --user 1001
72114 needs : install
@@ -75,6 +117,12 @@ jobs:
75117 - name : Checkout
76118 uses : actions/checkout@v3
77119
120+ - name : Download the cypress/e2e folder
121+ uses : actions/download-artifact@v3
122+ with :
123+ name : cypress - e2e
124+ path : cypress/e2e
125+
78126 - name : Use Node.js 18.x
79127 uses : actions/setup-node@v3
80128 with :
@@ -88,6 +136,15 @@ jobs:
88136 wait-on-timeout : 120
89137 browser : firefox
90138
139+ - name : Submit results to Xray
140+ # we don't want to submit results to xray when it was run by PR
141+ if : github.event_name != 'pull_request' && (success() || failure())
142+ env :
143+ JIRA_USERNAME : ${{ secrets.ORG_IRS_JIRA_USERNAME }}
144+ JIRA_PASSWORD : ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
145+ run : |
146+ ./scripts/xray-push-test-results.sh
147+
91148 - name : Archive cypress artifacts
92149 if : success() || failure()
93150 uses : actions/upload-artifact@v3
@@ -106,6 +163,12 @@ jobs:
106163 - name : Checkout
107164 uses : actions/checkout@v3
108165
166+ - name : Download the cypress/e2e folder
167+ uses : actions/download-artifact@v3
168+ with :
169+ name : cypress - e2e
170+ path : cypress/e2e
171+
109172# commented because if we use it here, we face with that problem:
110173# "http://localhost:4200 timed out on retry 151 of 5, elapsed 150449ms, limit 150000ms
111174# Error: connect ECONNREFUSED 127.0.0.1:4200"
@@ -132,6 +195,15 @@ jobs:
132195 wait-on-timeout : 120
133196 browser : webkit
134197
198+ - name : Submit results to Xray
199+ # we don't want to submit results to xray when it was run by PR
200+ if : github.event_name != 'pull_request' && (success() || failure())
201+ env :
202+ JIRA_USERNAME : ${{ secrets.ORG_IRS_JIRA_USERNAME }}
203+ JIRA_PASSWORD : ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
204+ run : |
205+ ./scripts/xray-push-test-results.sh
206+
135207 - name : Archive cypress artifacts
136208 if : success() || failure()
137209 uses : actions/upload-artifact@v3
0 commit comments