diff --git a/app/__init__.py b/app/__init__.py index 4d89cd59e..369d9db3d 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -141,6 +141,10 @@ def _csp(config): logo_domain = config["LOGO_CDN_DOMAIN"] return { "default-src": ["'self'", asset_domain], + "frame-src": [ + "https://www.youtube.com", + "https://www.youtube-nocookie.com", + ], "frame-ancestors": "'none'", "form-action": "'self'", "script-src": [ diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index fe69089a2..78482c1bb 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -237,6 +237,20 @@ td.table-empty-message { background-position: 0; } +.folder-heading-template { + background: url(../img/material-icons/wysiwyg.svg) no-repeat; + padding-left: units(4); + display: inline-block; + background-position: 0; +} + +.folder-heading-template { + background: url(../img/material-icons/wysiwyg.svg) no-repeat; + padding-left: units(4); + display: inline-block; + background-position: 0; +} + .usa-checkbox .usa-checkbox__label { + a.template-list-folder { margin-left: units(4); @@ -272,6 +286,7 @@ td.table-empty-message { margin-bottom: units(2); .usa-form-group { @include u-width('mobile-lg'); + margin-top: units(2); } input#search { width: 100%; @@ -407,6 +422,11 @@ td.table-empty-message { background-image: url(../img/material-icons/description.svg); } } + .get-started { + border: 1px solid color('gray-90'); + padding: units(2); + margin-bottom: units(4); + } } .dashboard-table { @@ -983,3 +1003,11 @@ li.linked-card:hover svg, } } } + +// Send message flow + +#breadcrumb-template-folders, +#nav-service-nav span { + font-size: units(3); + font-weight: bold; +} diff --git a/app/main/views/index.py b/app/main/views/index.py index 80646ac66..4478f225c 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -278,6 +278,13 @@ def guidance_index(): ) +@main.route("/contact") +def contact(): + return render_template( + "views/contact.html", + ) + + @main.route("/about") def about_notify(): return render_template( diff --git a/app/main/views/send.py b/app/main/views/send.py index 3d83d10f3..a6601840d 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -739,7 +739,7 @@ def all_placeholders_in_session(placeholders): def get_send_test_page_title(template_type, entering_recipient, name=None): if entering_recipient: - return "Send ‘{}’".format(name) + return "Select recipients" return "Personalize this message" diff --git a/app/main/views/sub_navigation_dictionaries.py b/app/main/views/sub_navigation_dictionaries.py index 603094cd1..16991297a 100644 --- a/app/main/views/sub_navigation_dictionaries.py +++ b/app/main/views/sub_navigation_dictionaries.py @@ -114,4 +114,8 @@ def about_notify_nav(): }, ], }, + { + "name": "Contact", + "link": "main.contact", + }, ] diff --git a/app/templates/base.html b/app/templates/base.html index b2b6639e9..0348832bd 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -6,9 +6,7 @@ - {% block pageTitle %} - {% block per_page_title %}{% endblock %} – Notify.gov - {% endblock %} + {% block pageTitle %}{% block per_page_title %}{% endblock %} – Notify.gov{% endblock %} {% include "components/head.html" %} diff --git a/app/templates/components/folder-path.html b/app/templates/components/folder-path.html index b6615a2da..976253ee3 100644 --- a/app/templates/components/folder-path.html +++ b/app/templates/components/folder-path.html @@ -4,9 +4,9 @@ template_type, current_user, link_current_item=False, - root_element='h1' + root_element='nav' ) %} - <{{ root_element }} class="font-body-lg folder-heading margin-bottom-0"{% if root_element == 'h1' %} id="page-header"{% endif %}> + <{{ root_element }} id="breadcrumb-template-folders" class="navigation-service usa-breadcrumb padding-top-0 padding-bottom-05" aria-label="Template folder path"> {% for folder in folders %} {% if loop.last and not link_current_item %} {% if folder.template_type or not folder.id %} diff --git a/app/templates/components/live-search.html b/app/templates/components/live-search.html index 9df46fd1a..58683e957 100644 --- a/app/templates/components/live-search.html +++ b/app/templates/components/live-search.html @@ -17,7 +17,7 @@ {% endif %} {% if show %} - diff --git a/app/templates/views/about/about.html b/app/templates/views/about/about.html index 17180cef7..f699f9b19 100644 --- a/app/templates/views/about/about.html +++ b/app/templates/views/about/about.html @@ -23,8 +23,7 @@

Notify.gov is an easy-to-use, web-based platform. It requires no technical expertise or system integration — users can create an account and get started within minutes. We take the security and privacy of messaging data seriously by minimizing data retention and using modern encryption methods.

- -

Product Highlights

+

Product Highlights

{% set product_highlights = [ { "svg_src": "#send", diff --git a/app/templates/views/contact.html b/app/templates/views/contact.html new file mode 100644 index 000000000..a2cd4f9c7 --- /dev/null +++ b/app/templates/views/contact.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% set page_title = "Contact" %} + +{% block per_page_title %}{{page_title}}{% endblock %} + +{% block content_column_content %} +
+

{{page_title}}

+

Is your organization interested in using Notify.gov? Find more information at Join + Notify or contact us at tts-notify@gsa.gov.

+

You can expect a response within one business day.

+
+
+
+

If you are a current Notify.gov partner and have technical issues or questions, we are available at notify-support@gsa.gov

+
+
+
+
+{% endblock %} diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index f4430e566..04abe1afc 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -13,7 +13,7 @@ -
+

Dashboard

{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %} @@ -22,7 +22,7 @@ {{ ajax_block(partials, updates_url, 'upcoming') }} -

{{ current_service.name }} Dashboard

+

{{ current_service.name }} Dashboard

{{ ajax_block(partials, updates_url, 'inbox') }} diff --git a/app/templates/views/dashboard/write-first-messages.html b/app/templates/views/dashboard/write-first-messages.html index 2d2e30e75..50dc23fec 100644 --- a/app/templates/views/dashboard/write-first-messages.html +++ b/app/templates/views/dashboard/write-first-messages.html @@ -1,4 +1,6 @@ -

Get started

- - Create your first template - + diff --git a/app/templates/views/notifications/preview.html b/app/templates/views/notifications/preview.html index 5c702a386..d0be74aed 100644 --- a/app/templates/views/notifications/preview.html +++ b/app/templates/views/notifications/preview.html @@ -10,7 +10,7 @@ {% elif help %} {{ "Example text message" }} {% else %} - {{ "Preview" }} + {{ "Preview for sending" }} {% endif %} {% endblock %} @@ -50,7 +50,7 @@ {% endcall %}
{% else %} - {{ page_header("Example text message" if help else "Preview") }} + {{ page_header("Example text message" if help else "Preview for sending") }} {% endif %} {% if not help %} diff --git a/app/templates/views/templates/choose.html b/app/templates/views/templates/choose.html index 964ab10dc..281374c37 100644 --- a/app/templates/views/templates/choose.html +++ b/app/templates/views/templates/choose.html @@ -1,4 +1,4 @@ -{% from "components/folder-path.html" import folder_path, page_title_folder_path %} +{% from "components/folder-path.html" import folder_path %} {% from "components/pill.html" import pill %} {% from "components/live-search.html" import live_search %} {% from "components/form.html" import form_wrapper %} @@ -8,11 +8,9 @@ {% extends "withnav_template.html" %} -{% set page_title = 'Templates' %} +{% set page_title = 'Select or create a template' %} -{% block service_page_title %} - {{ page_title_folder_path(template_folder_path) }} -{% endblock %} +{% block service_page_title %}{{page_title}}{% endblock %} {% block maincolumn_content %} @@ -34,14 +32,11 @@ {% else %}
+

{{page_title}}

-
-
-

- Every message starts with a template. To send, choose or create a template. -

-
-
+

+ Every message starts with a template. To send, choose or create a template. +

{{ folder_path( folders=template_folder_path, service_id=current_service.id, diff --git a/app/templates/views/templates/manage-template-folder.html b/app/templates/views/templates/manage-template-folder.html index 528631f2e..42a3cbf7c 100644 --- a/app/templates/views/templates/manage-template-folder.html +++ b/app/templates/views/templates/manage-template-folder.html @@ -3,9 +3,9 @@ {% from "components/page-footer.html" import page_footer %} {% from "components/form.html" import form_wrapper %} -{% block service_page_title %} - {{ page_title_folder_path(template_folder_path) }} -{% endblock %} +{% set page_title = 'Select or create a template' %} + +{% block service_page_title %}{{page_title}}{% endblock %} {% block maincolumn_content %} diff --git a/app/templates/views/templates/template.html b/app/templates/views/templates/template.html index d7dbf94ae..f04f9f490 100644 --- a/app/templates/views/templates/template.html +++ b/app/templates/views/templates/template.html @@ -1,13 +1,13 @@ {% extends "withnav_template.html" %} {% from "components/banner.html" import banner_wrapper %} -{% from "components/folder-path.html" import folder_path, page_title_folder_path %} +{% from "components/folder-path.html" import folder_path %} {% from "components/page-footer.html" import page_footer %} {% from "components/copy-to-clipboard.html" import copy_to_clipboard %} {% from "components/components/button/macro.njk" import usaButton %} -{% block service_page_title %} - {{ page_title_folder_path(current_service.get_template_path(template._template)) }} -{% endblock %} +{% set page_title = 'Confirm your template' %} + +{% block service_page_title %}{{page_title}}{% endblock %} {% block maincolumn_content %} @@ -32,8 +32,8 @@ {% else %}
-

- Review your message +

+ {{page_title}}

{{ folder_path( folders=current_service.get_template_path(template._template), diff --git a/app/templates/withnav_template.html b/app/templates/withnav_template.html index eb6a42244..d7a249562 100644 --- a/app/templates/withnav_template.html +++ b/app/templates/withnav_template.html @@ -1,12 +1,7 @@ {% extends "base.html" %} -{% block per_page_title %} - {% if current_org.name %} - {% block org_page_title %}{% endblock %} – {{ current_org.name }} - {% else %} - {% block service_page_title %}{% endblock %} – {{ current_service.name }} - {% endif %} -{% endblock %} +{% block per_page_title %}{% if current_org.name %}{% block org_page_title %}{% endblock %} – {{ current_org.name }}{% + else %}{% block service_page_title %}{% endblock %} – {{ current_service.name }}{% endif %}{% endblock %} {% block main %}
diff --git a/tests/app/main/views/test_accept_invite.py b/tests/app/main/views/test_accept_invite.py index 59c4651c6..ef5e56fda 100644 --- a/tests/app/main/views/test_accept_invite.py +++ b/tests/app/main/views/test_accept_invite.py @@ -269,7 +269,7 @@ def test_invite_goes_in_session( ("user", "landing_page_title"), [ (create_active_user_with_permissions(), "Dashboard"), - (create_active_caseworking_user(), "Templates"), + (create_active_caseworking_user(), "Select or create a template"), ], ) def test_accepting_invite_removes_invite_from_session( diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 1d8e696f8..806474c49 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -1253,7 +1253,7 @@ def test_send_one_off_has_correct_page_title( step_index=0, _follow_redirects=True, ) - assert page.h1.text.strip() == "Send ‘Two week reminder’" + assert page.h1.text.strip() == "Select recipients" assert len(page.select(".banner-tour")) == 0 @@ -2712,7 +2712,7 @@ def test_preview_notification_shows_preview( template_id=fake_uuid, _expected_status=200, ) - assert page.h1.text.strip() == "Preview" + assert page.h1.text.strip() == "Preview for sending" assert (page.find_all("a", {"class": "usa-back-link"})[0]["href"]) == url_for( "main.check_notification", service_id=service_one["id"], diff --git a/tests/app/main/views/test_template_folders.py b/tests/app/main/views/test_template_folders.py index 0bf2fcb08..bb31c8f41 100644 --- a/tests/app/main/views/test_template_folders.py +++ b/tests/app/main/views/test_template_folders.py @@ -41,8 +41,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): @pytest.mark.parametrize( ( - "expected_title_tag", "expected_page_title", + "expected_title_tag", "expected_parent_link_args", "extra_args", "expected_nav_links", @@ -53,8 +53,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): ), [ ( - "Templates – service one – Notify.gov", - "Templates", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [], {}, ["Email", "Text message"], @@ -92,8 +92,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "Templates – service one – Notify.gov", - "Templates", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [], {"template_type": "all"}, ["Email", "Text message"], @@ -131,8 +131,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "Templates – service one – Notify.gov", - "Templates", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [], {"template_type": "sms"}, ["All", "Email"], @@ -159,8 +159,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "folder_one – Templates – service one – Notify.gov", - "Templates folder_one", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [{"template_type": "all"}], {"template_folder_id": PARENT_FOLDER_ID}, ["Email", "Text message"], @@ -182,8 +182,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "folder_one – Templates – service one – Notify.gov", - "Templates folder_one", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [{"template_type": "sms"}], {"template_type": "sms", "template_folder_id": PARENT_FOLDER_ID}, ["All", "Email"], @@ -199,8 +199,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "folder_one – Templates – service one – Notify.gov", - "Templates folder_one", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [{"template_type": "email"}], {"template_type": "email", "template_folder_id": PARENT_FOLDER_ID}, ["All", "Text message"], @@ -210,8 +210,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): "There are no email templates in this folder", ), ( - "folder_one_one – folder_one – Templates – service one – Notify.gov", - "Templates folder_one folder_one_one", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [ {"template_type": "all"}, {"template_type": "all", "template_folder_id": PARENT_FOLDER_ID}, @@ -229,8 +229,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "folder_one_one_one – folder_one_one – folder_one – Templates – service one – Notify.gov", - "Templates folder_one folder_one_one folder_one_one_one", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [ {"template_type": "all"}, {"template_type": "all", "template_folder_id": PARENT_FOLDER_ID}, @@ -250,8 +250,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): None, ), ( - "folder_one_one_one – folder_one_one – folder_one – Templates – service one – Notify.gov", - "Templates folder_one folder_one_one folder_one_one_one", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [ {"template_type": "email"}, {"template_type": "email", "template_folder_id": PARENT_FOLDER_ID}, @@ -268,8 +268,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): "There are no email templates in this folder", ), ( - "folder_two – Templates – service one – Notify.gov", - "Templates folder_two", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [{"template_type": "all"}], {"template_folder_id": FOLDER_TWO_ID}, ["Email", "Text message"], @@ -279,8 +279,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): "This folder is empty", ), ( - "folder_two – Templates – service one – Notify.gov", - "Templates folder_two", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [{"template_type": "sms"}], {"template_folder_id": FOLDER_TWO_ID, "template_type": "sms"}, ["All", "Email"], @@ -290,8 +290,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): "This folder is empty", ), ( - "folder_two – Templates – service one – Notify.gov", - "Templates folder_two", + "Select or create a template – service one – Notify.gov", + "Select or create a template", [{"template_type": "all"}], {"template_folder_id": FOLDER_TWO_ID, "template_type": "all"}, ["Email", "Text message"], @@ -346,12 +346,13 @@ def test_should_show_templates_folder_page( **extra_args, ) - assert normalize_spaces(page.select_one("title").text) == expected_title_tag - assert normalize_spaces(page.select_one("h1").text) == expected_page_title + assert normalize_spaces(page.select_one("title").text) == expected_page_title + assert normalize_spaces(page.select_one("h1").text) == expected_title_tag - assert len(page.select("h1 a")) == len(expected_parent_link_args) + # remove this line if you don't want the breadcrumb on the first page + assert len(page.select("nav#breadcrumb-template-folders a")) == len(expected_parent_link_args) - for index, parent_link in enumerate(page.select("h1 a")): + for index, parent_link in enumerate(page.select("nav#breadcrumb-template-folders a")): assert parent_link["href"] == url_for( "main.choose_template", service_id=SERVICE_ONE_ID, @@ -529,7 +530,7 @@ def test_get_manage_folder_page( _test_page_title=False, ) assert normalize_spaces(page.select_one("title").text) == ( - "folder_two – Templates – service one – Notify.gov" + "Select or create a template – service one – Notify.gov" ) assert page.select_one("input[name=name]")["value"] == "folder_two" delete_link = page.find("a", string="Delete this folder") @@ -571,7 +572,7 @@ def test_get_manage_folder_viewing_permissions_for_users( _test_page_title=False, ) assert normalize_spaces(page.select_one("title").text) == ( - "folder_two – Templates – service one – Notify.gov" + "Select or create a template – service one – Notify.gov" ) form_labels = page.select("legend.usa-legend") assert ( @@ -634,7 +635,7 @@ def test_get_manage_folder_viewing_permissions_for_users_not_visible_when_no_man _test_page_title=False, ) assert normalize_spaces(page.select_one("title").text) == ( - "folder_two – Templates – service one – Notify.gov" + "Select or create a template – service one – Notify.gov" ) form_labels = page.select("legend[class=form-label]") assert len(form_labels) == 0 @@ -671,7 +672,7 @@ def test_get_manage_folder_viewing_permissions_for_users_not_visible_for_service _test_page_title=False, ) assert normalize_spaces(page.select_one("title").text) == ( - "folder_two – Templates – service one – Notify.gov" + "Select or create a template – service one – Notify.gov" ) form_labels = page.select("legend[class=form-label]") assert len(form_labels) == 0 diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 6e2ff227d..68ec6f219 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -69,7 +69,7 @@ def test_should_show_empty_page_when_no_templates( service_id=service_one["id"], ) - assert normalize_spaces(page.select_one("h1").text) == ("Templates") + assert normalize_spaces(page.select_one("h1").text) == ("Select or create a template") assert normalize_spaces(page.select_one("main p").text) == (expected_message) assert page.select_one("#add_new_folder_form") assert page.select_one("#add_new_template_form") @@ -87,7 +87,7 @@ def test_should_show_add_template_form_if_service_has_folder_permission( service_id=service_one["id"], ) - assert normalize_spaces(page.select_one("h1").text) == ("Templates") + assert normalize_spaces(page.select_one("h1").text) == ("Select or create a template") assert normalize_spaces(page.select_one("main p").text) == ( "Every message starts with a template. You can change it later. " "You need a template before you can send messages." @@ -110,7 +110,7 @@ def test_should_show_add_template_form_if_service_has_folder_permission( [ ( create_active_user_view_permissions(), - "Templates", + "Select or create a template", {}, ["Email", "Text message"], [ @@ -122,21 +122,21 @@ def test_should_show_add_template_form_if_service_has_folder_permission( ), ( create_active_user_view_permissions(), - "Templates", + "Select or create a template", {"template_type": "sms"}, ["All", "Email"], ["sms_template_one", "sms_template_two"], ), ( create_active_user_view_permissions(), - "Templates", + "Select or create a template", {"template_type": "email"}, ["All", "Text message"], ["email_template_one", "email_template_two"], ), ( create_active_caseworking_user(), - "Templates", + "Select or create a template", {}, ["Email", "Text message"], [ @@ -148,7 +148,7 @@ def test_should_show_add_template_form_if_service_has_folder_permission( ), ( create_active_caseworking_user(), - "Templates", + "Select or create a template", {"template_type": "email"}, ["All", "Text message"], ["email_template_one", "email_template_two"], @@ -581,9 +581,9 @@ def test_should_be_able_to_view_a_template_with_links( _test_page_title=False, ) - assert normalize_spaces(page.select_one("h1").text) == ("Review your message") + assert normalize_spaces(page.select_one("h1").text) == ("Confirm your template") assert normalize_spaces(page.select_one("title").text) == ( - "Two week reminder – Templates – service one – Notify.gov" + "Confirm your template – service one – Notify.gov" ) assert [ diff --git a/tests/app/test_navigation.py b/tests/app/test_navigation.py index f469f2586..a7a19b567 100644 --- a/tests/app/test_navigation.py +++ b/tests/app/test_navigation.py @@ -62,6 +62,7 @@ EXCLUDED_ENDPOINTS = tuple( "conversation_reply", "conversation_reply_with_template", "conversation_updates", + "contact", "copy_template", "count_content_length", "create_and_send_messages", diff --git a/tests/end_to_end/test_landing_and_sign_in_pages.py b/tests/end_to_end/test_landing_and_sign_in_pages.py index 3cd17ad3a..3741a3a19 100644 --- a/tests/end_to_end/test_landing_and_sign_in_pages.py +++ b/tests/end_to_end/test_landing_and_sign_in_pages.py @@ -26,149 +26,24 @@ def test_landing_page(end_to_end_context): name="Reach people where they are with government-powered text messages", ) sign_in_button = page.get_by_role("link", name="Sign in with") - benefits_studio_email = page.get_by_role("link", name="tts-benefits-studio@gsa.gov") # Check to make sure the elements are visible. expect(main_header).to_be_visible() expect(sign_in_button).to_be_visible() - expect(benefits_studio_email).to_be_visible() # Check to make sure the sign-in button and email links are correct. href_value = sign_in_button.get_attribute("href") assert href_value is not None, "The sign-in button does not have an href attribute" - expect(benefits_studio_email).to_have_attribute( - "href", "mailto:tts-benefits-studio@gsa.gov" - ) # Retrieve all other main content headers and check that they're # visible. content_headers = [ - "Control your content", - "See how your messages perform", - "No technical integration needed", - "About the product", + "Government texting made easy", + "Key features", + "Who can use Notify.gov", ] for content_header in content_headers: expect( page.get_by_role("heading", name=re.compile(content_header)) ).to_be_visible() - - -# def test_sign_in_and_mfa_pages(end_to_end_context): -# # Open a new page and go to the staging site. -# page = end_to_end_context.new_page() -# page.goto(f"{E2E_TEST_URI}/") -# print(f"test_sign_in_and_mfa_pages initial {page}") -# -# sign_in_button = page.get_by_role("link", name="Sign in") -# -# # Test trying to sign in. -# sign_in_button.click() -# -# # Check to make sure that we've arrived at the next page. -# page.wait_for_load_state("domcontentloaded") -# -# # Check the page title exists and matches what we expect. -# expect(page).to_have_title(re.compile("Sign in")) -# -# # Check for the sign in heading. -# sign_in_heading = page.get_by_role("heading", name="Sign in") -# expect(sign_in_heading).to_be_visible() -# -# # Check for the sign in form elements. -# # NOTE: Playwright cannot find input elements by role and recommends using -# # get_by_label() instead; however, hidden form elements do not have -# # labels associated with them, hence the XPath! -# # 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") -# csrf_token = page.locator('xpath=//input[@name="csrf_token"]') -# continue_button = page.get_by_role("button", name=re.compile("Continue")) -# forgot_password_link = page.get_by_role("link", name="Forgot your password?") -# -# # Make sure form elements are visible and not visible as expected. -# expect(email_address_input).to_be_visible() -# expect(password_input).to_be_visible() -# expect(continue_button).to_be_visible() -# expect(forgot_password_link).to_be_visible() -# -# expect(csrf_token).to_be_hidden() -# -# # Make sure form elements are configured correctly with the right -# # attributes. -# expect(email_address_input).to_have_attribute("type", "email") -# expect(password_input).to_have_attribute("type", "password") -# expect(csrf_token).to_have_attribute("type", "hidden") -# expect(continue_button).to_have_attribute("type", "submit") -# expect(forgot_password_link).to_have_attribute("href", "/forgot-password") -# -# # Sign in to the site. -# email_address_input.fill(os.getenv("NOTIFY_E2E_TEST_EMAIL")) -# password_input.fill(os.getenv("NOTIFY_E2E_TEST_PASSWORD")) -# print(f"email and password {os.getenv('NOTIFY_E2E_TEST_EMAIL')} {os.getenv('NOTIFY_E2E_TEST_PASSWORD')}") -# continue_button.click() -# -# # Wait for the next page to fully load. -# page.wait_for_load_state("domcontentloaded") -# -# # Check the page title exists and matches what we expect. -# print(f"test_sign_in_and_mfa_pages finally is {page}") -# expect(page).to_have_title(re.compile("Check your phone")) -# -# # Check for the sign in heading. -# sign_in_heading = page.get_by_role("heading", name="Check your phone") -# expect(sign_in_heading).to_be_visible() -# -# # Check for the sign in form elements. -# # NOTE: Playwright cannot find input elements by role and recommends using -# # get_by_label() instead; however, hidden form elements do not have -# # labels associated with them, hence the XPath! -# # 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. -# mfa_input = page.get_by_label("Text message code") -# csrf_token = page.locator('xpath=//input[@name="csrf_token"]') -# continue_button = page.get_by_role("button", name=re.compile("Continue")) -# not_received_message_link = page.get_by_role( -# "link", name="Not received a text message?" -# ) -# -# # Make sure form elements are visible and not visible as expected. -# expect(mfa_input).to_be_visible() -# expect(continue_button).to_be_visible() -# expect(not_received_message_link).to_be_visible() -# -# expect(csrf_token).to_be_hidden() -# -# # Make sure form elements are configured correctly with the right -# # attributes. -# expect(mfa_input).to_have_attribute("type", "tel") -# expect(mfa_input).to_have_attribute("pattern", "[0-9]*") -# expect(csrf_token).to_have_attribute("type", "hidden") -# expect(continue_button).to_have_attribute("type", "submit") -# expect(not_received_message_link).to_have_attribute("href", "/text-not-received") -# -# # Enter MFA code and continue. -# # TODO: Revisit this at a later point in time. -# # totp = pyotp.TOTP( -# # os.getenv('MFA_TOTP_SECRET'), -# # digits=int(os.getenv('MFA_TOTP_LENGTH')) -# # ) -# -# # mfa_input.fill('totp.now()') -# # continue_button.click() -# -# # # Check to make sure that we've arrived at the next page. -# # page.wait_for_load_state('domcontentloaded') -# -# # # Check that no MFA code error happened. -# # code_not_found_error = page.get_by_text('Code not found') -# # expect(code_not_found_error).to_have_count(0) -# -# # # Check the page title exists and matches what we expect. -# # # This could be either the Dashboard of a service if there is only -# # # one, or choosing a service if there are multiple. -# # expect(page).to_have_title(re.compile('Dashboard|Choose service'))