From 887163c45ccede38938523226f9ca6ac0b13a74f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 21 Jun 2020 18:36:43 +0200 Subject: [PATCH] e2e: add more failsafe --- e2e/test_enroll_2_step.py | 2 +- e2e/test_provider_oidc.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/test_enroll_2_step.py b/e2e/test_enroll_2_step.py index e4e7dbd0f..821a6e52b 100644 --- a/e2e/test_enroll_2_step.py +++ b/e2e/test_enroll_2_step.py @@ -286,7 +286,7 @@ class TestEnroll2Step(SeleniumTestCase): self.driver.get(self.live_server_url) self.setup_test_enroll_2_step() self.wait.until( - ec.presence_of_element_located((By.CSS_SELECTOR, "[role=enroll]")) + ec.presence_of_element_located(By.CSS_SELECTOR, "[role=enroll]") ) self.driver.find_element(By.CSS_SELECTOR, "[role=enroll]").click() diff --git a/e2e/test_provider_oidc.py b/e2e/test_provider_oidc.py index 82f37dfe5..259ab5528 100644 --- a/e2e/test_provider_oidc.py +++ b/e2e/test_provider_oidc.py @@ -6,6 +6,7 @@ from oauth2_provider.generators import generate_client_id, generate_client_secre from oidc_provider.models import Client, ResponseType from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys +from selenium.webdriver.support import expected_conditions as ec from docker import DockerClient, from_env from docker.models.containers import Container @@ -217,6 +218,9 @@ class TestProviderOIDC(SeleniumTestCase): ) self.driver.find_element(By.CSS_SELECTOR, "[type=submit]").click() + self.wait.until( + ec.presence_of_element_located(By.XPATH, "//a[contains(@href, '/profile')]") + ) self.driver.find_element(By.XPATH, "//a[contains(@href, '/profile')]").click() self.assertEqual( self.driver.find_element(By.CLASS_NAME, "page-header__title").text,