Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Pipeline academies automation #691

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('Testing Navigation', () => {
.checkAcademiesServiceNavButtonIsHighlighted()
.checkCurrentURLIsCorrect('/trusts/academies/details?uid=5527')
.checkAllServiceNavItemsPresent();
academiesPage
academiesInTrustPage
.checkDetailsHeadersPresent();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -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(() => {
Expand All @@ -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);
});
});
});
Expand All @@ -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();
});

Expand All @@ -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();
});

Expand All @@ -148,7 +148,7 @@ describe("Testing the components of the Academies page", () => {
.checkCurrentURLIsCorrect('/trusts/academies/pupil-numbers?uid=5527')
.checkAllServiceNavItemsPresent()
.checkAllAcademiesNavItemsPresent();
academiesPage
academiesInTrustPage
.checkPupilNumbersHeadersPresent();
});

Expand All @@ -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();
});

Expand All @@ -169,7 +169,7 @@ describe("Testing the components of the Academies page", () => {
.checkCurrentURLIsCorrect('/trusts/academies/details?uid=5527')
.checkAllServiceNavItemsPresent()
.checkAllAcademiesNavItemsPresent();
academiesPage
academiesInTrustPage
.checkDetailsHeadersPresent();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
});
});
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TableUtility } from "../tableUtility";

class AcademiesPage {
class AcademiesInTrustPage {

elements = {
pageTabs: {
Expand Down Expand Up @@ -149,5 +149,5 @@ class AcademiesPage {
}
}

const academiesPage = new AcademiesPage();
export default academiesPage;
const academiesInTrustPage = new AcademiesInTrustPage();
export default academiesInTrustPage;
Original file line number Diff line number Diff line change
@@ -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;

Loading