File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,22 @@ addons:
1111 - python-dev
1212 - libcurl4-openssl-dev
1313 - python-lxml
14+ - python-software-properties
15+ - chromium-browser
1416 firefox : " 37.0"
1517virtualenv :
1618 system_site_packages : true
1719install :
1820 - pip install -r https-everywhere-checker/requirements.txt
1921 - pip install -r test/chromium/requirements.txt
20- before_script :
21- - sh -e /etc/init.d/xvfb start
2222env :
2323 - DISPLAY=':99.0'
24+ before_script :
25+ - export DISPLAY=:99.0
26+ - sh -e /etc/init.d/xvfb start
27+ - wget https://chromedriver.storage.googleapis.com/2.12/chromedriver_linux64.zip
28+ - unzip chromedriver_linux64.zip
29+ - mv chromedriver test/chromium/chromedriver
2430script :
2531 - ./test.sh
2632sudo : false
@@ -34,4 +40,3 @@ notifications:
3440 - " irc.oftc.net#https-everywhere"
3541 on_success : change
3642 on_failure : change
37-
Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ cd $(dirname $0)/$(dirname $(readlink $0))
1010
1111./test/rules.sh
1212./test/firefox.sh $@
13- # ./test/chromium.sh $@
13+ ./test/chromium.sh $@
Original file line number Diff line number Diff line change 1010# of linux is required for the script to run correctly as well.
1111# Otherwise, use pyvirtualdisplay.
1212
13- import sys
13+ import sys , os
1414from selenium import webdriver
1515from selenium .common .exceptions import WebDriverException
1616
@@ -26,20 +26,27 @@ class bcolors:
2626
2727chromeOps = webdriver .ChromeOptions ()
2828chromeOps .add_extension (sys .argv [1 ])
29+ chromeOps .add_argument ("--disable-setuid-sandbox" )
30+
31+ chromdriver_path = "chromedriver"
32+
33+ if 'TRAVIS' in os .environ :
34+ chromeOps .add_argument ('--no-sandbox' )
35+ chromdriver_path = os .path .abspath ("test/chromium/chromedriver" )
2936
3037# First argument is optional, if not specified will search path.
3138
3239try :
33- driver = webdriver .Chrome ('chromedriver' , chrome_options = chromeOps )
40+ driver = webdriver .Chrome (chromdriver_path , chrome_options = chromeOps )
3441except WebDriverException as e :
3542 error = e .__str__ ()
3643
3744 if "executable needs to be in PATH" in e .__str__ ():
3845 print "ChromeDriver isn't installed. Check test/chrome/README.md\
39- for instructions on how to install ChromeDriver"
46+ for instructions on how to install ChromeDriver"
47+
4048 sys .exit (2 )
4149 else :
42- driver .quit ()
4350 raise e
4451
4552print '' #New line
You can’t perform that action at this time.
0 commit comments