From 9784c6c828a494816dfb43cfc33ca2ec5908c365 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 16 Mar 2021 18:24:31 +0100 Subject: [PATCH] tests/e2e: fix checks for ak-sidebar since ak-interface uses shadowdom now Signed-off-by: Jens Langhammer --- tests/e2e/test_flows_enroll.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_flows_enroll.py b/tests/e2e/test_flows_enroll.py index 6f09f642d..f3dad005c 100644 --- a/tests/e2e/test_flows_enroll.py +++ b/tests/e2e/test_flows_enroll.py @@ -93,7 +93,10 @@ class TestFlowsEnroll(SeleniumTestCase): self.initial_stages() - self.wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "ak-sidebar"))) + interface_admin = self.get_shadow_root("ak-interface-admin") + wait = WebDriverWait(interface_admin, self.wait_timeout) + + wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "ak-sidebar"))) self.driver.get(self.shell_url("authentik_core:user-settings")) user = User.objects.get(username="foo") @@ -188,7 +191,11 @@ class TestFlowsEnroll(SeleniumTestCase): self.driver.switch_to.window(self.driver.window_handles[0]) # We're now logged in - self.wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "ak-sidebar"))) + wait = WebDriverWait( + self.get_shadow_root("ak-interface-admin"), self.wait_timeout + ) + + wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "ak-sidebar"))) self.driver.get(self.shell_url("authentik_core:user-settings")) self.assert_user(User.objects.get(username="foo"))