Skip to content

Commit

Permalink
fix searchfilters cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
shirshanka committed Jan 22, 2025
1 parent 0501a2b commit 398450c
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions smoke-test/tests/cypress/cypress/e2e/search/searchFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,38 @@ describe("search", () => {
it("should add and remove multiple filters with no issues", () => {
setSearchFiltersFeatureFlag(true);
cy.login();
cy.hideOnboardingTour();
cy.visit("/");
cy.get("input[data-testid=search-input]").type("*{enter}");
cy.hideOnboardingTour();

// click tag filter dropdown inside of "More Filters"
//cy.get("[data-testid=more-filters-dropdown").click({ force: true });
cy.get("[data-testid=filter-dropdown-Tag").click({ force: true });
// Sometimes the tag filter is in the more section and sometimes it is at the top level - this checks for both
cy.get("body").then(($body) => {
if ($body.find("[data-testid=filter-dropdown-Tag]").length > 0) {
// Tag filter is visible at top level
cy.get("[data-testid=filter-dropdown-Tag]").click({ force: true });
} else {
// Tag filter is inside More Filters
cy.get("[data-testid=more-filters-dropdown]").click({ force: true });
cy.get("[data-testid=more-filter-Tag]").click({ force: true });
}
});

// click and search for tag, save that tag
//
cy.get("[data-testid=search-bar").eq(1).type("cypress");
cy.get("[data-testid=filter-option-Cypress").click({ force: true });
cy.get("[data-testid=update-filters").click({ force: true });
cy.url().should(
"include",
"filter_tags___false___EQUAL___0=urn%3Ali%3Atag%3ACypress",
);
// cy.get("[data-testid=update-filters").should("not.exist");
// Assert that the button is not visible
cy.get("[data-testid=update-filters").should("not.be.visible");

// select datasets filter
cy.get("[data-testid=filter-dropdown-Type").click({ force: true });
cy.get("[data-testid=filter-option-Datasets").click({ force: true });
cy.get(
':nth-child(4) > :nth-child(1) > .ant-dropdown > [data-testid="filter-dropdown"] > [data-testid="update-filters"] > span',
).click({ force: true });
// cy.get("[data-testid=update-filters").click({ force: true });
cy.get("[data-testid=update-filters").eq(1).click({ force: true });
cy.url().should(
"include",
"filter__entityType%E2%90%9EtypeNames___false___EQUAL___1=DATASET",
Expand Down

0 comments on commit 398450c

Please sign in to comment.