Sfoglia il codice sorgente

Try using Travis CI + Sauce Labs.

tags/2.5.0
Matthew Petroff 5 anni fa
parent
commit
0b28a591b6
2 ha cambiato i file con 28 aggiunte e 4 eliminazioni
  1. +11
    -0
      .travis.yml
  2. +17
    -4
      tests/run_tests.py

+ 11
- 0
.travis.yml Vedi 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 Vedi 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():


Caricamento…
Annulla
Salva