File size: 554 Bytes
07423df |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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}'")
|