Skip to content
Snippets Groups Projects
Verified Commit 9dca20c3 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

[CI] Improve configuration of Selenium tests

* Use implicit skip of SeleniumTestCase if no browsers are selected
* Allow selecting browsers from TEST_SELENIUM_BROWSERS environment variable
* Allow defining listen address and HTTP host separately
parent 7b36ae3c
No related branches found
No related tags found
No related merge requests found
Pipeline #335 passed
......@@ -5,14 +5,11 @@ import pytest
from django.test.selenium import SeleniumTestCase
if not os.environ.get('TEST_SELENIUM_HUB', None):
pytest.skip('Selenium hub not defined.', allow_module_level=True)
class SeleniumTests(SeleniumTestCase):
external_host = os.environ.get('TEST_LISTEN_ADDRESS', '127.0.0.1')
browsers = ['chrome', 'firefox']
selenium_hub = 'http://%s/wd/hub' % os.environ.get('TEST_SELENIUM_HUB', '127.0.0.1:4444')
host = os.environ.get('TEST_LISTEN_ADDRESS', '') or '127.0.0.1'
external_host = os.environ.get('TEST_HOST', '') or None
browsers = list(filter(bool, os.environ.get('TEST_SELENIUM_BROWSERS', '').split(',')))
selenium_hub = 'http://%s/wd/hub' % os.environ.get('TEST_SELENIUM_HUB', '') or '127.0.0.1:4444'
@classmethod
def _screenshot(cls, filename):
......
......@@ -9,8 +9,10 @@ skip_install = true
commands = pytest --pylama --cov=biscuit biscuit/core/
setenv =
TEST_SCREENSHOT_PATH = {env:TEST_SCREENSHOT_PATH:}
TEST_SELENIUM_HUB = {env:TEST_SELENIUM_HUB:}
TEST_SELENIUM_HUB = {env:TEST_SELENIUM_HUB:127.0.0.1:4444}
TEST_SELENIUM_BROWSERS = {env:TEST_SELENIUM_BROWSERS:}
TEST_LISTEN_ADDRESS = {env:TEST_LISTEN_ADDRESS:127.0.0.1}
TEST_HOST = {env:TEST_HOST:}
[pylama]
linters = pycodestyle,pyflakes,radon
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment