[tests] setup selenium for travis ci

django-5.0
Thomas Leichtfuß 2020-09-05 14:10:37 +02:00
parent e220e5cbe3
commit 14f5b2d26f
3 changed files with 8 additions and 2 deletions

View File

@ -44,7 +44,8 @@ matrix:
- python: "3.8"
env: REQ="Django>=3.0,<3.1"
install:
- pip install -U pip setuptools coveralls
- apt-get install firefox-geckodriver
- pip install -U pip setuptools coveralls selenium
- pip install $REQ
- pip install --editable .
script: "coverage run --source more_admin_filters/ tests/manage.py test testapp"

View File

@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from django.urls import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.firefox.options import Options
from ..management.commands.createtestdata import create_test_data
@ -12,7 +13,10 @@ class LiveFilterTest(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.selenium = WebDriver()
options = Options()
options.headless = True
cls.selenium = WebDriver(options=options)
cls.selenium.implicitly_wait(10)
@classmethod

View File

@ -19,6 +19,7 @@ deps =
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
django30: Django>=3.0,<3.1
selenium
commands = {envpython} tests/manage.py test testapp {posargs}
setenv = PYTHONPATH = .:{toxworkdir}