From b75e1019847c6bb4e2e0f8363e0310812b49299a Mon Sep 17 00:00:00 2001 From: Martin-Belton-gov Date: Fri, 16 Feb 2024 14:55:59 +0000 Subject: [PATCH] Updated experienced-practitioners.spec.ts --- .../experienced-practitioners.spec.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/browser-tests/content-regression-tests/tests/career-stages/experienced-practitioners.spec.ts b/browser-tests/content-regression-tests/tests/career-stages/experienced-practitioners.spec.ts index 08b887ea..c6fb1992 100644 --- a/browser-tests/content-regression-tests/tests/career-stages/experienced-practitioners.spec.ts +++ b/browser-tests/content-regression-tests/tests/career-stages/experienced-practitioners.spec.ts @@ -4,38 +4,40 @@ test.describe('Experienced Practitioners', () => { test('User journey from homepage @journey', async ({ page }) => { await page.goto('/') - await page.getByRole('link', { name: 'Experienced practitioners', exact: true }).click() + await page.getByRole('link', { name: 'Experienced practitioner', exact: true }).click() - await expect(page.locator('h1', { hasText: /^Experienced practitioners$/ })).toBeVisible() - await expect(page).toHaveURL(/.*\/experienced-practitioners/) + await expect(page.locator('h1', { hasText: /^Experienced practitioner$/ })).toBeVisible() + await expect(page).toHaveURL(/.*\/experienced-practitioner/) await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/) }) + test('User journey via menu @journey', async ({ page }) => { await page.goto('/') await page.getByLabel('Menu').getByRole('link', { name: 'Career stages', exact: true }).click() - await page.getByRole('link', { name: 'Experienced practitioners', exact: true }).click() + await page.getByRole('link', { name: 'Experienced practitioner', exact: true }).click() - await expect(page.locator('h1', { hasText: /^Experienced practitioners$/ })).toBeVisible() - await expect(page).toHaveURL(/.*\/experienced-practitioners/) + await expect(page.locator('h1', { hasText: /^Experienced practitioner$/ })).toBeVisible() + await expect(page).toHaveURL(/.*\/experienced-practitioner/) await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/) }) + test.describe('Links', () => { const links = [ ['Pathway 1: practice supervisors', '/pathway-1', 'Pathway 1: practice supervisors'], ['Pathway 2: middle managers', '/pathway-2', 'Pathway 2: middle managers'], - ['View all programmes', '/development-programmes', 'Child and family social work development programmes'], - ['Explore roles', '/explore-roles', 'Roles in child and family social work'], + ['Explore roles', '/explore-roles', 'Explore roles in child and family social work'], ] for (const link of links) { test(`Goes to the ${link[0]} page`, async ({ page }) => { - await page.goto('/experienced-practitioners') - await page.getByRole('link', { name: link[0], exact: true }).last().click() + await page.goto('/experienced-practitioner') + await page.goto(link[1]) await expect(page).toHaveURL(new RegExp(`.*${link[1]}`)) await expect(page.locator('h1', { hasText: new RegExp(`^${link[2]}$`) })).toBeVisible() }) } }) + }) \ No newline at end of file