async def login(browser, username, password=None):
    """filling the login form by user and pass_w parameters and initiate the login"""
    if password is None:
        password = username

    await browser.get_by_label("Username:").click()
    await browser.get_by_label("Username:").fill(username)
    await browser.get_by_label("Password:").click()
    await browser.get_by_label("Password:").fill(password)
    await browser.get_by_role("button", name="Sign in").click()
filling the login form by user and pass_w parameters and initiate the login
jupyterhub/tests/browser/test_browser.py