Skip to content

Commit

Permalink
Merge pull request #82 from ministryofjustice/fix-e2e-tests
Browse files Browse the repository at this point in the history
Fix e2e tests after govuk-frontend update to v5.1.0
  • Loading branch information
jsrobertson authored Feb 8, 2024
2 parents b967d64 + d9821eb commit 0cc6ae9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/refer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ const entersProgrammeHistory = async (page: Page): Promise<void> => {
await page.getByTestId('add-history-button').click()

await expect(page.locator('h1')).toHaveText('Add Accredited Programme history')
await page.getByLabel('Horizon').click()
await page.getByLabel('Horizon').click({ force: true })
await page.getByRole('button', { name: 'Continue' }).click()

await expect(page.locator('h1')).toHaveText('Add Accredited Programme details')
await page.getByTestId('custody-setting-option').click()
await page.getByTestId('custody-setting-option').click({ force: true })
await page.getByLabel('Enter the prison (if known)').fill('Stocken (HMP)')
await page.getByTestId('complete-outcome-option').click()
await page.getByTestId('complete-outcome-option').click({ force: true })
await page.getByLabel('Enter the year completed (if known)').fill('2020')
await page.getByLabel('Provide additional detail (if known)').fill('Spiffing')
await page.getByLabel('Provide the source').fill('The person sat next to me')
Expand All @@ -93,7 +93,7 @@ const entersProgrammeHistory = async (page: Page): Promise<void> => {
const confirmsOasys = async (page: Page): Promise<void> => {
await page.getByRole('link', { name: 'Confirm the OASys information' }).click()
await expect(page.locator('h1')).toHaveText('Confirm the OASys information')
await page.getByLabel('I confirm that the OASys information is up to date.').check()
await page.getByLabel('I confirm that the OASys information is up to date.').check({ force: true })
await page.getByRole('button', { name: 'Save and continue' }).click()
await expect(page.getByTestId('confirm-oasys-tag')).toHaveText('Completed')
}
Expand All @@ -112,7 +112,7 @@ const showsCheckAnswersBeforeSubmitting = async (page: Page): Promise<void> => {
}

const completesAReferral = async (page: Page): Promise<void> => {
await page.locator('input[name="confirmation"]').check()
await page.locator('input[name="confirmation"]').check({ force: true })
await page.getByRole('button', { name: 'Submit referral' }).click()
await expect(page.locator('h1')).toHaveText('Referral complete')
}

0 comments on commit 0cc6ae9

Please sign in to comment.