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

[CI] Allow passing Selenium driver capabilities from env

parent 262b664b
No related tags found
No related merge requests found
import json
import os
from django.conf import settings
......@@ -13,6 +14,16 @@ SeleniumTestCaseBase.browsers = list(
filter(bool, os.environ.get("TEST_SELENIUM_BROWSERS", "").split(","))
)
SeleniumTestCaseBase.selenium_hub = os.environ.get("TEST_SELENIUM_HUB", "") or None
SeleniumTestCaseBase.desired_capabilities = json.loads(os.environ.get("TEST_SELENIUM_CAPABILITIES", "{}"))
_orig_get_capability = SeleniumTestCase.get_capability
def _get_capability(cls, browser):
desired_capabilities = _orig_get_capability(browser)
desired_capabilities.update(cls.desired_capabilities)
with open("/tmp/foo.log", "a") as f:
print(cls.desired_capabilities, file=f)
print(desired_capabilities, file=f)
return desired_capabilities
SeleniumTestCaseBase.get_capability = classmethod(_get_capability)
class SeleniumTests(SeleniumTestCase):
......
......@@ -21,6 +21,8 @@ setenv =
TEST_SELENIUM_HUB = {env:TEST_SELENIUM_HUB:http://127.0.0.1:4444/wd/hub}
TEST_SELENIUM_BROWSERS = {env:TEST_SELENIUM_BROWSERS:chrome,firefox}
TEST_HOST = {env:TEST_HOST:172.17.0.1}
passenv =
TEST_SELENIUM_*
[testenv:lint]
commands =
......
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