aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/conftest.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-25 22:41:14 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-25 22:41:14 +0100
commit1f6d284eda9c9d08fc3b805f751398f937961eb1 (patch)
tree23ff21379b799c7c191592e79a17fe6e8f8a5f78 /ctrack/conftest.py
parentfac76c9e24f38bdc7509e4909e5eaa842c151488 (diff)
added geckodriver to root and part way through failing users view func test
Diffstat (limited to '')
-rw-r--r--ctrack/conftest.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ctrack/conftest.py b/ctrack/conftest.py
index 4fef7a9..efbb4ef 100644
--- a/ctrack/conftest.py
+++ b/ctrack/conftest.py
@@ -1,5 +1,9 @@
+import os
+
import pytest
from django.test import RequestFactory
+from selenium import webdriver
+from selenium.webdriver.firefox.options import Options
from ctrack.organisations.models import (
Address,
@@ -58,3 +62,14 @@ def addr() -> Address:
@pytest.fixture
def request_factory() -> RequestFactory:
return RequestFactory()
+
+
+@pytest.fixture(scope="module")
+def browser(request):
+ "Provide selenium webdriver instance."
+ os.environ["PATH"] += os.pathsep + os.getcwd()
+ options = Options()
+ options.headless = True
+ browser_ = webdriver.Firefox(firefox_options=options)
+ yield browser_
+ browser_.quit()