From c560f317f659cb6844194c09cccaeea00b7bdeab Mon Sep 17 00:00:00 2001 From: Patrick Fleming Date: Tue, 21 Jan 2025 11:38:11 +0000 Subject: [PATCH] Update E2E tests with new has solicitor page --- e2e-tests/steps/apply.ts | 2 +- e2e-tests/steps/beforeYouStartSection.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/e2e-tests/steps/apply.ts b/e2e-tests/steps/apply.ts index a381ff06..ef73c755 100644 --- a/e2e-tests/steps/apply.ts +++ b/e2e-tests/steps/apply.ts @@ -58,7 +58,7 @@ export const completeBeforeYouStartSection = async (page: Page, name: string) => await completeEligibilityTask(page, name) await completeConsentTask(page, name) await completeReferrerDetailsTask(page) - await completeSolicitorDetailsTask(page) + await completeSolicitorDetailsTask(page, name) } export const completeAreaAndFundingSection = async (page: Page, name: string) => { diff --git a/e2e-tests/steps/beforeYouStartSection.ts b/e2e-tests/steps/beforeYouStartSection.ts index 5bed9207..a0e911ea 100644 --- a/e2e-tests/steps/beforeYouStartSection.ts +++ b/e2e-tests/steps/beforeYouStartSection.ts @@ -57,13 +57,21 @@ async function completeContactNumberPage(page: Page) { await confirmDetailsPage.clickSave() } -export const completeSolicitorDetailsTask = async (page: Page) => { +export const completeSolicitorDetailsTask = async (page: Page, name: string) => { const taskListPage = new TaskListPage(page) await taskListPage.clickTask('Add solicitor details') + await completeHasSolicitorPage(page, name) await completeSolicitorContactInformationPage(page) } +async function completeHasSolicitorPage(page: Page, name: string) { + const hasSolicitorPage = await ApplyPage.initialize(page, `Does ${name} have a solicitor?`) + + await hasSolicitorPage.checkRadio('Yes') + await hasSolicitorPage.clickSave() +} + async function completeSolicitorContactInformationPage(page: Page) { const bailHearingContactPage = await ApplyPage.initialize(page, "Add solicitor's contact information")