Skip to content

Commit

Permalink
Update E2E tests with new has solicitor page
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Fleming committed Jan 21, 2025
1 parent f419bb7 commit c560f31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e-tests/steps/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
10 changes: 9 additions & 1 deletion e2e-tests/steps/beforeYouStartSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit c560f31

Please sign in to comment.