Skip to content

Commit

Permalink
Merge pull request #453 from DFE-Digital/update-regression-tests
Browse files Browse the repository at this point in the history
chore: Update regression tests
  • Loading branch information
killij authored Mar 1, 2024
2 parents f8f4d95 + 2040c95 commit 54e3854
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ test.describe('Assessed and supported year in employment (ASYE)', () => {
['post qualifying standards', 'https://www.gov.uk/government/publications/knowledge-and-skills-statements-for-child-and-family-social-work'],
['Professional Capabilities Framework', 'https://new.basw.co.uk/training-cpd/professional-capabilities-framework-pcf'],
['Find out more about each ASYE stage', 'https://www.skillsforcare.org.uk/Regulated-professions/Social-work/ASYE/ASYE-templates.aspx'],
['Find out more about the ASYE', 'https://www.skillsforcare.org.uk/Regulated-professions/Social-work/ASYE/ASYE.aspx'],
['Find out more about the ASYE programme', 'https://www.skillsforcare.org.uk/Regulated-professions/Social-work/ASYE/ASYE.aspx'],
['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('/asye')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe('Senior Leader', () => {
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.locator('h1', { hasText: /^Senior leader$/ })).toBeVisible()
await expect(page).toHaveURL(/.*\/senior-leader/)
await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ test.describe('Experienced Practitioners', () => {
const links = [
['Pathway 1: practice supervisors', '/pathway-1', 'Pathway 1: practice supervisors'],
['Pathway 2: middle managers', '/pathway-2', 'Pathway 2: middle managers'],
['Explore roles', '/explore-roles', 'Explore roles in child and family social work'],
['View all programmes', '/development-programmes', 'Child and family social work development programmes'],
['Explore roles', '/explore-roles', '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-practitioner')
await page.goto(link[1])
await page.goto('/career-stages/experienced-practitioner')
await page.getByRole('link', { name: link[0], exact: true }).last().click()
await expect(page).toHaveURL(new RegExp(`.*${link[1]}`))
await expect(page.locator('h1', { hasText: new RegExp(`^${link[2]}$`) })).toBeVisible()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test.describe('Senior leaders', () => {
await page.goto('/')
await page.getByRole('link', { name: 'Senior leader', exact: true }).click()

await expect(page.locator('h1', { hasText: /^Senior Leader$/ })).toBeVisible()
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/)
})
Expand All @@ -17,7 +17,7 @@ test.describe('Senior leaders', () => {
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.locator('h1', { hasText: /^Senior leader$/ })).toBeVisible()
await expect(page).toHaveURL(/.*\/senior-leader/)
await expect(page.locator('#mmi-career')).toHaveClass(/dfe-header__navigation-item--current/)
})
Expand All @@ -29,7 +29,7 @@ test.describe('Senior leaders', () => {
['Pathway 4: practice leaders', '/pathway-4', 'Pathway 4: practice leaders'],
['Assistant director', '/assistant-director', 'Assistant director'],
["Director of children's services", '/director-children-services', "Director of children's services"],
['Explore roles', '/explore-roles', 'Explore roles in child and family social work'],
['Explore roles', '/explore-roles', 'Roles in child and family social work'],
]

for (const link of links) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.describe('Managers', () => {
['Quality improvement manager', '/explore-roles/quality-improvement-manager', 'Quality improvement manager'],
['Team manager', '/explore-roles/team-manager', 'Team manager'],
['Independent reviewing officer', '/explore-roles/independent-reviewing-officer', 'Independent reviewing officer'],
['Explore roles', '/explore-roles', 'Explore roles in child and family social work'],
['Explore roles', '/explore-roles', 'Roles in child and family social work'],
]

for (const link of links) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.describe('Practitioners', () => {
['Develop your social work practice', '/develop-social-work-practice', 'Develop your social work practice'],
['Newly qualified social worker', '/explore-roles/newly-qualified-social-worker', 'Newly qualified social worker'],
['Social worker', '/explore-roles/social-worker', 'Social worker'],
['Explore roles', '/explore-roles', 'Explore roles in child and family social work'],
['Explore roles', '/explore-roles', 'Roles in child and family social work'],
]

for (const link of links) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.describe('Senior managers', () => {
['Principal social worker', '/explore-roles/principal-social-worker', 'Principal social worker'],
['Service manager', '/explore-roles/service-manager', 'Service manager'],
['Head of service', '/explore-roles/head-of-service', 'Head of service'],
['Explore roles', '/explore-roles', 'Explore roles in child and family social work'],
['Explore roles', '/explore-roles', 'Roles in child and family social work'],
]

for (const link of links) {
Expand Down
6 changes: 3 additions & 3 deletions browser-tests/content-regression-tests/tests/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test.describe('Homepage', () => {
['Experienced practitioner', '/experienced-practitioner', 'Experienced practitioner'],
['Manager', '/manager', 'Manager'],
['Senior manager', '/senior-manager', 'Senior manager'],
['Senior leader', '/senior-leader', 'Senior Leader'],
['Senior leader', '/senior-leader', 'Senior leader'],
]

for (const link of links) {
Expand All @@ -25,8 +25,8 @@ test.describe('Homepage', () => {

test.describe('Useful information', () => {
const links = [
['DfE funded programmes', '/development-programmes', 'Child and family social work development programmes'],
['Explore roles', '/explore-roles', 'Explore roles in child and family social work'],
['DfE-funded programmes', '/development-programmes', 'Child and family social work development programmes'],
['Explore roles', '/explore-roles', 'Roles in child and family social work'],
]

for (const link of links) {
Expand Down

0 comments on commit 54e3854

Please sign in to comment.