Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: integration test for ALLOW_NEW_USER_ON_LOGIN setting #123

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gen3-integration-tests/tests/test_data_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def test_map_uploaded_files_in_submission_page(self, page: Page):
)

# user should see 1 file ready
time.sleep(5)
time.sleep(30)
self.login_page.go_to(page)
self.submission.check_unmapped_files_submission_page(
page, text=f"1 files | 128 B"
Expand Down
23 changes: 23 additions & 0 deletions gen3-integration-tests/tests/test_login_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,26 @@ def test_login_redirects_to_requested_page_with_query_params_intact(
), f"Expected /DEV-test/search in url but got {current_url}"

self.login_page.logout(page)

def test_login_of_new_user_redirects_to_401_page(self, page: Page):
"""
Scenario: Login redirects to 401 page if user is new
and ALLOW_NEW_USER_ON_LOGIN is False
Steps:
1. Go to /login page
3. Login using dummy_new_user logging in for the first time
4. After login, page should redirect to 401 error page
"""
# Make sure ALLOW_NEW_USER_ON_LOGIN is False in Fence config:
# TODO

# Perform user login
self.login_page.login(page, user="dummy_new_user")

# Validate the user is redirected to 401 page after logging in
current_url = page.url
assert (
"/workspace" in current_url
), f"Expected /workspace in url but got {current_url}"

self.login_page.logout(page)
Loading