Skip to content

Commit

Permalink
Merge pull request #51 from UWIT-IAM/GH-50
Browse files Browse the repository at this point in the history
[GH-50] Clear netid field before proceeding with the second test in class TestNew2FASessionAndForcedReAuth, update docker-compose call
  • Loading branch information
goulter authored Aug 2, 2024
2 parents 18769a6 + 7920c09 commit 7ec13fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 11 additions & 2 deletions tests/test_2fa_duo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -206,15 +207,23 @@ 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')
# shib_idp_session* cookies should be gone.
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
Expand Down

0 comments on commit 7ec13fc

Please sign in to comment.