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
|
2020-06-19 17:34:27 +00:00
|
|
|
|
2020-06-20 21:52:06 +00:00
|
|
|
from e2e.utils import USER, SeleniumTestCase
|
2020-05-28 22:45:56 +00:00
|
|
|
|
|
|
|
|
2020-09-11 21:21:11 +00:00
|
|
|
@skipUnless(platform.startswith("linux"), "requires local docker")
|
2020-06-29 19:39:04 +00:00
|
|
|
class TestFlowsLogin(SeleniumTestCase):
|
2020-05-28 22:45:56 +00:00
|
|
|
"""test default login flow"""
|
|
|
|
|
|
|
|
def test_login(self):
|
|
|
|
"""test default login flow"""
|
2020-06-19 17:34:27 +00:00
|
|
|
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()
|
2020-06-20 21:52:06 +00:00
|
|
|
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)
|
2020-06-20 21:52:06 +00:00
|
|
|
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)
|
|
|
|
self.assertEqual(
|
2020-09-28 16:17:07 +00:00
|
|
|
self.driver.find_element(By.ID, "user-settings").text, USER().username,
|
2020-05-28 22:45:56 +00:00
|
|
|
)
|