mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 09:58:14 +00:00
fix(ui/tests): Cypress test failures (#14090)
This commit is contained in:
parent
7cbc1c3fd3
commit
ee5e280165
@ -34,6 +34,7 @@ const deleteGlossary = (message) => {
|
||||
describe("glossary", () => {
|
||||
beforeEach(() => {
|
||||
cy.setIsThemeV2Enabled(true);
|
||||
Cypress.on("uncaught:exception", (err, runnable) => false);
|
||||
});
|
||||
it("go to glossary page, create terms, term group", () => {
|
||||
cy.loginWithCredentials();
|
||||
@ -46,6 +47,8 @@ describe("glossary", () => {
|
||||
glossaryTermGroup,
|
||||
"glossary-entity-modal-create-button",
|
||||
);
|
||||
cy.wait(2000);
|
||||
nevigateGlossaryPage();
|
||||
cy.clickOptionWithText(glossaryTermGroup);
|
||||
cy.clickOptionWithTestId("add-term-button");
|
||||
cy.addViaModal(
|
||||
|
||||
@ -19,6 +19,7 @@ const createTerm = (glossaryTerm) => {
|
||||
const navigateToParentAndCheckTermGroup = (parentGroup, termGroup) => {
|
||||
cy.get('[data-testid="glossary-browser-sidebar"]')
|
||||
.contains(parentGroup)
|
||||
.wait(2000)
|
||||
.click();
|
||||
cy.get('*[class^="GlossaryEntitiesList"]')
|
||||
.contains(termGroup)
|
||||
@ -31,6 +32,7 @@ const moveGlossaryEntityToGroup = (
|
||||
confirmationMsg,
|
||||
) => {
|
||||
cy.clickOptionWithText(sourceEntity);
|
||||
cy.wait(2000);
|
||||
cy.contains("Created Glossary Term!").should("not.exist");
|
||||
cy.get(".anticon-edit").should("be.visible");
|
||||
cy.get('[data-testid="MoreVertOutlinedIcon"]').should("be.visible").click();
|
||||
@ -55,6 +57,7 @@ const deleteGlossary = (message) => {
|
||||
describe("glossary sidebar navigation test", () => {
|
||||
beforeEach(() => {
|
||||
cy.setIsThemeV2Enabled(true);
|
||||
Cypress.on("uncaught:exception", (err, runnable) => false);
|
||||
cy.loginWithCredentials();
|
||||
cy.skipIntroducePage();
|
||||
});
|
||||
@ -68,10 +71,12 @@ describe("glossary sidebar navigation test", () => {
|
||||
glossaryTermGroup,
|
||||
);
|
||||
cy.clickOptionWithTestId("glossary-entity-modal-create-button");
|
||||
cy.waitTextVisible(`Created Term Group!`);
|
||||
cy.wait(1000);
|
||||
nevigateGlossaryPage();
|
||||
cy.get('[data-testid="glossary-browser-sidebar"]')
|
||||
.contains(glossaryTermGroup)
|
||||
.should("be.visible");
|
||||
cy.waitTextVisible(`Created Term Group!`);
|
||||
cy.clickOptionWithText(glossaryTermGroup);
|
||||
cy.clickOptionWithTestId("add-term-button");
|
||||
createTerm(glossaryTerm);
|
||||
@ -141,6 +146,7 @@ describe("glossary sidebar navigation test", () => {
|
||||
deleteGlossary("Deleted Term Group!");
|
||||
|
||||
// Ensure it is no longer in the sidebar navigator
|
||||
nevigateGlossaryPage();
|
||||
cy.ensureTextNotPresent(glossaryTerm);
|
||||
cy.ensureTextNotPresent(glossaryTermGroup);
|
||||
});
|
||||
|
||||
@ -25,8 +25,8 @@ describe("search", () => {
|
||||
cy.visit("/");
|
||||
cy.get("input[data-testid=search-input]").type("*{enter}");
|
||||
|
||||
cy.get("[data-testid=search-filters-v1").should("exist");
|
||||
cy.get("[data-testid=search-filters-v2").should("not.exist");
|
||||
cy.get("[data-testid=search-filters-v1]").should("exist");
|
||||
cy.get("[data-testid=search-filters-v2]").should("not.exist");
|
||||
});
|
||||
|
||||
it("should show new search filters if search filters v2 flag is on", () => {
|
||||
@ -35,8 +35,8 @@ describe("search", () => {
|
||||
cy.visit("/");
|
||||
cy.get("input[data-testid=search-input]").type("*{enter}");
|
||||
|
||||
cy.get("[data-testid=search-filters-v1").should("not.exist");
|
||||
cy.get("[data-testid=search-filters-v2").should("exist");
|
||||
cy.get("[data-testid=search-filters-v1]").should("not.exist");
|
||||
cy.get("[data-testid=search-filters-v2]").should("exist");
|
||||
});
|
||||
|
||||
it("should add and remove multiple filters with no issues", () => {
|
||||
@ -54,19 +54,24 @@ describe("search", () => {
|
||||
.click();
|
||||
|
||||
// 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.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,
|
||||
multiple: true,
|
||||
});
|
||||
cy.url().should(
|
||||
"include",
|
||||
"filter_tags___false___EQUAL___0=urn%3Ali%3Atag%3ACypress",
|
||||
);
|
||||
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("[data-testid=update-filters").eq(1).click({ force: true });
|
||||
cy.get("[data-testid=filter-dropdown-Type]").click({ force: true });
|
||||
cy.get("[data-testid=filter-option-Datasets]").click({ force: true });
|
||||
cy.get("[data-testid=update-filters]").click({
|
||||
force: true,
|
||||
multiple: true,
|
||||
});
|
||||
cy.url().should(
|
||||
"include",
|
||||
"filter__entityType%E2%90%9EtypeNames___false___EQUAL___1=DATASET",
|
||||
@ -76,23 +81,23 @@ describe("search", () => {
|
||||
cy.contains("SampleCypressHdfsDataset");
|
||||
|
||||
// ensure active filters are visible under filter dropdowns
|
||||
cy.get("[data-testid=active-filter-Datasets");
|
||||
cy.get("[data-testid=active-filter-Cypress");
|
||||
cy.get("[data-testid=active-filter-Datasets]");
|
||||
cy.get("[data-testid=active-filter-Cypress]");
|
||||
|
||||
// remove datasets filter by clicking "x" on active filter
|
||||
cy.get("[data-testid=remove-filter-Datasets").click({ force: true });
|
||||
cy.get("[data-testid=remove-filter-Datasets]").click({ force: true });
|
||||
cy.url().should(
|
||||
"not.include",
|
||||
"filter__entityType%E2%90%9EtypeNames___false___EQUAL___1=DATASET",
|
||||
);
|
||||
cy.get("[data-testid=active-filter-Datasets").should("not.exist");
|
||||
cy.get("[data-testid=active-filter-Datasets]").should("not.exist");
|
||||
|
||||
// remove other filter using "clear all" button
|
||||
cy.get("[data-testid=clear-all-filters").click({ force: true });
|
||||
cy.get("[data-testid=clear-all-filters]").click({ force: true });
|
||||
cy.url().should(
|
||||
"not.include",
|
||||
"filter_tags___false___EQUAL___0=urn%3Ali%3Atag%3ACypress",
|
||||
);
|
||||
cy.get("[data-testid=active-filter-Cypress").should("not.exist");
|
||||
cy.get("[data-testid=active-filter-Cypress]").should("not.exist");
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user