Browse Source

Try using Travis CI + Sauce Labs.

tags/2.5.0
Matthew Petroff 5 years ago
parent
commit
0b28a591b6
2 changed files with 28 additions and 4 deletions
  1. +11
    -0
      .travis.yml
  2. +17
    -4
      tests/run_tests.py

+ 11
- 0
.travis.yml View File

@@ -0,0 +1,11 @@
language: generic
dist: xenial
addons:
sauce_connect: true
before_install:
- sudo apt-get install -y python3-pillow python3-numpy python3-pip
- sudo pip3 install selenium
jobs:
include:
- stage: test
script: python3 tests/run_tests.py

+ 17
- 4
tests/run_tests.py View File

@@ -33,10 +33,23 @@ thread.start()

# Create a new instance of the Firefox driver
print("Starting web driver...")
fp = webdriver.FirefoxProfile()
fp.set_preference("layout.css.devPixelsPerPx", "1.0")
driver = webdriver.Firefox(firefox_profile=fp)
driver.set_window_size(800, 600)
if os.environ.get("TRAVIS_JOB_NUMBER"):
# Configuration for Travis CI / Sauce Labs testing
driver = webdriver.Remote(
command_executor="http://{}:{}@ondemand.saucelabs.com/wd/hub".format(
os.environ["SAUCE_USERNAME"], os.environ["SAUCE_ACCESS_KEY"]
),
desired_capabilities={
"tunnel-identifier": os.environ["TRAVIS_JOB_NUMBER"],
"build": os.environ["TRAVIS_JOB_NUMBER"],
"browserName": "firefox",
},
)
else:
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():


Loading…
Cancel
Save