This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/tests/e2e/test_flows_login.py

26 lines
1.0 KiB
Python
Raw Permalink Normal View History

2020-05-28 22:45:56 +00:00
"""test default login flow"""
2020-09-11 21:21:11 +00:00
from sys import platform
from unittest.case import skipUnless
2020-05-28 22:45:56 +00:00
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from tests.e2e.utils import USER, SeleniumTestCase, retry
2020-05-28 22:45:56 +00:00
2020-09-11 21:21:11 +00:00
@skipUnless(platform.startswith("linux"), "requires local docker")
class TestFlowsLogin(SeleniumTestCase):
2020-05-28 22:45:56 +00:00
"""test default login flow"""
@retry()
2020-05-28 22:45:56 +00:00
def test_login(self):
"""test default login flow"""
self.driver.get(f"{self.live_server_url}/flows/default-authentication-flow/")
2020-05-28 22:45:56 +00:00
self.driver.find_element(By.ID, "id_uid_field").click()
self.driver.find_element(By.ID, "id_uid_field").send_keys(USER().username)
2020-05-28 22:45:56 +00:00
self.driver.find_element(By.ID, "id_uid_field").send_keys(Keys.ENTER)
self.driver.find_element(By.ID, "id_password").send_keys(USER().username)
2020-05-28 22:45:56 +00:00
self.driver.find_element(By.ID, "id_password").send_keys(Keys.ENTER)
2020-12-05 21:08:42 +00:00
self.wait_for_url(self.shell_url("authentik_core:overview"))
2020-11-23 13:24:42 +00:00
self.assert_user(USER())