Skip to content

Commit

Permalink
Merge pull request #994 from DFE-Digital/test-skip-filter-tests
Browse files Browse the repository at this point in the history
Test skip filter tests
  • Loading branch information
dangood84 authored Jan 23, 2025
2 parents 9d08631 + 8be1126 commit af47e13
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ 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");

// 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();
});
});
Expand Down Expand Up @@ -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
Expand All @@ -328,7 +330,7 @@ describe("Testing the home page", () => {
.hasRegionFilter(filterData.regionName)
.hasLocalAuthorityFilter(filterData.localAuthority)
.hasProjectManagedByFilter(filterData.projectManagedBy)
.hasProjectStatusFilter(filterData.status);
// .hasProjectStatusFilter(filterData.status);
})


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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"]'
};


Expand All @@ -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) => {
Expand All @@ -134,15 +138,15 @@ 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(() => {

this.withProjectFilter(this.FilterData.projectId);
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();

Expand Down

0 comments on commit af47e13

Please sign in to comment.