increase debug

This commit is contained in:
Kenneth Kehl
2024-08-28 10:14:31 -07:00
parent 7d1a50a5b0
commit 88af5de89d
2 changed files with 13 additions and 25 deletions

View File

@@ -151,21 +151,14 @@ def _handle_e2e_tests(redirect_url):
@main.route("/sign-in", methods=(["GET", "POST"]))
@hide_from_search_engines
def sign_in():
if True:
#if os.getenv("NOTIFY_E2E_TEST_EMAIL"):
current_app.logger.warning("E2E TESTS ARE ENABLED.")
current_app.logger.warning(
"If you are getting a 404 on signin, comment out E2E vars in .env file!"
)
user = user_api_client.get_user_by_email(os.getenv("NOTIFY_E2E_TEST_EMAIL"))
return redirect(f"http://localhost:6012/{user.email_address}")
#activate_user(user["id"])
#return redirect(url_for("main.show_accounts_or_dashboard"))
# If we have to revalidated the email, send the message
# via email and redirect to the "verify your email page"
# and don't proceed further with login
redirect_url = request.args.get("next")
if os.getenv("NOTIFY_E2E_TEST_EMAIL"):
return _handle_e2e_tests(redirect_url)
email_verify_template = _do_login_dot_gov()
if (
@@ -175,10 +168,6 @@ def sign_in():
):
return email_verify_template
redirect_url = request.args.get("next")
if os.getenv("NOTIFY_E2E_TEST_EMAIL"):
return _handle_e2e_tests(redirect_url)
if current_user and current_user.is_authenticated:
if redirect_url and is_safe_redirect_url(redirect_url):

View File

@@ -10,13 +10,12 @@ def login_for_end_to_end_testing(browser):
# Open a new page and go to the staging site.
context = browser.new_context()
page = context.new_page()
page.goto(f"{E2E_TEST_URI}/")
print(f"PAGE IN CONFTEST IS {page}")
page.goto(f"{E2E_TEST_URI}/sign-in")
sign_in_button = page.get_by_role("link", name="Sign in")
#sign_in_button = page.get_by_role("link", name="Sign in")
# Test trying to sign in.
sign_in_button.click()
#sign_in_button.click()
# Wait for the next page to fully load.
page.wait_for_load_state("domcontentloaded")
@@ -28,14 +27,14 @@ def login_for_end_to_end_testing(browser):
# See https://playwright.dev/python/docs/api/class-page#page-get-by-label
# and https://playwright.dev/python/docs/locators#locate-by-css-or-xpath
# for more information.
email_address_input = page.get_by_label("Email address")
password_input = page.get_by_label("Password")
continue_button = page.get_by_role("button", name=re.compile("Continue"))
#email_address_input = page.get_by_label("Email address")
#password_input = page.get_by_label("Password")
#continue_button = page.get_by_role("button", name=re.compile("Continue"))
# Sign in to the site.
email_address_input.fill(os.getenv("NOTIFY_E2E_TEST_EMAIL"))
password_input.fill(os.getenv("NOTIFY_E2E_TEST_PASSWORD"))
continue_button.click()
#email_address_input.fill(os.getenv("NOTIFY_E2E_TEST_EMAIL"))
#password_input.fill(os.getenv("NOTIFY_E2E_TEST_PASSWORD"))
#continue_button.click()
# Wait for the next page to fully load.
page.wait_for_load_state("domcontentloaded")