From a62f1fb33a508fd9d4f8908f7b3d18af8d624940 Mon Sep 17 00:00:00 2001 From: Glen Goulter Date: Thu, 1 Aug 2024 11:55:17 -0700 Subject: [PATCH 1/3] Clear netid field before proceeding with the rest of the test --- tests/conftest.py | 1 + tests/test_2fa_duo.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index ddc1bc5..420976b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -296,6 +296,7 @@ def inner(current_browser: Chrome, netid: str, password: Optional[str] = default assert_success = password == default_password match_service_provider = sp_domain(match_service_provider) if match_service_provider else '' current_browser.wait_for_tag('p', 'Please sign in.') + current_browser.find_element(By.ID, "weblogin_netid").clear() current_browser.send_inputs(netid, password) current_browser.click(Locators.submit_button) if assert_success: diff --git a/tests/test_2fa_duo.py b/tests/test_2fa_duo.py index 81faae6..c2c5ada 100644 --- a/tests/test_2fa_duo.py +++ b/tests/test_2fa_duo.py @@ -101,6 +101,7 @@ def test_forced_reauth_2fa(self): sp = ServiceProviderInstance.diafine12 with self.utils.using_test_sp(sp): self.browser.get(self.sp_shib_url(sp, append='mfaforce')) + self.browser.find_element(By.ID, "weblogin_netid").clear() self.browser.send_inputs(self.netid, self.password) self.browser.click(Locators.submit_button) self.enter_duo_passcode(self.browser, match_service_provider=sp, is_this_your_device_screen=False) From 210f307957c2f16e6cb13f3826ebb8d2b384081c Mon Sep 17 00:00:00 2001 From: Glen Goulter Date: Fri, 2 Aug 2024 08:10:27 -0700 Subject: [PATCH 2/3] Look for the new cookie name is eval only til shib is released in prod. --- tests/test_2fa_duo.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_2fa_duo.py b/tests/test_2fa_duo.py index c2c5ada..8cf4c5f 100644 --- a/tests/test_2fa_duo.py +++ b/tests/test_2fa_duo.py @@ -207,7 +207,11 @@ def test_remember_me_cookie( # shib_idp_session, shib_idp_session_ss cookie_names = {cookie['name'] for cookie in fresh_browser.get_cookies()} - assert 'shib_idp_session' in cookie_names + # prod and eval are different for about a week til the new shib is released to prod. + if test_env == 'eval': + assert '__Host-shib_idp_session' in cookie_names + else: + assert 'shib_idp_session' in cookie_names assert 'shib_idp_session_ss' in cookie_names fresh_browser.get(f'{sp_url(sp)}/Shibboleth.sso/Logout?return={idp_url}/profile/Logout') @@ -215,7 +219,11 @@ def test_remember_me_cookie( fresh_browser.wait_for_tag('span', 'Your UW NetID sign-in session has ended.') cookie_names = {cookie['name'] for cookie in fresh_browser.get_cookies()} - assert 'shib_idp_session' not in cookie_names + # prod and eval are different for about a week til the new shib is released to prod. + if test_env == 'eval': + assert '__Host-shib_idp_session' not in cookie_names + else: + assert 'shib_idp_session' not in cookie_names assert 'shib_idp_session_ss' not in cookie_names sp = ServiceProviderInstance.diafine12 From 7920c09777327a96ae9aa012855f49f6dafb9ca6 Mon Sep 17 00:00:00 2001 From: Glen Goulter Date: Fri, 2 Aug 2024 08:19:02 -0700 Subject: [PATCH 3/3] docker-compose is outdated --- scripts/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index ec650ec..c33b67b 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -165,4 +165,4 @@ then add_strict_host_override "$STRICT_HOST" "$STRICT_IP" fi COMPOSE_ARGS+=" $REQUIRED_COMPOSE_ARGS" -docker-compose ${COMPOSE_ARGS} +docker compose ${COMPOSE_ARGS}