mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-07 07:38:20 +00:00
Fix chromedriver issues, and run headless on travis (#310)
* Fix chromedriver issues, and run headless on travis * Explicitly set chrome window size * Use travis chrome * Try chrome beta * Update chromedriver * Remove virtual display from travis config
This commit is contained in:
15
.travis.yml
15
.travis.yml
@@ -1,24 +1,13 @@
|
|||||||
sudo: true
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
"3.6"
|
"3.6"
|
||||||
cache: pip
|
cache: pip
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
chrome: beta
|
||||||
sources:
|
|
||||||
- google-chrome
|
|
||||||
packages:
|
|
||||||
- google-chrome-stable
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- "export DISPLAY=:99.0"
|
|
||||||
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- wget http://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip
|
- wget http://chromedriver.storage.googleapis.com/2.32/chromedriver_linux64.zip
|
||||||
- unzip chromedriver_linux64.zip
|
- unzip chromedriver_linux64.zip
|
||||||
- export PATH=$PATH:$(pwd)
|
- export PATH=$PATH:$(pwd)
|
||||||
- chmod +x chromedriver
|
- chmod +x chromedriver
|
||||||
|
|||||||
@@ -26,9 +26,13 @@ from django.conf import settings
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def create_browser():
|
def create_browser():
|
||||||
driver = webdriver.Chrome()
|
options = webdriver.ChromeOptions()
|
||||||
driver.maximize_window()
|
options.add_argument("--window-size=1920,1080")
|
||||||
|
if os.environ.get('CI', False):
|
||||||
|
options.add_argument("--headless")
|
||||||
|
driver = webdriver.Chrome(chrome_options=options)
|
||||||
return driver
|
return driver
|
||||||
|
|
||||||
class UserRegistrationTest(LiveServerTestCase):
|
class UserRegistrationTest(LiveServerTestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user