From 9b11c536030cbd0736fce0305f0c9402bb369f63 Mon Sep 17 00:00:00 2001 From: CMurrell148 Date: Mon, 2 Dec 2024 12:19:11 +0000 Subject: [PATCH 1/6] add safeguarding tests --- .../e2e/regression/trusts/ofsted-page.cy.ts | 42 ++++++++++- .../cypress/pages/trusts/ofstedPage.ts | 70 +++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts index 9f0890cbf..ef9723ac0 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts @@ -94,6 +94,46 @@ describe("Testing the Ofsted page and its subpages ", () => { }); + describe("Testing the Ofsted Safeguarding and concerns page ", () => { + beforeEach(() => { + cy.login(); + cy.visit('/trusts/ofsted/safeguarding-and-concerns?uid=5143'); + }); + + it("Checks the correct Ofsted safeguarding and concerns subpage header is present", () => { + ofstedPage + .checkOfstedSafeguardingConcernsPageHeaderPresent(); + }); + + it("Checks the correct Ofsted safeguarding and concerns headers are present", () => { + ofstedPage + .checkOfstedSafeguardingConcernsTableHeadersPresent(); + }); + + it("Checks the Ofsted page safeguarding and concerns sorting", () => { + ofstedPage + .checkOfstedSafeguardingConcernsSorting(); + }); + + it("Checks that a trusts safeguarding and concerns correct judgement types are present", () => { + ofstedPage + .checkSafeguardingConcernsEffectiveSafeguardingJudgementsPresent() + .checkSafeguardingConcernsCategoryOfConcernJudgementsPresent() + .checkSafeguardingConcernsCategoryOfConcernJudgementsPresent() + .checkSafeguardingConcernsBeforeOrAfterJoiningJudgementsPresent(); + }); + + it("Checks that a different trusts safeguarding and concerns correct judgement types are present", () => { + cy.visit('/trusts/ofsted/safeguarding-and-concerns?uid=5712'); + ofstedPage + .checkSafeguardingConcernsEffectiveSafeguardingJudgementsPresent() + .checkSafeguardingConcernsCategoryOfConcernJudgementsPresent() + .checkSafeguardingConcernsCategoryOfConcernJudgementsPresent() + .checkSafeguardingConcernsBeforeOrAfterJoiningJudgementsPresent(); + }); + + }); + describe("Testing the Ofsted important dates page ", () => { beforeEach(() => { cy.login(); @@ -104,7 +144,7 @@ describe("Testing the Ofsted page and its subpages ", () => { it("Checks the correct Ofsted important dates sub page header is present", () => { ofstedPage .checkOfstedImportantDatesPageHeaderPresent(); - }) + }); it("Checks the correct Ofsted important dates table headers are present", () => { ofstedPage diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts index d869b3633..4cad42fa8 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts @@ -46,6 +46,17 @@ class OfstedPage { beforeOrAfterJoiningHeader: () => this.elements.previousRatings.Section().find('[data-testid="ofsted-previous-ratings-before-or-after-joining-header"]'), beforeOrAfterJoining: () => this.elements.previousRatings.Section().find('[data-testid="ofsted-previous-ratings-before-or-after-joining"]'), }, + safeguardingAndConcerns: { + Section: () => cy.get('[data-testid="ofsted-safeguarding-and-concerns-name-table"]'), + SchoolNameHeader: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-and-concerns-name-header"]'), + SchoolName: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-and-concerns-school-name"]'), + effectiveSafeguardingHeader: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-and-concerns-effective-safeguarding-header"]'), + effectiveSafeguarding: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-and-concerns-effective-safeguarding"]'), + categoryOfConcernHeader: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-and-concerns-category-of-concern-header"]'), + categoryOfConcern: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="category-of-concern"]'), + beforeOrAfterJoiningHeader: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-and-concerns-before-or-after-joining-header"]'), + beforeOrAfterJoining: () => this.elements.safeguardingAndConcerns.Section().find('[data-testid="ofsted-safeguarding-before-or-after-joining"]'), + }, importantDates: { Section: () => cy.get('[data-testid="ofsted-important-dates-school-name-table"]'), SchoolName: () => this.elements.importantDates.Section().find('[data-testid="ofsted-important-dates-school-name"]'), @@ -288,6 +299,65 @@ class OfstedPage { return this; } + //Safeguarding and Concerns/// + + public checkOfstedSafeguardingConcernsPageHeaderPresent(): this { + this.elements.subpageHeader().should('contain', 'Safeguarding and concerns'); + return this; + } + + public checkOfstedSafeguardingConcernsTableHeadersPresent(): this { + this.elements.safeguardingAndConcerns.SchoolNameHeader().should('be.visible'); + this.elements.safeguardingAndConcerns.effectiveSafeguardingHeader().should('be.visible'); + this.elements.safeguardingAndConcerns.categoryOfConcern().should('be.visible'); + this.elements.safeguardingAndConcerns.beforeOrAfterJoining().should('be.visible'); + return this; + } + + public checkOfstedSafeguardingConcernsSorting(): this { + TableUtility.checkStringSorting( + this.elements.safeguardingAndConcerns.SchoolName, + this.elements.safeguardingAndConcerns.SchoolNameHeader + ); + TableUtility.checkStringSorting( + this.elements.safeguardingAndConcerns.effectiveSafeguarding, + this.elements.safeguardingAndConcerns.effectiveSafeguardingHeader + ); + TableUtility.checkStringSorting( + this.elements.safeguardingAndConcerns.categoryOfConcern, + this.elements.safeguardingAndConcerns.categoryOfConcernHeader + ); + TableUtility.checkStringSorting( + this.elements.safeguardingAndConcerns.beforeOrAfterJoining, + this.elements.safeguardingAndConcerns.beforeOrAfterJoiningHeader + ); + return this; + } + + public checkSafeguardingConcernsEffectiveSafeguardingJudgementsPresent(): this { + this.elements.safeguardingAndConcerns.effectiveSafeguarding().each((element) => { + const text = element.text(); + expect(text).to.match(/Yes|No|Not recorded/); + }); + return this; + } + + public checkSafeguardingConcernsCategoryOfConcernJudgementsPresent(): this { + this.elements.safeguardingAndConcerns.categoryOfConcern().each((element) => { + const text = element.text(); + expect(text).to.match(/None|Special measures|Serious weakness|Notice to improve|Not yet inspected|Does not apply/); + }); + return this; + } + + public checkSafeguardingConcernsBeforeOrAfterJoiningJudgementsPresent(): this { + this.elements.safeguardingAndConcerns.beforeOrAfterJoining().each((element) => { + const text = element.text(); + expect(text).to.match(/Before|After|Not yet inspected/); + }); + return this; + } + // Important Dates public checkOfstedImportantDatesPageHeaderPresent(): this { From cf1669a4baa995d57f8f286089070da64411e08b Mon Sep 17 00:00:00 2001 From: CMurrell148 Date: Mon, 2 Dec 2024 12:23:15 +0000 Subject: [PATCH 2/6] add data-testid hook to subpage header --- .../Pages/Trusts/Ofsted/SafeguardingAndConcerns.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DfE.FindInformationAcademiesTrusts/Pages/Trusts/Ofsted/SafeguardingAndConcerns.cshtml b/DfE.FindInformationAcademiesTrusts/Pages/Trusts/Ofsted/SafeguardingAndConcerns.cshtml index c1efbfe19..c162251d3 100644 --- a/DfE.FindInformationAcademiesTrusts/Pages/Trusts/Ofsted/SafeguardingAndConcerns.cshtml +++ b/DfE.FindInformationAcademiesTrusts/Pages/Trusts/Ofsted/SafeguardingAndConcerns.cshtml @@ -25,7 +25,7 @@ - +
Safeguarding and concernsSafeguarding and concerns
From 363bd235ce106a0d5287030fb902aabde4e9942a Mon Sep 17 00:00:00 2001 From: CMurrell148 Date: Mon, 2 Dec 2024 12:25:22 +0000 Subject: [PATCH 3/6] remove whitespace --- .../cypress/e2e/regression/trusts/ofsted-page.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts index ef9723ac0..b47e79b30 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/ofsted-page.cy.ts @@ -94,7 +94,7 @@ describe("Testing the Ofsted page and its subpages ", () => { }); - describe("Testing the Ofsted Safeguarding and concerns page ", () => { + describe("Testing the Ofsted Safeguarding and concerns page", () => { beforeEach(() => { cy.login(); cy.visit('/trusts/ofsted/safeguarding-and-concerns?uid=5143'); From 9474f255cb3efab1387421f991e94cf24ad27536 Mon Sep 17 00:00:00 2001 From: CMurrell148 Date: Mon, 2 Dec 2024 16:14:41 +0000 Subject: [PATCH 4/6] add newly added judgements --- .../cypress/pages/trusts/ofstedPage.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts index 4cad42fa8..47fbe116a 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts @@ -130,7 +130,7 @@ class OfstedPage { public checkCurrentRatingsQualityOfEducationJudgementsPresent(): this { this.elements.currentRatings.qualityOfEducation().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); }); return this; } @@ -138,7 +138,7 @@ class OfstedPage { public checkCurrentRatingsBehaviourAndAttitudesJudgementsPresent(): this { this.elements.currentRatings.behaviourAndAttitudes().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); }); return this; } @@ -146,7 +146,7 @@ class OfstedPage { public checkCurrentRatingsPesronalDevelopmentJudgementsPresent(): this { this.elements.currentRatings.personalDevelopment().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); }); return this; } @@ -154,7 +154,7 @@ class OfstedPage { public checkCurrentRatingsLeadershipAndManagementJudgementsPresent(): this { this.elements.currentRatings.leadershipAndManagement().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); }); return this; } @@ -162,7 +162,7 @@ class OfstedPage { public checkCurrentRatingsEarlyYearsProvisionJudgementsPresent(): this { this.elements.currentRatings.earlyYearsProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); }); return this; } @@ -170,7 +170,7 @@ class OfstedPage { public checkCurrentRatingsSixthFormProvisionJudgementsPresent(): this { this.elements.currentRatings.sixthFormProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); }); return this; } @@ -246,7 +246,7 @@ class OfstedPage { public checkPreviousRatingsQualityOfEducationJudgementsPresent(): this { this.elements.previousRatings.qualityOfEducation().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); }); return this; } @@ -254,7 +254,7 @@ class OfstedPage { public checkPreviousRatingsBehaviourAndAttitudesJudgementsPresent(): this { this.elements.previousRatings.behaviourAndAttitudes().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); }); return this; } @@ -262,7 +262,7 @@ class OfstedPage { public checkPreviousRatingsPesronalDevelopmentJudgementsPresent(): this { this.elements.previousRatings.personalDevelopment().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); }); return this; } @@ -270,7 +270,7 @@ class OfstedPage { public checkPreviousRatingsLeadershipAndManagementJudgementsPresent(): this { this.elements.previousRatings.leadershipAndManagement().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); }); return this; } @@ -278,7 +278,7 @@ class OfstedPage { public checkPreviousRatingsEarlyYearsProvisionJudgementsPresent(): this { this.elements.previousRatings.earlyYearsProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); }); return this; } @@ -286,7 +286,7 @@ class OfstedPage { public checkPreviousRatingsSixthFormProvisionJudgementsPresent(): this { this.elements.previousRatings.sixthFormProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply/); + expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); }); return this; } @@ -345,7 +345,7 @@ class OfstedPage { public checkSafeguardingConcernsCategoryOfConcernJudgementsPresent(): this { this.elements.safeguardingAndConcerns.categoryOfConcern().each((element) => { const text = element.text(); - expect(text).to.match(/None|Special measures|Serious weakness|Notice to improve|Not yet inspected|Does not apply/); + expect(text).to.match(/Not yet inspected|Special measures|Serious weakness|Notice to improve|Not yet inspected|Does not apply/); }); return this; } From f7eb3a3e5f79b8512d1081ec926d46d7c0fe217e Mon Sep 17 00:00:00 2001 From: CMurrell148 Date: Mon, 2 Dec 2024 16:59:06 +0000 Subject: [PATCH 5/6] add more reusable ratings match functionality --- .../cypress/pages/trusts/ofstedPage.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts index 47fbe116a..f53cea866 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts @@ -4,6 +4,7 @@ class OfstedPage { // Resolves to a date ({2 digits} {month} {4 digits}) or "No data" string // Tech debt - We are allowing Sep and Sept due to different cultures set on remote vs local builds dateRegex = /^\d{1,2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec) \d{4}$|^No data$/; + previousAndCurrentRatingsMatch = /Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/; elements = { subpageHeader: () => cy.get('[data-testid="subpage-header"]'), @@ -130,7 +131,7 @@ class OfstedPage { public checkCurrentRatingsQualityOfEducationJudgementsPresent(): this { this.elements.currentRatings.qualityOfEducation().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -138,7 +139,7 @@ class OfstedPage { public checkCurrentRatingsBehaviourAndAttitudesJudgementsPresent(): this { this.elements.currentRatings.behaviourAndAttitudes().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -146,7 +147,7 @@ class OfstedPage { public checkCurrentRatingsPesronalDevelopmentJudgementsPresent(): this { this.elements.currentRatings.personalDevelopment().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -154,7 +155,7 @@ class OfstedPage { public checkCurrentRatingsLeadershipAndManagementJudgementsPresent(): this { this.elements.currentRatings.leadershipAndManagement().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -162,7 +163,7 @@ class OfstedPage { public checkCurrentRatingsEarlyYearsProvisionJudgementsPresent(): this { this.elements.currentRatings.earlyYearsProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -170,7 +171,7 @@ class OfstedPage { public checkCurrentRatingsSixthFormProvisionJudgementsPresent(): this { this.elements.currentRatings.sixthFormProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -246,7 +247,7 @@ class OfstedPage { public checkPreviousRatingsQualityOfEducationJudgementsPresent(): this { this.elements.previousRatings.qualityOfEducation().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -254,7 +255,7 @@ class OfstedPage { public checkPreviousRatingsBehaviourAndAttitudesJudgementsPresent(): this { this.elements.previousRatings.behaviourAndAttitudes().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -262,7 +263,7 @@ class OfstedPage { public checkPreviousRatingsPesronalDevelopmentJudgementsPresent(): this { this.elements.previousRatings.personalDevelopment().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -270,7 +271,7 @@ class OfstedPage { public checkPreviousRatingsLeadershipAndManagementJudgementsPresent(): this { this.elements.previousRatings.leadershipAndManagement().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -278,7 +279,7 @@ class OfstedPage { public checkPreviousRatingsEarlyYearsProvisionJudgementsPresent(): this { this.elements.previousRatings.earlyYearsProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } @@ -286,7 +287,7 @@ class OfstedPage { public checkPreviousRatingsSixthFormProvisionJudgementsPresent(): this { this.elements.previousRatings.sixthFormProvision().each((element) => { const text = element.text(); - expect(text).to.match(/Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Does not apply|Insufficient evidence/); + expect(text).to.match(this.previousAndCurrentRatingsMatch); }); return this; } From c85a4cb810e10d4e2367d7c6d6e3b661fab094aa Mon Sep 17 00:00:00 2001 From: CMurrell148 Date: Mon, 2 Dec 2024 17:01:46 +0000 Subject: [PATCH 6/6] remove duplicate outstanding --- .../cypress/pages/trusts/ofstedPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts index f53cea866..789cf0275 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/ofstedPage.ts @@ -4,7 +4,7 @@ class OfstedPage { // Resolves to a date ({2 digits} {month} {4 digits}) or "No data" string // Tech debt - We are allowing Sep and Sept due to different cultures set on remote vs local builds dateRegex = /^\d{1,2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec) \d{4}$|^No data$/; - previousAndCurrentRatingsMatch = /Good|Outstanding|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/; + previousAndCurrentRatingsMatch = /Good|No judgement|Outstanding|Requires improvement|Inadequate|Not yet inspected|Insufficient evidence/; elements = { subpageHeader: () => cy.get('[data-testid="subpage-header"]'),