diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/navigation.cy.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/navigation.cy.ts index 77ec30052..ebbc819b9 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/navigation.cy.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/navigation.cy.ts @@ -1,5 +1,5 @@ import navigation from "../../pages/navigation"; -import academiesPage from "../../pages/trusts/academiesPage"; +import academiesInTrustPage from "../../pages/trusts/academiesInTrustPage"; import governancePage from "../../pages/trusts/governancePage"; import contactsPage from "../../pages/trusts/contactsPage"; import overviewPage from "../../pages/trusts/overviewPage"; @@ -131,7 +131,7 @@ describe('Testing Navigation', () => { .checkAcademiesServiceNavButtonIsHighlighted() .checkCurrentURLIsCorrect('/trusts/academies/details?uid=5527') .checkAllServiceNavItemsPresent(); - academiesPage + academiesInTrustPage .checkDetailsHeadersPresent(); }); diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/academies.cy.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/academies-in-trust.cy.ts similarity index 79% rename from tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/academies.cy.ts rename to tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/academies-in-trust.cy.ts index abc08a72e..e7d411e63 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/academies.cy.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/academies-in-trust.cy.ts @@ -1,8 +1,8 @@ -import academiesPage from "../../../pages/trusts/academiesPage"; +import academiesInTrustPage from "../../../pages/trusts/academiesInTrustPage"; import navigation from "../../../pages/navigation"; import commonPage from "../../../pages/commonPage"; -describe("Testing the components of the Academies page", () => { +describe("Testing the components of the Academies in this trust page", () => { describe("Details tab", () => { beforeEach(() => { @@ -16,37 +16,37 @@ describe("Testing the components of the Academies page", () => { }); it("Checks the correct details page headers are present", () => { - academiesPage + academiesInTrustPage .checkDetailsHeadersPresent(); }); it("Checks that the correct school types are present", () => { - academiesPage + academiesInTrustPage .checkSchoolTypesOnDetailsTable(); }); it("Checks that a different and larger trusts correct school types are present", () => { cy.visit('/trusts/academies/details?uid=5143'); - academiesPage + academiesInTrustPage .checkSchoolTypesOnDetailsTable(); }); it("Checks the detail page sorting", () => { cy.visit('/trusts/academies/details?uid=5143'); - academiesPage + academiesInTrustPage .checkTrustDetailsSorting(); }); it('should match the academy count in the sidebar with the actual table row count on the Details page', () => { - academiesPage.getAcademyCountFromSidebar().then(expectedCount => { - academiesPage.getTableRowCountOnDetailsPage().should('eq', expectedCount); + academiesInTrustPage.getAcademyCountFromSidebar().then(expectedCount => { + academiesInTrustPage.getTableRowCountOnDetailsPage().should('eq', expectedCount); }); }); it('should match the academy count in the sidebar with the actual table row count on the Details page after visiting', () => { cy.visit('/trusts/academies/details?uid=5143'); - academiesPage.getAcademyCountFromSidebar().then(expectedCount => { - academiesPage.getTableRowCountOnDetailsPage().should('eq', expectedCount); + academiesInTrustPage.getAcademyCountFromSidebar().then(expectedCount => { + academiesInTrustPage.getTableRowCountOnDetailsPage().should('eq', expectedCount); }); }); }); @@ -64,31 +64,31 @@ describe("Testing the components of the Academies page", () => { }); it("Checks the correct Pupil numbers page headers are present", () => { - academiesPage + academiesInTrustPage .checkPupilNumbersHeadersPresent(); }); it("Checks the Pupil numbers page sorting", () => { - academiesPage + academiesInTrustPage .checkPupilNumbersSorting(); }); it('should match the academy count in the sidebar with the actual table row count on the Pupil numbers page', () => { - academiesPage.getAcademyCountFromSidebar().then(expectedCount => { - academiesPage.getTableRowCountOnPupilNumbersPage().should('eq', expectedCount); + academiesInTrustPage.getAcademyCountFromSidebar().then(expectedCount => { + academiesInTrustPage.getTableRowCountOnPupilNumbersPage().should('eq', expectedCount); }); }); it('should match the academy count in the sidebar with the actual table row count on the Pupil numbers page after visiting', () => { cy.visit('/trusts/academies/pupil-numbers?uid=5143'); - academiesPage.getAcademyCountFromSidebar().then(expectedCount => { - academiesPage.getTableRowCountOnPupilNumbersPage().should('eq', expectedCount); + academiesInTrustPage.getAcademyCountFromSidebar().then(expectedCount => { + academiesInTrustPage.getTableRowCountOnPupilNumbersPage().should('eq', expectedCount); }); }); it("Checks the Pupil numbers page sorting on a larger trust", () => { cy.visit('/trusts/academies/pupil-numbers?uid=5143'); - academiesPage + academiesInTrustPage .checkPupilNumbersSorting(); }); @@ -106,31 +106,31 @@ describe("Testing the components of the Academies page", () => { }); it("Checks the correct Free school meals page headers are present", () => { - academiesPage + academiesInTrustPage .checkFreeSchoolMealsHeadersPresent(); }); it("Checks the Free school meals page sorting", () => { - academiesPage + academiesInTrustPage .checkFreeSchoolMealsSorting(); }); it('should match the academy count in the sidebar with the actual table row count on the Free school meals page', () => { - academiesPage.getAcademyCountFromSidebar().then(expectedCount => { - academiesPage.getTableRowCountOnFreeSchoolMealsPage().should('eq', expectedCount); + academiesInTrustPage.getAcademyCountFromSidebar().then(expectedCount => { + academiesInTrustPage.getTableRowCountOnFreeSchoolMealsPage().should('eq', expectedCount); }); }); it('should match the academy count in the sidebar with the actual table row count on the Free school meals page after visiting', () => { cy.visit('/trusts/academies/free-school-meals?uid=5143'); - academiesPage.getAcademyCountFromSidebar().then(expectedCount => { - academiesPage.getTableRowCountOnFreeSchoolMealsPage().should('eq', expectedCount); + academiesInTrustPage.getAcademyCountFromSidebar().then(expectedCount => { + academiesInTrustPage.getTableRowCountOnFreeSchoolMealsPage().should('eq', expectedCount); }); }); it("Checks the Free school meals page sorting on a larger trust", () => { cy.visit('/trusts/academies/free-school-meals?uid=5143'); - academiesPage + academiesInTrustPage .checkFreeSchoolMealsSorting(); }); @@ -148,7 +148,7 @@ describe("Testing the components of the Academies page", () => { .checkCurrentURLIsCorrect('/trusts/academies/pupil-numbers?uid=5527') .checkAllServiceNavItemsPresent() .checkAllAcademiesNavItemsPresent(); - academiesPage + academiesInTrustPage .checkPupilNumbersHeadersPresent(); }); @@ -158,7 +158,7 @@ describe("Testing the components of the Academies page", () => { .checkCurrentURLIsCorrect('/trusts/academies/free-school-meals?uid=5527') .checkAllServiceNavItemsPresent() .checkAllAcademiesNavItemsPresent(); - academiesPage + academiesInTrustPage .checkFreeSchoolMealsHeadersPresent(); }); @@ -169,7 +169,7 @@ describe("Testing the components of the Academies page", () => { .checkCurrentURLIsCorrect('/trusts/academies/details?uid=5527') .checkAllServiceNavItemsPresent() .checkAllAcademiesNavItemsPresent(); - academiesPage + academiesInTrustPage .checkDetailsHeadersPresent(); }); diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/pipeline-academies.cy.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/pipeline-academies.cy.ts new file mode 100644 index 000000000..cc3ab9546 --- /dev/null +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/trusts/pipeline-academies.cy.ts @@ -0,0 +1,50 @@ +import commonPage from "../../../pages/commonPage"; + +const testTrustData = [ + { + typeOfTrust: "single academy trust", + uid: 5527 + }, + { + typeOfTrust: "multi academy trust", + uid: 5712 + } +]; + +describe.skip("Testing the Pipeline academies pages", () => { + testTrustData.forEach(({ typeOfTrust, uid }) => { + + describe(`On the Pre advisory board page for a ${typeOfTrust}`, () => { + beforeEach(() => { + cy.login(); + cy.visit(`/trusts/contacts/editsfsolead?uid=${uid}`); + }); + + it("Checks the browser title is correct", () => { + pipelineAcademiesPage; + }); + }); + + describe(`On the Post advisory board page for a ${typeOfTrust}`, () => { + beforeEach(() => { + cy.login(); + cy.visit(`/trusts/contacts/editsfsolead?uid=${uid}`); + }); + + it("Checks the browser title is correct", () => { + pipelineAcademiesPage; + }); + }); + + describe(`On the Free schools page for a ${typeOfTrust}`, () => { + beforeEach(() => { + cy.login(); + cy.visit(`/trusts/contacts/editsfsolead?uid=${uid}`); + }); + + it("Checks the browser title is correct", () => { + pipelineAcademiesPage; + }); + }); + }); +}); diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/academiesPage.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/academiesInTrustPage.ts similarity index 98% rename from tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/academiesPage.ts rename to tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/academiesInTrustPage.ts index 5a0fad63c..91ad70657 100644 --- a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/academiesPage.ts +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/academiesInTrustPage.ts @@ -1,6 +1,6 @@ import { TableUtility } from "../tableUtility"; -class AcademiesPage { +class AcademiesInTrustPage { elements = { pageTabs: { @@ -149,5 +149,5 @@ class AcademiesPage { } } -const academiesPage = new AcademiesPage(); -export default academiesPage; +const academiesInTrustPage = new AcademiesInTrustPage(); +export default academiesInTrustPage; diff --git a/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/pipelineAcademiesPage.ts b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/pipelineAcademiesPage.ts new file mode 100644 index 000000000..3a89eb937 --- /dev/null +++ b/tests/DFE.FindInformationAcademiesTrusts.CypressTests/cypress/pages/trusts/pipelineAcademiesPage.ts @@ -0,0 +1,59 @@ +import { TableUtility } from "../tableUtility"; + +class PipelineAcademies { + + elements = { + preAdvisory: { + section: () => cy.get('[data-testid="pre-advisory-board-table"]'), + schoolName: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-school-name"]'), + schoolNameHeader: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-school-name-header"]'), + urn: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-URN"]'), + urnHeader: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-URN-header"]'), + ageRange: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-age-range"]'), + ageRangeHeader: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-age-range-header"]'), + localAuthority: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-local-authority"]'), + localAuthorityHeader: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-local-authority-header"]'), + projectType: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-project-type"]'), + projectTypeHeader: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-project-type-header"]'), + proposedConversionTransferDate: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-conversion-transfer-date"]'), + proposedConversionTransferDateHeader: () => this.elements.preAdvisory.section().find('[data-testid="pre-advisory-board-conversion-transfer-date-header"]'), + }, + postAdvisory: { + section: () => cy.get('[data-testid="post-advisory-board-table"]'), + schoolName: () => this.elements.postAdvisory.section().find('[data-testid="post-advisory-board-school-name"]'), + schoolNameHeader: () => this.elements.postAdvisory.section().find('[data-testid="post-advisory-board-school-name-header"]'), + urn: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-URN"]'), + urnHeader: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-URN-header"]'), + ageRange: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-age-range"]'), + ageRangeHeader: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-age-range-header"]'), + localAuthority: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-local-authority"]'), + localAuthorityHeader: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-local-authority-header"]'), + projectType: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-project-type"]'), + projectTypeHeader: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-project-type-header"]'), + proposedConversionTransferDate: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-conversion-transfer-date"]'), + proposedConversionTransferDateHeader: () => this.elements.postAdvisory.section().find('[data-testid="pre-advisory-board-conversion-transfer-date-header"]'), + + }, + freeSchools: { + section: () => cy.get('[data-testid="free-schools-table"]'), + schoolName: () => this.elements.freeSchools.section().find('[data-testid="free-schools-school-name"]'), + schoolNameHeader: () => this.elements.freeSchools.section().find('[data-testid="free-schools-school-name-header"]'), + urn: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-URN"]'), + urnHeader: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-URN-header"]'), + ageRange: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-age-range"]'), + ageRangeHeader: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-age-range-header"]'), + localAuthority: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-local-authority"]'), + localAuthorityHeader: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-local-authority-header"]'), + projectType: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-project-type"]'), + projectTypeHeader: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-project-type-header"]'), + proposedConversionTransferDate: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-conversion-transfer-date"]'), + proposedConversionTransferDateHeader: () => this.elements.freeSchools.section().find('[data-testid="pre-advisory-board-conversion-transfer-date-header"]'), + }, + + }; + +} + +const pipelineAcademiesPage = new PipelineAcademies(); +export default pipelineAcademiesPage; +