Skip to content

Commit

Permalink
tests: Use Config object for setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler committed Jun 12, 2024
1 parent 6009e58 commit 0bee6ff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 6 additions & 2 deletions tests/test_webdriver_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
from .base import WebDriverTests
from .fake_webapp import EXAMPLE_APP

from splinter.config import Config


class TestChromeBrowser(WebDriverTests):
@pytest.fixture(autouse=True, scope="class")
def setup_browser(self, request):
request.cls.browser = get_browser("chrome", fullscreen=False)
config = Config(fullscreen=False)
request.cls.browser = get_browser("chrome", config=config)
request.addfinalizer(request.cls.browser.quit)

@pytest.fixture(autouse=True)
Expand All @@ -23,7 +26,8 @@ def visit_example_app(self, request):
class TestChromeBrowserFullscreen(WebDriverTests):
@pytest.fixture(autouse=True, scope="class")
def setup_browser(self, request):
request.cls.browser = get_browser("chrome", fullscreen=True)
config = Config(fullscreen=True)
request.cls.browser = get_browser("chrome", config=config)
request.addfinalizer(request.cls.browser.quit)

@pytest.fixture(autouse=True)
Expand Down
8 changes: 6 additions & 2 deletions tests/test_webdriver_edge_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
from .base import WebDriverTests
from .fake_webapp import EXAMPLE_APP

from splinter.config import Config


class TestEdgeChromiumBrowser(WebDriverTests):
@pytest.fixture(autouse=True, scope="class")
def setup_browser(self, request):
request.cls.browser = get_browser("edge", fullscreen=False)
config = Config(fullscreen=False)
request.cls.browser = get_browser("edge", config=config)
request.addfinalizer(request.cls.browser.quit)

@pytest.fixture(autouse=True)
Expand All @@ -23,7 +26,8 @@ def visit_example_app(self, request):
class TestEdgeChromiumBrowserFullscreen(WebDriverTests):
@pytest.fixture(autouse=True, scope="class")
def setup_browser(self, request):
request.cls.browser = get_browser("edge", fullscreen=True)
config = Config(fullscreen=True)
request.cls.browser = get_browser("edge", config=config)
request.addfinalizer(request.cls.browser.quit)

@pytest.fixture(autouse=True)
Expand Down
7 changes: 5 additions & 2 deletions tests/test_webdriver_firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
from .base import get_browser
from .base import WebDriverTests
from .fake_webapp import EXAMPLE_APP

from splinter.config import Config


class TestFirefoxBrowser(WebDriverTests):
@pytest.fixture(autouse=True, scope="class")
def setup_browser(self, request):
request.cls.browser = get_browser("firefox", fullscreen=False)
config = Config(fullscreen=False)
request.cls.browser = get_browser("firefox", config=config)
request.addfinalizer(request.cls.browser.quit)

@pytest.fixture(autouse=True)
Expand All @@ -25,7 +27,8 @@ def visit_example_app(self, request):
class TestFirefoxBrowserFullScreen(WebDriverTests):
@pytest.fixture(autouse=True, scope="class")
def setup_browser(self, request):
request.cls.browser = get_browser("firefox", fullscreen=True)
config = Config(fullscreen=True)
request.cls.browser = get_browser("firefox", config=config)
request.addfinalizer(request.cls.browser.quit)

@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 0bee6ff

Please sign in to comment.