Update an example test

This commit is contained in:
Michael Mintz 2022-09-21 22:38:32 -04:00
parent e7f535895d
commit b1c305ab18
2 changed files with 22 additions and 6 deletions

View File

@ -6,11 +6,19 @@ class OverrideDriverTest(BaseCase):
def get_new_driver(self, *args, **kwargs):
"""This method overrides get_new_driver() from BaseCase."""
options = webdriver.ChromeOptions()
options.add_experimental_option(
"excludeSwitches", ["enable-automation"]
)
options.add_argument("--disable-3d-apis")
options.add_argument("--disable-notifications")
if self.headless:
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_experimental_option(
"excludeSwitches", ["enable-automation", "enable-logging"],
)
prefs = {
"credentials_enable_service": False,
"profile.password_manager_enabled": False,
}
options.add_experimental_option("prefs", prefs)
return webdriver.Chrome(options=options)
def test_simple(self):

View File

@ -191,11 +191,19 @@ class OverrideDriverTest(BaseCase):
def get_new_driver(self, *args, **kwargs):
"""This method overrides get_new_driver() from BaseCase."""
options = webdriver.ChromeOptions()
options.add_experimental_option(
"excludeSwitches", ["enable-automation"]
)
options.add_argument("--disable-3d-apis")
options.add_argument("--disable-notifications")
if self.headless:
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_experimental_option(
"excludeSwitches", ["enable-automation", "enable-logging"],
)
prefs = {
"credentials_enable_service": False,
"profile.password_manager_enabled": False,
}
options.add_experimental_option("prefs", prefs)
return webdriver.Chrome(options=options)
def test_simple(self):