generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Change Career stages Navigation url
Merge pull request #425 from DFE-Digital/changecareer-stagesurl
- Loading branch information
Showing
4 changed files
with
72 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 58 additions & 26 deletions
84
...r-tests/content-regression-tests/tests/career-stages/develop-social-work-practice.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,76 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.describe('Experienced Practitioners', () => { | ||
test.describe('Practitioner', () => { | ||
|
||
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: 'Practitioner', exact: true }).click() | ||
|
||
await expect(page.locator('h1', { hasText: /^Practitioner$/ })).toBeVisible() | ||
await expect(page).toHaveURL(/.*\/practitioner/) | ||
await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/) | ||
|
||
}) | ||
|
||
}) | ||
|
||
test.describe('Experienced Practitioner', () => { | ||
|
||
test('User journey from homepage @journey', async ({ page }) => { | ||
await page.goto('/') | ||
await page.getByRole('link', { name: 'Practitioners', exact: true }).click() | ||
await page.getByRole('link', { name: 'Develop your social work practice', exact: true }).click() | ||
await page.getByRole('link', { name: 'Practitioner', exact: true }).click() | ||
await page.getByRole('link', { name: 'Experienced practitioner', exact: true }).click() | ||
|
||
await expect(page.locator('h1', { hasText: /^Develop your social work practice$/ })).toBeVisible() | ||
await expect(page).toHaveURL(/.*\/develop-social-work-practice/) | ||
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('Manager', () => { | ||
|
||
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: 'Practitioners', exact: true }).click() | ||
await page.getByRole('link', { name: 'Develop your social work practice', exact: true }).click() | ||
await page.getByRole('link', { name: 'Manager', exact: true }).click() | ||
|
||
await expect(page.locator('h1', { hasText: /^Manager$/ })).toBeVisible() | ||
await expect(page).toHaveURL(/.*\/manager/) | ||
await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/) | ||
|
||
}) | ||
|
||
await expect(page.locator('h1', { hasText: /^Develop your social work practice$/ })).toBeVisible() | ||
await expect(page).toHaveURL(/.*\/develop-social-work-practice/) | ||
}) | ||
|
||
test.describe('Senior Manager', () => { | ||
|
||
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: 'Senior manager', exact: true }).click() | ||
|
||
await expect(page.locator('h1', { hasText: /^Senior manager$/ })).toBeVisible() | ||
await expect(page).toHaveURL(/.*\/senior-manager/) | ||
await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/) | ||
|
||
}) | ||
|
||
test.describe('External links @external', () => { | ||
const links = [ | ||
['Find out more about the types of CPD you can do', 'https://www.socialworkengland.org.uk/cpd/what-counts-as-cpd/'], | ||
['Find out more about CPD requirements', 'https://www.socialworkengland.org.uk/cpd/'], | ||
['Social work post-qualifying standards', 'https://www.gov.uk/government/publications/knowledge-and-skills-statements-for-child-and-family-social-work'], | ||
] | ||
|
||
for (const link of links) { | ||
test(`'${link[0]}' goes to ${link[1]}`, async ({ page }) => { | ||
await page.goto('/develop-social-work-practice') | ||
var promise = page.waitForResponse(`**${link[1]}`) | ||
await page.getByRole('link', { name: link[0], exact: true }).click() | ||
var response = await promise | ||
|
||
expect(response.ok()).toBeTruthy() | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Senior Leader', () => { | ||
|
||
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: 'Senior leader', exact: true }).click() | ||
|
||
await expect(page.locator('h1', { hasText: /^Senior Leader$/ })).toBeVisible() | ||
await expect(page).toHaveURL(/.*\/senior-leader/) | ||
await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/) | ||
|
||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters