from hac_playwright.main import keycloak_login, okta_login, okta_otp_local | |
from playwright.sync_api import Page | |
def login( | |
page: Page, | |
login_type: str, | |
username: str, | |
password: str, | |
secret: str = "", | |
): | |
if login_type == "keycloak": | |
keycloak_login(page, username, password) | |
elif login_type == "okta": | |
okta_login(page, username, password) | |
elif login_type == "okta-otp-local": | |
okta_otp_local(page, username, password, secret) | |
else: | |
raise ValueError(f"Unknown login type '{login_type}'") | |