diff --git a/app/javascript/packages/document-capture/components/document-capture.tsx b/app/javascript/packages/document-capture/components/document-capture.tsx index 5dd591c2de5..7a607f5782d 100644 --- a/app/javascript/packages/document-capture/components/document-capture.tsx +++ b/app/javascript/packages/document-capture/components/document-capture.tsx @@ -111,16 +111,16 @@ function DocumentCapture({ isAsyncForm = false, onStepChange = () => {} }: Docum inPersonURL === undefined ? [] : ([ - { - name: 'location', - form: InPersonLocationPostOfficeSearchStep, - title: t('in_person_proofing.headings.po_search.location'), - }, { name: 'prepare', form: InPersonPrepareStep, title: t('in_person_proofing.headings.prepare'), }, + { + name: 'location', + form: InPersonLocationPostOfficeSearchStep, + title: t('in_person_proofing.headings.po_search.location'), + }, flowPath === 'hybrid' && { name: 'switch_back', form: InPersonSwitchBackStep, @@ -155,7 +155,7 @@ function DocumentCapture({ isAsyncForm = false, onStepChange = () => {} }: Docum ].filter(Boolean) as FormStep[]); const stepIndicatorPath = - stepName && ['location', 'prepare', 'switch_back'].includes(stepName) + stepName && ['prepare', 'location', 'switch_back'].includes(stepName) ? VerifyFlowPath.IN_PERSON : VerifyFlowPath.DEFAULT; diff --git a/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx b/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx index 61625ca68fc..1d7489039f7 100644 --- a/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx +++ b/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx @@ -34,7 +34,7 @@ function InPersonCallToAction({ altHeading, altPrompt, altButtonText }: InPerson isWide className="margin-top-3 margin-bottom-1" onClick={() => { - setStepName('location'); + setStepName('prepare'); trackEvent('IdV: verify in person troubleshooting option clicked', { in_person_cta_variant: inPersonCtaVariantActive, }); diff --git a/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx b/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx index f5e8fce3792..21f8f28235d 100644 --- a/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx +++ b/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx @@ -2,6 +2,7 @@ import { useState, useEffect, useCallback, useRef, useContext } from 'react'; import { useI18n } from '@18f/identity-react-i18n'; import { Alert, PageHeading } from '@18f/identity-components'; import { request } from '@18f/identity-request'; +import { forceRedirect } from '@18f/identity-url'; import BackButton from './back-button'; import AnalyticsContext from '../context/analytics'; import AddressSearch, { @@ -14,12 +15,13 @@ import InPersonLocations, { FormattedLocation } from './in-person-locations'; import { InPersonContext } from '../context'; function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, registerField }) { - const { inPersonCtaVariantActive } = useContext(InPersonContext); + const { inPersonCtaVariantActive, inPersonURL } = useContext(InPersonContext); const { t } = useI18n(); + const [inProgress, setInProgress] = useState(false); const [isLoadingLocations, setLoadingLocations] = useState(false); const [autoSubmit, setAutoSubmit] = useState(false); - const { setSubmitEventMetadata } = useContext(AnalyticsContext); + const { trackEvent } = useContext(AnalyticsContext); const [locationResults, setLocationResults] = useState( null, ); @@ -40,13 +42,10 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist // useCallBack here prevents unnecessary rerenders due to changing function identity const handleLocationSelect = useCallback( async (e: any, id: number) => { + e.preventDefault(); const selectedLocation = locationResults![id]!; const { streetAddress, formattedCityStateZip } = selectedLocation; const selectedLocationAddress = `${streetAddress}, ${formattedCityStateZip}`; - setSubmitEventMetadata({ - selected_location: selectedLocationAddress, - in_person_cta_variant: inPersonCtaVariantActive, - }); onChange({ selectedLocationAddress }); if (autoSubmit) { setDisabledAddressSearch(true); @@ -57,11 +56,11 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist }, 250); return; } - // prevent navigation from continuing - e.preventDefault(); + if (inProgress) { return; } + const selected = transformKeys(selectedLocation, snakeCase); setInProgress(true); try { @@ -69,12 +68,17 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist json: selected, method: 'PUT', }); + if (mountedRef.current) { setAutoSubmit(true); setImmediate(() => { // continue with navigation e.target.disabled = false; - e.target.click(); + trackEvent('IdV: location submitted', { + selected_location: selectedLocationAddress, + in_person_cta_variant: inPersonCtaVariantActive, + }); + forceRedirect(inPersonURL!); // allow process to be re-triggered in case submission did not work as expected setAutoSubmit(false); }); diff --git a/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx b/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx index db61517b3b7..25e61c1e466 100644 --- a/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx +++ b/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx @@ -1,11 +1,10 @@ import { useContext, useState } from 'react'; import type { MouseEventHandler } from 'react'; -import { Alert, Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components'; -import { removeUnloadProtection } from '@18f/identity-url'; +import { Button, Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components'; import { getConfigValue } from '@18f/identity-config'; import { useI18n } from '@18f/identity-react-i18n'; import { FormStepsButton } from '@18f/identity-form-steps'; -import { SpinnerButton } from '@18f/identity-spinner-button'; +import useHistoryParam from '@18f/identity-form-steps/use-history-param'; import UploadContext from '../context/upload'; import MarketingSiteContext from '../context/marketing-site'; import AnalyticsContext from '../context/analytics'; @@ -13,40 +12,37 @@ import BackButton from './back-button'; import InPersonTroubleshootingOptions from './in-person-troubleshooting-options'; import { InPersonContext } from '../context'; -function InPersonPrepareStep({ toPreviousStep, value }) { +function InPersonPrepareStep({ toPreviousStep }) { const { t } = useI18n(); const [isSubmitting, setIsSubmitting] = useState(false); - const { inPersonURL } = useContext(InPersonContext); + const [, setStepName] = useHistoryParam(undefined); + const { inPersonURL, inPersonCtaVariantActive } = useContext(InPersonContext); const { flowPath } = useContext(UploadContext); - const { trackEvent } = useContext(AnalyticsContext); + const { trackEvent, setSubmitEventMetadata } = useContext(AnalyticsContext); const { securityAndPrivacyHowItWorksURL } = useContext(MarketingSiteContext); - const { selectedLocationAddress } = value; - const onContinue: MouseEventHandler = async (event) => { + const onContinue: MouseEventHandler = (event: React.MouseEvent) => { event.preventDefault(); if (!isSubmitting) { setIsSubmitting(true); - removeUnloadProtection(); - await trackEvent('IdV: prepare submitted'); - window.location.href = inPersonURL!; + setSubmitEventMetadata({ in_person_cta_variant: inPersonCtaVariantActive }); + trackEvent('IdV: prepare submitted'); + setStepName('location'); } }; return ( <> - {selectedLocationAddress && ( - - {t('in_person_proofing.body.prepare.alert_selected_post_office', { - full_address: selectedLocationAddress, - })} - - )} {t('in_person_proofing.headings.prepare')}

{t('in_person_proofing.body.prepare.verify_step_about')}

+ } {inPersonURL && flowPath === 'standard' && (
- +
)}

diff --git a/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx b/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx index 12a5b37c601..d644bc1e880 100644 --- a/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx +++ b/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx @@ -39,6 +39,15 @@ function InPersonTroubleshootingOptions({ text: t('idv.troubleshooting.options.learn_more_verify_in_person'), isExternal: true, }, + { + url: getHelpCenterURL({ + category: 'verify-your-identity', + article: 'phone-number', + location, + }), + text: t('idv.troubleshooting.options.learn_more_verify_by_phone_in_person'), + isExternal: true, + }, spName && { url: getFailureToProofURL(location), text: t('idv.troubleshooting.options.get_help_at_sp', { sp_name: spName }), diff --git a/app/javascript/packages/document-capture/components/location-collection-item.tsx b/app/javascript/packages/document-capture/components/location-collection-item.tsx index 3cfc1ac2fd6..4c0ddeea0fe 100644 --- a/app/javascript/packages/document-capture/components/location-collection-item.tsx +++ b/app/javascript/packages/document-capture/components/location-collection-item.tsx @@ -26,7 +26,6 @@ function LocationCollectionItem({ }: LocationCollectionItemProps) { const { t } = useI18n(); const numericDistance = distance?.split(' ')[0]; - return (

  • @@ -71,9 +70,7 @@ function LocationCollectionItem({
    { - handleSelect(event, selectId); - }} + onClick={(event) => handleSelect(event, selectId)} type="submit" > {t('in_person_proofing.body.location.location_button')} diff --git a/app/javascript/packages/document-capture/components/review-issues-step.tsx b/app/javascript/packages/document-capture/components/review-issues-step.tsx index 937e93fa8ca..5633931259e 100644 --- a/app/javascript/packages/document-capture/components/review-issues-step.tsx +++ b/app/javascript/packages/document-capture/components/review-issues-step.tsx @@ -187,7 +187,7 @@ function ReviewIssuesStep({ actionOnClick={onWarningPageDismissed} altActionText={t('in_person_proofing.body.cta.button_variant')} altActionOnClick={onInPersonSelected} - altHref="#location" + altHref="#prepare" location="doc_auth_review_issues" remainingAttempts={remainingAttempts} troubleshootingOptions={ diff --git a/app/javascript/packages/document-capture/context/analytics.tsx b/app/javascript/packages/document-capture/context/analytics.tsx index 3778cb4c5ef..0250e331693 100644 --- a/app/javascript/packages/document-capture/context/analytics.tsx +++ b/app/javascript/packages/document-capture/context/analytics.tsx @@ -44,7 +44,7 @@ type AnalyticsContextProviderProps = Pick & const DEFAULT_EVENT_METADATA: Record = {}; -export const LOGGED_STEPS: string[] = ['location', 'prepare', 'switch_back']; +export const LOGGED_STEPS: string[] = ['prepare', 'location', 'switch_back']; const AnalyticsContext = createContext({ trackEvent: () => Promise.resolve(), @@ -71,7 +71,7 @@ export function AnalyticsContextProvider({ children, trackEvent }: AnalyticsCont const extraAnalyticsAttributes = (stepName) => { const extra: EventMetadata = { ...DEFAULT_EVENT_METADATA }; - if (stepName === 'location') { + if (stepName === 'prepare') { extra.in_person_cta_variant = inPersonCtaVariantActive; } return extra; diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 133f105d89b..710d2d076c6 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -234,6 +234,7 @@ en: learn_more_address_verification_options: Learn more about verifying by phone or mail learn_more_verify_by_mail: Learn more about verifying your address by mail learn_more_verify_by_phone: Learn more about what phone number to use + learn_more_verify_by_phone_in_person: Learn more about verifying your phone number learn_more_verify_in_person: Learn more about verifying in person supported_documents: See a list of accepted state-issued IDs verify_by_mail: Verify your address by mail instead diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 99c8aef6118..7316aa17ee7 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -248,6 +248,7 @@ es: learn_more_verify_by_mail: Obtenga más información sobre la verificación de su dirección por correo learn_more_verify_by_phone: Más información sobre qué número de teléfono usar + learn_more_verify_by_phone_in_person: Más información sobre cómo verificar su número de teléfono learn_more_verify_in_person: Más información sobre la verificación en persona supported_documents: Vea la lista de documentos de identidad emitidos por el estado que son aceptados diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index c341b22f202..07a5e6ec935 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -262,6 +262,7 @@ fr: learn_more_address_verification_options: En savoir plus sur la vérification par téléphone ou par courrier learn_more_verify_by_mail: En savoir plus sur la vérification de votre adresse par courrier learn_more_verify_by_phone: Apprenez-en plus sur quel numéro de téléphone utiliser + learn_more_verify_by_phone_in_person: En savoir plus sur la vérification de votre numéro de téléphone learn_more_verify_in_person: En savoir plus sur la vérification en personne supported_documents: Voir la liste des pièces d’identité acceptées et délivrées par l’État verify_by_mail: Vérifiez plutôt votre adresse par courrier diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml index 2508606b0c8..c036a7b43c7 100644 --- a/config/locales/in_person_proofing/en.yml +++ b/config/locales/in_person_proofing/en.yml @@ -45,8 +45,8 @@ en: %{address}. none_found_tip: You can search using a different address, or add photos of your ID to try and verify your identity online again. - po_search_about: If you are having trouble adding your ID, you may be able to - verify your identity in person at a local United States Post Office. + po_search_about: You can verify your identity in person at a local participating + United States Post Office. results_description: one: There is one participating Post Office within 50 miles of %{address}. other: There are %{count} participating Post Offices within 50 miles of @@ -59,7 +59,6 @@ en: retail_hours_sun: 'Sun:' retail_hours_weekday: 'Monday to Friday:' prepare: - alert_selected_post_office: You’ve selected the Post Office at %{full_address}. privacy_disclaimer: '%{app_name} is a secure, government website. We and the U.S. Postal Service use your data to verify your identity.' privacy_disclaimer_link: Learn more about privacy and security. @@ -69,6 +68,7 @@ en: verify_step_enter_phone: Enter your primary phone number or the number that you use most often. verify_step_enter_pii: Enter your name, date of birth, state-issued ID number, address and Social Security number. + verify_step_post_office: Find a participating Post Office near you. state_id: alert_message: 'Your state-issued ID must not be expired. Accepted forms of ID are:' id_types: diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml index 57b8ad7bc48..f41d2ccc8bf 100644 --- a/config/locales/in_person_proofing/es.yml +++ b/config/locales/in_person_proofing/es.yml @@ -67,7 +67,6 @@ es: retail_hours_sun: 'Dom:' retail_hours_weekday: 'De Lunes a Viernes:' prepare: - alert_selected_post_office: Ha seleccionado la oficina de correos a %{full_address}. privacy_disclaimer: '%{app_name} es un sitio web seguro del gobierno. Nosotros y el Servicio Postal de los Estados Unidos utilizamos sus datos para verificar su identidad.' @@ -80,6 +79,7 @@ es: verify_step_enter_pii: Ingrese su nombre, fecha de nacimiento, número de identificación emitido por el estado, dirección y número de la Seguridad Social. + verify_step_post_office: Encuentre una Oficina de Correos participantes cercana a usted. state_id: alert_message: 'Su identificación emitida por el estado no debe estar vencida. Se aceptan las siguientes formas de identificación:' diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml index 9755b810d5b..39e330b6dd8 100644 --- a/config/locales/in_person_proofing/fr.yml +++ b/config/locales/in_person_proofing/fr.yml @@ -51,9 +51,8 @@ fr: none_found_tip: Vous pouvez effectuer une recherche en utilisant une autre adresse, ou ajouter des photos de votre pièce d’identité pour essayer de vérifier à nouveau votre identité en ligne. - po_search_about: Si vous avez des difficultés à ajouter votre pièce d’identité, - vous pouvez vérifier votre identité en personne dans un bureau de - poste américain proche. + po_search_about: Vous pouvez vérifier votre identité en personne dans un bureau + de poste américain local participant. results_description: one: Il y a 1 bureau de poste participant dans un rayon de 50 miles autour de %{address}. @@ -67,7 +66,6 @@ fr: retail_hours_sun: 'Dim:' retail_hours_weekday: 'Lundi à Vendredi:' prepare: - alert_selected_post_office: Vous avez sélectionné le bureau de poste à %{full_address}. privacy_disclaimer: '%{app_name} est un site gouvernemental sécurisé. Nous et le service postal américain utilisons vos données pour vérifier votre identité.' @@ -80,6 +78,7 @@ fr: verify_step_enter_pii: Saisissez votre nom, votre date de naissance, votre document d’identité délivré par l’État, votre adresse et votre numéro de sécurité sociale. + verify_step_post_office: Trouver un bureau de poste participant. state_id: alert_message: 'Votre carte d’identité délivrée par l’État ne doit pas être périmée. Les pièces d’identité acceptées sont:' diff --git a/spec/controllers/idv/hybrid_mobile/document_capture_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/document_capture_controller_spec.rb index 189f39812a3..727fa764f96 100644 --- a/spec/controllers/idv/hybrid_mobile/document_capture_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/document_capture_controller_spec.rb @@ -87,7 +87,7 @@ change { doc_auth_log.reload.document_capture_view_count }.from(0).to(1), ) end - + context 'with expired DocumentCaptureSession' do let(:document_capture_session_requested_at) do Time.zone.now.advance( diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index f79b9d59cea..0007c147f23 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -86,10 +86,10 @@ 'IdV: doc auth image upload form submitted' => { success: true, errors: {}, attempts: 1, remaining_attempts: 3, user_id: user.uuid, flow_path: 'standard' }, 'IdV: doc auth image upload vendor submitted' => hash_including(success: true, flow_path: 'standard', attention_with_barcode: true, doc_auth_result: 'Attention'), 'IdV: verify in person troubleshooting option clicked' => { flow_path: 'standard', in_person_cta_variant: 'in_person_variant_a' }, - 'IdV: in person proofing location visited' => { flow_path: 'standard', in_person_cta_variant: 'in_person_variant_a' }, - 'IdV: in person proofing location submitted' => { flow_path: 'standard', selected_location: '606 E JUNEAU AVE, MILWAUKEE, WI, 53202-9998', in_person_cta_variant: 'in_person_variant_a' }, 'IdV: in person proofing prepare visited' => { flow_path: 'standard' }, 'IdV: in person proofing prepare submitted' => { flow_path: 'standard' }, + 'IdV: in person proofing location visited' => hash_including(flow_path: 'standard'), + 'IdV: in person proofing location submitted' => { flow_path: 'standard', selected_location: '606 E JUNEAU AVE, MILWAUKEE, WI, 53202-9998', in_person_cta_variant: 'in_person_variant_a' }, 'IdV: in person proofing state_id visited' => { step: 'state_id', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false }, 'IdV: in person proofing state_id submitted' => { success: true, flow_path: 'standard', step: 'state_id', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, errors: {} }, 'IdV: in person proofing address visited' => { step: 'address', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false }, diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index 2289a2a6c94..e8a75bf5829 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -23,12 +23,13 @@ it 'allows the user to continue down the happy path', allow_browser_log: true do sign_in_and_2fa_user(user) begin_in_person_proofing(user) - # location page - complete_location_step # prepare page complete_prepare_step(user) + # location page + complete_location_step + # state ID page complete_state_id_step(user) @@ -118,16 +119,12 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - # location page - expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step - # prepare page - expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) - expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) complete_prepare_step(user) + # location page + complete_location_step + # state ID page expect_in_person_step_indicator_current_step( t('step_indicator.flows.idv.verify_info'), @@ -249,22 +246,21 @@ complete_all_in_person_proofing_steps end - it 'allows the user to go back to document capture from prepare step', allow_browser_log: true do + it 'allows the user to go back to document capture from location step', allow_browser_log: true do sign_in_and_2fa_user begin_in_person_proofing + # prepare page + complete_prepare_step + # location page - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step + search_for_post_office - # prepare page - expect(page).to have_content(t('in_person_proofing.headings.prepare'), wait: 5) + # back to prepare page click_button t('forms.buttons.back') + expect(page).to have_content(t('in_person_proofing.headings.prepare')) - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - - search_for_post_office - expect(page).to have_css('.location-collection-item', wait: 10) + # back to doc capture page click_button t('forms.buttons.back') # Note: This is specifically for failed barcodes. Other cases may use @@ -336,13 +332,11 @@ # error page click_button t('in_person_proofing.body.cta.button') - # location page - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step - # prepare page expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) click_idv_continue + # location page + complete_location_step # switch back page expect(page).to have_content(t('in_person_proofing.headings.switch_back')) @@ -437,8 +431,8 @@ allow_browser_log: true do sign_in_and_2fa_user begin_in_person_proofing - complete_location_step complete_prepare_step + complete_location_step expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) fill_out_state_id_form_ok(double_address_verification: double_address_verification) @@ -506,8 +500,8 @@ allow_browser_log: true do sign_in_and_2fa_user begin_in_person_proofing - complete_location_step complete_prepare_step + complete_location_step expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) fill_out_state_id_form_ok @@ -582,21 +576,15 @@ before(:each) do allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). and_return(false) - sign_in_and_2fa_user(user) begin_in_person_proofing(user) + complete_prepare_step(user) complete_location_step(user) - - expect(page).to have_content( - t('in_person_proofing.headings.prepare'), wait: 5 - ) end it 'does not capture separate state id address from residential address' do allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). and_return(true) - # prepare page - complete_prepare_step(user) complete_state_id_step(user) complete_address_step(user) complete_ssn_step(user) @@ -612,16 +600,11 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) + complete_prepare_step(user) complete_location_step(user) - - expect(page).to have_content( - t('in_person_proofing.headings.prepare'), wait: 5 - ) end - # prepare page - it 'successfully proceeds through the flow' do - complete_prepare_step(user) + it 'successfully proceeds through the flow' do complete_state_id_step(user, same_address_as_id: false, double_address_verification: true) complete_address_step(user, double_address_verification: true) @@ -658,8 +641,8 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) end it 'skips the address page' do diff --git a/spec/features/idv/steps/in_person/verify_info_spec.rb b/spec/features/idv/steps/in_person/verify_info_spec.rb index f71f2c0538d..4d0c36f8e45 100644 --- a/spec/features/idv/steps/in_person/verify_info_spec.rb +++ b/spec/features/idv/steps/in_person/verify_info_spec.rb @@ -17,8 +17,8 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step(user) complete_address_step(user) complete_ssn_step(user) diff --git a/spec/features/idv/steps/in_person/verify_step_spec.rb b/spec/features/idv/steps/in_person/verify_step_spec.rb index f40a31f4483..d091d4dadcb 100644 --- a/spec/features/idv/steps/in_person/verify_step_spec.rb +++ b/spec/features/idv/steps/in_person/verify_step_spec.rb @@ -27,8 +27,8 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step(user, double_address_verification: double_address_verification) complete_address_step(user, double_address_verification: double_address_verification) complete_ssn_step(user) @@ -94,8 +94,8 @@ allow_browser_log: true do sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step( user, same_address_as_id: same_address_as_id, double_address_verification: double_address_verification @@ -143,8 +143,8 @@ allow_browser_log: true do sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step( user, same_address_as_id: same_address_as_id, double_address_verification: double_address_verification diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index d39e41154ab..ab51b2d5b85 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -86,8 +86,11 @@ def begin_in_person_proofing(_user = nil) end def search_for_post_office + expect(page).to have_content(t('in_person_proofing.body.location.po_search.po_search_about')) + expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) fill_in t('in_person_proofing.body.location.po_search.address_search_label'), with: GOOD_ADDRESS1 + click_spinner_button_and_wait(t('in_person_proofing.body.location.po_search.search_button')) expect(page).to have_css('.location-collection-item') end @@ -108,8 +111,9 @@ def complete_location_step(_user = nil) end def complete_prepare_step(_user = nil) - expect(page).to have_text(t('forms.buttons.continue'), wait: 10) - click_spinner_button_and_wait t('forms.buttons.continue') + expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) + expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) + click_on t('forms.buttons.continue') end def complete_state_id_step(_user = nil, same_address_as_id: true, @@ -142,8 +146,8 @@ def complete_verify_step(_user = nil) end def complete_all_in_person_proofing_steps(user = user_with_2fa) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step(user) complete_address_step(user) complete_ssn_step(user) @@ -157,6 +161,7 @@ def expect_in_person_step_indicator_current_step(text) expect(page).to have_css( '.step-indicator__step', text: t('step_indicator.flows.idv.find_a_post_office'), + wait: 10, ) expect_step_indicator_current_step(text)