-
Notifications
You must be signed in to change notification settings - Fork 742
202 lines (199 loc) · 9.28 KB
/
selenium.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
name: Selenium Tests
on:
schedule:
- cron: '0 5 * * 1,3,5'
jobs:
test:
runs-on: ubuntu-latest
env:
TEST_ACCOUNT_12: ${{secrets.AUTOMATION_TEST_ACCOUNT_12}}
TEST_ACCOUNT_13: ${{secrets.AUTOMATION_TEST_ACCOUNT_13}}
TEST_ACCOUNT_MESSAGE_1: ${{secrets.AUTOMATION_TEST_ACCOUNT_MESSAGE_1}}
TEST_ACCOUNT_MESSAGE_2: ${{secrets.AUTOMATION_TEST_ACCOUNT_MESSAGE_2}}
TEST_ACCOUNT_MESSAGE_3: ${{secrets.AUTOMATION_TEST_ACCOUNT_MESSAGE_3}}
TEST_ACCOUNT_MESSAGE_4: ${{secrets.AUTOMATION_TEST_ACCOUNT_MESSAGE_4}}
TEST_ACCOUNT_MESSAGE_5: ${{secrets.AUTOMATION_TEST_ACCOUNT_MESSAGE_5}}
TEST_ACCOUNT_MESSAGE_6: ${{secrets.AUTOMATION_TEST_ACCOUNT_MESSAGE_6}}
TEST_ACCOUNT_SPECIAL_CHARS: ${{secrets.AUTOMATION_TEST_ACCOUNT_SPECIAL_CHARS}}
TEST_ACCOUNTS_PS: ${{secrets.AUTOMATION_ACCOUNTS_PASSWORD}}
TEST_ACCOUNT_MODERATOR: ${{secrets.AUTOMATION_MODERATOR_ACCOUNT}}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
sudo apt-get update
pip3 install --user poetry
poetry install
- name: Start Selenoid container
working-directory: selenium_tests/docker/
run: |
docker pull selenoid/firefox:latest
docker pull selenoid/chrome:latest
docker-compose build
docker-compose up -d
- name: Run Homepage tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m homePageTests -n 2 --reruns 2 --browser firefox --html=reports/firefox_homepage_tests_report.html --capture=tee-sys
- name: Run Homepage tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m homePageTests -n 2 --reruns 2 --browser chrome --html=reports/chrome_homepage_tests_report.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run Top-Navbar tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m topNavbarTests -n 2 --reruns 2 --browser firefox --html=reports/firefox_top_navbar_tests_report.html --capture=tee-sys
- name: Run Top-Navbar tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m topNavbarTests -n 2 --reruns 2 --browser chrome --html=reports/chrome_top_navbar_tests_report.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run Footer tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m footerSectionTests -n 2 --reruns 2 --browser firefox --html=reports/firefox_footer_tests_report.html --capture=tee-sys
- name: Run Footer tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m footerSectionTests -n 2 --reruns 2 --browser chrome --html=reports/chrome_footer_tests_report.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run Contribute Pages tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m contributePagesTests -n 2 --reruns 2 --browser firefox --html=reports/firefox_contribute_page_tests_report.html --capture=tee-sys
- name: Run Contribute Page tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m contributePagesTests -n 2 --reruns 2 --browser chrome --html=reports/chrome_contribute_page_tests_report.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run Messaging System Tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m messagingSystem -n 2 --reruns 2 --browser firefox --html=reports/firefox_messaging_system_tests_report.html --capture=tee-sys
- name: Run Messaging System Tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m messagingSystem -n 2 --reruns 2 --browser chrome --html=reports/chrome_messaging_system_tests_report.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run User Contribution Page Tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userContributionTests -n 2 --reruns 2 --browser firefox --html=reports/firefox_user_contribution_tests.html --capture=tee-sys
- name: Run User Contribution Page Tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userContributionTests -n 2 --reruns 2 --browser chrome --html=reports/chrome_user_contribution_tests.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run User Page Tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userPageTests -n 2 --reruns 2 --browser firefox --html=reports/firefox_user_page_tests.html --capture=tee-sys
- name: Run User Page Tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userPageTests -n 2 --reruns 2 --browser chrome --html=reports/chrome_user_page_tests.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run User Settings Tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userSettings -n 2 --reruns 2 --browser firefox --html=reports/firefox_user_settings_page_tests.html --capture=tee-sys
- name: Run User Settings Tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userSettings -n 2 --reruns 2 --browser chrome --html=reports/chrome_user_settings_page_tests.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run User Profile Tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userProfile -n 2 --reruns 2 --browser firefox --html=reports/firefox_user_profile_page_tests.html --capture=tee-sys
- name: Run User Profile Tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userProfile -n 2 --reruns 2 --browser chrome --html=reports/chrome_user_profile_page_tests.html --capture=tee-sys
- name: Restart Selenoid container
working-directory: selenium_tests/docker/
if: success() || failure()
run: |
docker compose restart
- name: Run User Questions Tests (Firefox)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userQuestions -n 2 --reruns 2 --browser firefox --html=reports/firefox_user_questions_page_tests.html --capture=tee-sys
- name: Run User Questions Tests (Chrome)
working-directory: selenium_tests/
if: success() || failure()
run: |
poetry run pytest -m userQuestions -n 2 --reruns 2 --browser chrome --html=reports/chrome_user_questions_page_tests.html --capture=tee-sys
- name: Stop Selenoid containers
if: success() || failure()
working-directory: selenium_tests/docker/
run: |
docker-compose down
- name: Combine Reports
working-directory: selenium_tests/
if: success() || failure()
run: |
cat reports/*.html > reports/combined_report.html
- name: Upload the combined test report as artifact
if: success() || failure()
uses: actions/upload-artifact@v2
with:
name: Selenium test report
path: |
selenium_tests/reports/