Skip to content

Commit

Permalink
Fix the regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
killij committed Dec 14, 2023
1 parent 8fb7049 commit 8d55413
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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://www.basw.co.uk/social-work-training/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'],
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ test.describe('Experienced Practitioners', () => {
['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 all 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) {
test(`Goes to the ${link[0]} page`, async ({ page }) => {
await page.goto('/experienced-practitioners')
await page.getByRole('link', { name: link[0], exact: true }).click()
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 @@ -26,13 +26,13 @@ test.describe('Leaders', () => {
['Upon: new directors programme', '/new-directors-programme', 'Upon: new directors programme'],
['Pathway 4: practice leaders', '/pathway-4', 'Pathway 4: practice leaders'],
['View all programmes', '/development-programmes', 'Child and family social work development programmes'],
['Explore all 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) {
test(`Goes to the ${link[0]} page`, async ({ page }) => {
await page.goto('/leaders')
await page.getByRole('link', { name: link[0], exact: true }).click()
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 @@ -25,13 +25,13 @@ test.describe('Managers', () => {
['Pathway 2: middle managers', '/pathway-2', 'Pathway 2: middle managers'],
['Pathway 3: heads of service', '/pathway-3', 'Pathway 3: heads of service'],
['View all programmes', '/development-programmes', 'Child and family social work development programmes'],
['Explore all 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) {
test(`Goes to the ${link[0]} page`, async ({ page }) => {
await page.goto('/managers')
await page.getByRole('link', { name: link[0], exact: true }).click()
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 @@ -35,7 +35,6 @@ test.describe('Pathway 1: practice supervisors', () => {
test.describe('External links @external', () => {
const links = [
['Frontline', 'https://thefrontline.org.uk/develop-your-career/pathways-programme/'],
['Find out more about Pathway 1 including how to apply', 'https://thefrontline.org.uk/develop-your-career/pathways-programme/'],
['Social work post-qualifying standards', 'https://www.gov.uk/government/publications/knowledge-and-skills-statements-for-child-and-family-social-work'],
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ test.describe('Practitioners', () => {
['Assessed and supported year in employment (ASYE)', '/asye', 'Assessed and supported year in employment \\(ASYE\\)'],
['View all programmes', '/development-programmes', 'Child and family social work development programmes'],
['Develop your social work practice', '/develop-social-work-practice', 'Develop your social work practice'],
['Explore all 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) {
test(`Goes to the ${link[0]} page`, async ({ page }) => {
await page.goto('/practitioners')
await page.getByRole('link', { name: link[0], exact: true }).click()
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 @@ -25,13 +25,13 @@ test.describe('Senior managers', () => {
['Pathway 3: heads of service', '/pathway-3', 'Pathway 3: heads of service'],
['Pathway 4: practice leaders', '/pathway-4', 'Pathway 4: practice leaders'],
['View all programmes', '/development-programmes', 'Child and family social work development programmes'],
['Explore all 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) {
test(`Goes to the ${link[0]} page`, async ({ page }) => {
await page.goto('/senior-managers')
await page.getByRole('link', { name: link[0], exact: true }).click()
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 @@ -11,7 +11,7 @@ test.describe('Header', () => {
['Career stages', '/career-stages'],
['Development programmes', '/development-programmes'],
['Explore roles', '/explore-roles'],
['Resources and learning', '/resources-learning'],
//['Resources and learning', '/resources-learning'],
]

for (const link of links) {
Expand Down
4 changes: 2 additions & 2 deletions browser-tests/content-regression-tests/tests/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ 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'],
['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.getByRole('link', { name: link[0], exact: true }).click()
await page.getByRole('link', { name: link[0], exact: true }).last().click()
await expect(page.locator('h1', { hasText: new RegExp(`^${link[2]}$`) })).toBeVisible()
})
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'

test.describe('Resources and learning', () => {
test.describe.skip('Resources and learning', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/resources-learning')
})
Expand Down

0 comments on commit 8d55413

Please sign in to comment.