diff --git a/selenium_test/test/test_initializer.py b/selenium_test/test/test_initializer.py index 75e23e59d..0f64a21d6 100644 --- a/selenium_test/test/test_initializer.py +++ b/selenium_test/test/test_initializer.py @@ -11,7 +11,7 @@ class Browser(enum.Enum): firefox = "Firefox" chrome = "Chrome" -class TestInitializer(object): +class TestInitializer: def getDefaultDriver(self, headless=False, browser="Firefox"): driver = self.getDriver(headless, browser) @@ -28,22 +28,17 @@ def getDriver(self, headless=False, browser="Firefox"): print('Browser: ' + browser) if Browser.firefox.value == browser: - browser_opts = webdriver.firefox.options.Options - options = self.setHeadless(browser_opts, headless) + options = webdriver.firefox.options.Options() + options.headless = headless driver = webdriver.Firefox(options=options) elif Browser.chrome.value == browser: - browser_opts = webdriver.chrome.options.Options - options = self.setHeadlessChrome(browser_opts, headless) + options = webdriver.chrome.options.Options() + options.headless = headless driver = webdriver.Chrome(chrome_options=options) return driver - def setHeadless(self, browser_opts, headless): - options = browser_opts() - options.headless = headless - return options - # This just replaces the current database with a copy. # TODO Should use Django unit tests that run selenium. def recreateDatabase(self):