From 6784c7c71a0764bf2246383137a411df48b0a6e3 Mon Sep 17 00:00:00 2001 From: Dan Good Date: Thu, 23 Jan 2025 15:42:14 +0000 Subject: [PATCH 1/2] Skipped Cypress tests around filtering by project status and commented out function calls in regard to project status and filter caching in homepage.cy.ts --- .../cypress/e2e/homepage.cy.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/e2e/homepage.cy.ts b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/e2e/homepage.cy.ts index a97ed0463..c1b5ee1b1 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/e2e/homepage.cy.ts +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/e2e/homepage.cy.ts @@ -176,10 +176,10 @@ describe("Testing the home page", () => { .clearFilters(); }); - it("Should be able to filter projects by project status", () => { + it.skip("Should be able to filter projects by project status", () => { homePage .openFilter() - .withProjectStatusFilter("Pre-opening") + //.withProjectStatusFilter("Pre-opening") .applyFilters(); projectTable.allRowsHaveProjectStatus("Pre-opening"); @@ -187,7 +187,7 @@ describe("Testing the home page", () => { // Filter is displayed and has the searched value // clear proves its visible, as the visibility checks don't work homePage - .hasProjectStatusFilter("Pre-opening") + //.hasProjectStatusFilter("Pre-opening") .clearFilters(); }); }); @@ -312,7 +312,9 @@ describe("Testing the home page", () => { }); }); - describe("Filter cache", () => { + + + describe.skip("Filter cache", () => { it("Should retain filter values after navigating away from the page and back again", () => { homePage @@ -328,7 +330,7 @@ describe("Testing the home page", () => { .hasRegionFilter(filterData.regionName) .hasLocalAuthorityFilter(filterData.localAuthority) .hasProjectManagedByFilter(filterData.projectManagedBy) - .hasProjectStatusFilter(filterData.status); + // .hasProjectStatusFilter(filterData.status); }) From 8be1126d52c8f784c9a76c42f70dcc2d2bc67f4f Mon Sep 17 00:00:00 2001 From: Dan Good Date: Thu, 23 Jan 2025 15:43:13 +0000 Subject: [PATCH 2/2] Commented out code in regard to selecting or verifying filtering by project status --- .../cypress/pages/homePage.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/pages/homePage.ts b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/pages/homePage.ts index 483874b81..3d14ec436 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/pages/homePage.ts +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.CypressTests/cypress/pages/homePage.ts @@ -75,18 +75,22 @@ class HomePage { return this; } - +/* public withProjectStatusFilter(projectStatus: string): this { cy.getByTestId(`${projectStatus}-option`).check({ force: true }); return this; } +*/ + +/* public hasProjectStatusFilter(projectStatus: string): this { cy.getByTestId(`${projectStatus}-option`).should("be.checked"); return this; } +*/ public applyFilters(): this { cy.getByTestId("apply-filters").click(); @@ -108,7 +112,7 @@ class HomePage { regionName: '[data-testid="region-name"]', localAuthority: '[data-testid="local-authority"]', projectManagedBy: '[data-testid="project-managed-by"]', - status: '[data-testid="status"]' + // status: '[data-testid="status"]' }; @@ -122,9 +126,9 @@ class HomePage { const hasRegionName = $row.find(dataTestIds.regionName).text().trim() !== ""; const hasLocalAuthority = $row.find(dataTestIds.localAuthority).text().trim() !== ""; const hasProjectManagedBy = $row.find(dataTestIds.projectManagedBy).text().trim() !== ""; - const hasStatus = $row.find(dataTestIds.status).text().trim() !== ""; + // const hasStatus = $row.find(dataTestIds.status).text().trim() !== ""; - return hasProjectTitleOrId && hasRegionName && hasLocalAuthority && hasProjectManagedBy && hasStatus; + return hasProjectTitleOrId && hasRegionName && hasLocalAuthority && hasProjectManagedBy //&& hasStatus; }) .first() .then((firstRow) => { @@ -134,7 +138,7 @@ class HomePage { this.FilterData.regionName = Cypress.$(firstRow).find(dataTestIds.regionName).text().trim(); this.FilterData.localAuthority = Cypress.$(firstRow).find(dataTestIds.localAuthority).text().trim(); this.FilterData.projectManagedBy = Cypress.$(firstRow).find(dataTestIds.projectManagedBy).text().trim(); - this.FilterData.status = Cypress.$(firstRow).find(dataTestIds.status).text().trim(); + // this.FilterData.status = Cypress.$(firstRow).find(dataTestIds.status).text().trim(); }).then(() => { @@ -142,7 +146,7 @@ class HomePage { this.withRegionFilter(this.FilterData.regionName); this.withLocalAuthorityFilter(this.FilterData.localAuthority); this.withProjectManagedByFilter(this.FilterData.projectManagedBy); - this.withProjectStatusFilter(this.FilterData.status); + // this.withProjectStatusFilter(this.FilterData.status); this.applyFilters();