-
Notifications
You must be signed in to change notification settings - Fork 3
119 lines (99 loc) · 4.64 KB
/
Copy pathselenium_browser_qa.yml
File metadata and controls
119 lines (99 loc) · 4.64 KB
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
name: Selenium Browser QA Tests
on:
push:
# TODO: enable on develop push/PR once QA tests run reliably from GH workflow
branches: [disable-selenium]
# branches: [develop]
pull_request:
branches: [disable-selenium]
# branches: [develop]
workflow_dispatch:
jobs:
build-test:
runs-on: ubuntu-latest
# services:
# selenium:
# image: selenium/standalone-chrome
steps:
- uses: actions/checkout@v2
- name: Clone QA Engine
uses: actions/checkout@v2
with:
repository: CUAHSI/QA-AutomationEngine
path: QA-AutomationEngine
ref: master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
working-directory: QA-AutomationEngine
run: pip3 install -r requirements.txt
# https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-3/.github/actions/setup-chrome/action.yml
- name: Prepare Selenium
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update -qqy
sudo apt-get -qqy install google-chrome-stable
CHROME_VERSION=$(google-chrome-stable --version)
CHROME_FULL_VERSION=${CHROME_VERSION%%.*}
CHROME_MAJOR_VERSION=${CHROME_FULL_VERSION//[!0-9]}
sudo rm /etc/apt/sources.list.d/google-chrome.list
export CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION%%.*}`
curl -L -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /usr/local/bin
export CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION%%.*}`
curl -L -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /usr/local/bin
chromedriver -version
shell: bash
# - name: Prepare Selenium
# uses: nanasess/setup-chromedriver@v1
# https://github.com/marketplace/actions/setup-chromedriver
# with:
# # Optional: do not specify to match Chrome's version
# chromedriver-version: '88.0.4324.96'
# - run: |
# export DISPLAY=:99
# chromedriver --url-base=/wd/hub &
# # sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
# - name: Prepare Firefox
# # uses: browser-actions/setup-firefox@latest
# run: sudo apt install firefox
# - name: Firefox version
# run: firefox --version
# - name: Geckodriver
# run: sudo apt install firefox-geckodriver
- name: Build DSPBack
run: make build
- name: Build DSPFront
run: make build-dspfront
- name: Startup containers
run: make up-all-d
- name: Sleep for 10 seconds
run: sleep 10s
shell: bash
# - name: Install dependencies
# run: make install
- name: Create Output Dir
working-directory: QA-AutomationEngine
run: mkdir output
- name: Run Tests
working-directory: QA-AutomationEngine
# https://dsp-alpha.criticalzone.org/ as another potential target...
run: |
./hydrotest dsp DspHydroshareTestSuite --headless --browser chrome --base https://localhost 2>&1 | tee -a output/hydroshare-browser-test-coverage.txt
./hydrotest dsp DspExternalTestSuite --headless --browser chrome --base https://localhost 2>&1 | tee -a output/external-browser-test-coverage.txt
./hydrotest dsp DspZenodoTestSuite --headless --browser chrome --base https://localhost 2>&1 | tee -a output/zenodo-browser-test-coverage.txt
./hydrotest dsp DspEarthchemTestSuite --headless --browser chrome --base https://localhost 2>&1 | tee -a output/earthchem-browser-test-coverage.txt
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: QA-ARTIFACTS
path: QA-AutomationEngine/output
- name: Check whether passing
working-directory: QA-AutomationEngine/output
run: |
grep -rh "ERROR:" .
if grep -rl "FAILED (" . >/dev/null; then grep -rh "FAIL:" . && exit 1; else grep -rh "^Ran [0-9]* test in [0-9]*\.*[0-9]*s$\n\n^OK" .; fi