fix and add som usecases

This commit is contained in:
2025-09-15 17:41:07 +08:00
parent 838806b9e3
commit 414737fd48
37 changed files with 1133 additions and 51 deletions

View File

@@ -10,8 +10,17 @@ def driver():
Initializes and returns a Chrome WebDriver instance for each test function.
Automatically quits the driver after the test function completes.
"""
# Initialize the Chrome WebDriver
driver = webdriver.Chrome()
# Configure Chrome options to disable the password manager and related pop-ups
chrome_options = webdriver.ChromeOptions()
prefs = {
"credentials_enable_service": False,
"profile.password_manager_enabled": False
}
chrome_options.add_experimental_option("prefs", prefs)
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
# Initialize the Chrome WebDriver with the specified options
driver = webdriver.Chrome(options=chrome_options)
# Maximize the browser window
driver.maximize_window()