Try to replace Sauce Labs, so CI works for pull requests (#774).
Based on configuration at 60c73499fc/README.md
.
pull/776/head
@@ -1,13 +1,19 @@ | |||||
language: generic | language: generic | ||||
dist: xenial | dist: xenial | ||||
services: | |||||
- xvfb | |||||
addons: | addons: | ||||
sauce_connect: true | |||||
firefox: latest | |||||
before_install: | before_install: | ||||
- sudo apt-get install -y python3-pillow python3-numpy python3-pip | |||||
- sudo apt-get install -y python3-pillow python3-numpy python3-pip mesa-utils libgl1-mesa-dri libglapi-mesa libosmesa6 | |||||
- sudo pip3 install selenium | - sudo pip3 install selenium | ||||
install: | |||||
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz | |||||
- tar -xf geckodriver-v0.24.0-linux64.tar.gz | |||||
- sudo mv geckodriver /usr/local/bin | |||||
jobs: | jobs: | ||||
include: | include: | ||||
- stage: build | - stage: build | ||||
script: python3 utils/build/build.py | script: python3 utils/build/build.py | ||||
- stage: test | - stage: test | ||||
script: python3 tests/run_tests.py | |||||
script: xvfb-run -a python3 tests/run_tests.py |
@@ -33,24 +33,10 @@ thread.start() | |||||
# Create a new instance of the Firefox driver | # Create a new instance of the Firefox driver | ||||
print("Starting web driver...") | print("Starting web driver...") | ||||
if os.environ.get("TRAVIS_JOB_NUMBER"): | |||||
# Configuration for Travis CI / Sauce Labs testing | |||||
driver = webdriver.Remote( | |||||
command_executor="https://ondemand.saucelabs.com:443/wd/hub", | |||||
desired_capabilities={ | |||||
"username": os.environ["SAUCE_USERNAME"], | |||||
"accessKey": os.environ["SAUCE_ACCESS_KEY"], | |||||
"tunnel-identifier": os.environ["TRAVIS_JOB_NUMBER"], | |||||
"build": os.environ["TRAVIS_JOB_NUMBER"], | |||||
"browserName": "firefox", | |||||
"seleniumVersion": "3.141.0", | |||||
}, | |||||
) | |||||
else: | |||||
fp = webdriver.FirefoxProfile() | |||||
fp.set_preference("layout.css.devPixelsPerPx", "1.0") | |||||
driver = webdriver.Firefox(firefox_profile=fp) | |||||
driver.set_window_size(800, 600) | |||||
fp = webdriver.FirefoxProfile() | |||||
fp.set_preference("layout.css.devPixelsPerPx", "1.0") | |||||
driver = webdriver.Firefox(firefox_profile=fp) | |||||
driver.set_window_size(800, 600) | |||||
def run_tests(): | def run_tests(): | ||||