-
Notifications
You must be signed in to change notification settings - Fork 763
94 lines (86 loc) · 3.7 KB
/
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
name: SeleniumLibrary CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: [3.8, 3.12] # pypy-3.9
rf-version: [6.1.1, 7.0.1]
selenium-version: [4.21.0, 4.22.0, 4.23.1, 4.24.0]
browser: [firefox, chrome, headlesschrome] #edge
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} with Robot Framework ${{ matrix.rf-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: latest
id: setup-chrome
- run: |
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
${{ steps.setup-chrome.outputs.chrome-path }} --version
- name: Setup firefox
id: setup-firefox
uses: browser-actions/setup-firefox@v1
with:
firefox-version: latest
- run: |
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }}
${{ steps.setup-firefox.outputs.firefox-path }} --version
- name: Start xvfb
run: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
- name: Install dependencies
if: matrix.python-version != 'pypy-3.7'
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install dependencies for pypy
if: matrix.python-version == 'pypy-3.9'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install robotstatuschecker>=1.4
pip install requests robotframework-pabot
- name: Install Seleninum v${{ matrix.selenium-version }}
run: |
pip install --upgrade selenium==${{ matrix.selenium-version }}
- name: Install RF ${{ matrix.rf-version }}
run: |
pip install -U --pre robotframework==${{ matrix.rf-version }}
- name: Install drivers via selenium-manager
run: |
SELENIUM_MANAGER_EXE=$(python -c 'from selenium.webdriver.common.selenium_manager import SeleniumManager; sm=SeleniumManager(); print(f"{str(sm._get_binary())}")')
echo "$SELENIUM_MANAGER_EXE"
echo "WEBDRIVERPATH=$($SELENIUM_MANAGER_EXE --browser chrome --debug | awk '/INFO[[:space:]]Driver path:/ {print $NF;exit}')" >> "$GITHUB_ENV"
echo "$WEBDRIVERPATH"
- name: Generate stub file for ${{ matrix.python-version }}
if: matrix.python-version != 'pypy-3.9'
run: |
invoke gen-stub
# Temporarily ignoring pypy execution
- name: Run tests with headless Chrome and with PyPy
if: startsWith( matrix.python-version, 'pypy') == true
run: |
xvfb-run --auto-servernum python atest/run.py --nounit --zip headlesschrome
- name: Run tests with ${{ matrix.browser }} if CPython
if: startsWith( matrix.python-version, 'pypy') == false
run: |
xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }}
# - name: Run tests with Selenium Grid
# if: matrix.python-version == '3.11' && matrix.rf-version == '3.2.2' && matrix.python-version != 'pypy-3.9'
# run: |
# wget --no-verbose --output-document=./selenium-server-standalone.jar http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
# sudo chmod u+x ./selenium-server-standalone.jar
# xvfb-run --auto-servernum python atest/run.py --zip headlesschrome --grid True
- uses: actions/upload-artifact@v1
if: failure()
with:
name: SeleniumLibrary Test results
path: atest/zip_results