-
Notifications
You must be signed in to change notification settings - Fork 50
/
.gitlab-ci.yml
249 lines (234 loc) · 6.9 KB
/
.gitlab-ci.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
variables:
TESTRAIL_URL: "..."
USERNAME: "..."
PASSWORD: "..."
PROJECT: "..."
stages:
- execute_automated_tests
- upload_test_results
playwright_tests:
stage: execute_automated_tests
image: mcr.microsoft.com/playwright:v1.36.0-jammy
script: |
cd samples/javascript/playwright
npm install
npx playwright install-deps
npx playwright install
npx playwright test
allow_failure: true
artifacts:
when: always
paths:
- samples/javascript/playwright/test-results/
playwright_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/javascript/playwright
pip install trcli
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "test-results/junit-report.xml" \
--title "Playwright Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- playwright_tests
cypress_tests:
stage: execute_automated_tests
image: cypress/base:latest
script: |
cd samples/javascript/cypress
npm install
npx cypress run --reporter junit --reporter-options mochaFile=reports/TEST-[hash].xml
allow_failure: true
artifacts:
when: always
paths:
- samples/javascript/cypress/reports/
cypress_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/javascript/cypress
pip install trcli
junitparser merge --glob "reports/TEST-*" "reports/junit-report.xml"
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "reports/junit-report.xml" \
--title "Cypress Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- cypress_tests
junit5_selenium_tests:
stage: execute_automated_tests
image: maven:3.9.3-eclipse-temurin-11
script: |
CHROME_VERSION="113.0.5672.92-1" && \
apt-get update && \
wget -O google-chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
apt-get install -y -f ./google-chrome.deb && \
google-chrome --version && \
cd samples/java/junit5-selenium && \
mvn clean compile test
allow_failure: true
artifacts:
when: always
paths:
- samples/java/junit5-selenium/target
junit5_selenium_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/java/junit5-selenium
pip install trcli
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "target/TEST-junit-jupiter.xml" \
--title "JUnit5-Selenium Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- junit5_selenium_tests
testng_selenium_tests:
stage: execute_automated_tests
image: maven:3.9.3-eclipse-temurin-11
script: |
CHROME_VERSION="113.0.5672.92-1" && \
apt-get update && \
wget -O google-chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
apt-get install -y -f ./google-chrome.deb && \
google-chrome --version && \
cd samples/java/testng-selenium && \
mvn clean compile test
allow_failure: true
artifacts:
when: always
paths:
- samples/java/testng-selenium/reports
testng_selenium_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/java/testng-selenium
pip install trcli
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "reports/TEST-TestSuite.xml" \
--title "TestNG-Selenium Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- testng_selenium_tests
pytest_selenium_tests:
stage: execute_automated_tests
image: python:latest
script: |
CHROME_VERSION="113.0.5672.92-1" && \
apt-get update && \
wget -O google-chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
apt-get install -y -f ./google-chrome.deb && \
google-chrome --version && \
cd samples/python/pytest-selenium && \
pip install -r requirements.txt && \
pytest --junitxml "reports/junit-report.xml" "./tests"
allow_failure: true
artifacts:
when: always
paths:
- samples/python/pytest-selenium/reports
pytest_selenium_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/python/pytest-selenium
pip install trcli
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "reports/junit-report.xml" \
--title "Pytest-Selenium Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- pytest_selenium_tests
robotframework_browser_tests:
stage: execute_automated_tests
image: python:latest
script: |
apt-get update && \
apt-get install -y nodejs npm && \
CHROME_VERSION="113.0.5672.92-1" && \
wget -O google-chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
apt-get install -y -f ./google-chrome.deb && \
google-chrome --version && \
cd samples/robotframework/robotframework-browser && \
pip install -r requirements.txt && \
rfbrowser init && \
robot -d reports -x junit-report.xml "./tests"
allow_failure: true
artifacts:
when: always
paths:
- samples/robotframework/robotframework-browser/reports
robotframework_browser_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/robotframework/robotframework-browser
pip install trcli
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "reports/junit-report.xml" \
--title "RobotFramework-Browser Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- robotframework_browser_tests
nunit_tests:
stage: execute_automated_tests
image: mcr.microsoft.com/dotnet/sdk:6.0
script: |
cd samples/dotnet/nunit
dotnet build
dotnet test --logger:junit
allow_failure: true
artifacts:
when: always
paths:
- samples/dotnet/nunit/SimpleTestProject/TestResults
nunit_upload_results:
stage: upload_test_results
image: python:latest
script: |
cd samples/dotnet/nunit
pip install trcli
trcli -y \
-h "$TESTRAIL_URL" \
-u "$USERNAME" \
-p "$PASSWORD" \
--project "$PROJECT" \
parse_junit \
-f "SimpleTestProject/TestResults/TestResults.xml" \
--title "NUnit Automated Tests" \
--run-description "$CI_PIPELINE_URL"
dependencies:
- nunit_tests