mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-03 21:21:14 -04:00
Merge branch 'main' of https://github.com/GSA/notifications-admin into 1216-login-gov-pre-sign-in-page
This commit is contained in:
@@ -68,12 +68,6 @@ def login_for_end_to_end_testing(browser):
|
||||
context.storage_state(path=auth_state_path)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def end_to_end_context(browser):
|
||||
context = browser.new_context()
|
||||
return context
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def end_to_end_authenticated_context(browser):
|
||||
# Create and load a previously authenticated context for Playwright E2E
|
||||
@@ -89,17 +83,25 @@ def end_to_end_authenticated_context(browser):
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def authenticated_page(end_to_end_context):
|
||||
# Open a new page and go to the staging site.
|
||||
page = end_to_end_context.new_page()
|
||||
def end_to_end_context(browser):
|
||||
context = browser.new_context()
|
||||
return context
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def authenticated_page(end_to_end_context):
|
||||
# Open a new page and go to the site.
|
||||
page = end_to_end_context.new_page()
|
||||
page.goto(f"{E2E_TEST_URI}/")
|
||||
|
||||
sign_in_button = page.get_by_role("link", name="Sign in")
|
||||
# Wait for the next page to fully load.
|
||||
page.wait_for_load_state("domcontentloaded")
|
||||
|
||||
# Sign in to the site - E2E test accounts are set to flow through.
|
||||
sign_in_button = page.get_by_role("link", name="Sign in")
|
||||
sign_in_button.click()
|
||||
|
||||
# Wait for the next page to fully load.
|
||||
page.wait_for_load_state("domcontentloaded")
|
||||
|
||||
return page
|
||||
|
||||
@@ -9,10 +9,6 @@ E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
|
||||
|
||||
def test_add_new_service_workflow(authenticated_page, end_to_end_context):
|
||||
page = authenticated_page
|
||||
page.goto(f"{E2E_TEST_URI}/")
|
||||
|
||||
# Wait for the next page to fully load.
|
||||
page.wait_for_load_state("domcontentloaded")
|
||||
|
||||
# Prepare for adding a new service later in the test.
|
||||
current_date_time = datetime.datetime.now()
|
||||
|
||||
@@ -7,7 +7,7 @@ E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
|
||||
|
||||
|
||||
def test_landing_page(end_to_end_context):
|
||||
# Open a new page and go to the staging site.
|
||||
# Open a new page and go to the site.
|
||||
page = end_to_end_context.browser.new_page()
|
||||
page.goto(f"{E2E_TEST_URI}/")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user