mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-17 03:48:15 +00:00
fix(tests): glossary test, search test, managed ingestion test (#9584)
This commit is contained in:
parent
8415fc214b
commit
dcc55cab2b
@ -4,17 +4,18 @@ describe("glossary", () => {
|
||||
const urn = "urn:li:dataset:(urn:li:dataPlatform:hive,cypress_logging_events,PROD)";
|
||||
const datasetName = "cypress_logging_events";
|
||||
const glossaryTerm = "CypressGlosssaryTerm";
|
||||
const glossaryTermGroup = "CypressGlosssaryGroup";
|
||||
cy.login();
|
||||
const glossaryTermGroup = "CypressGlossaryGroup";
|
||||
cy.loginWithCredentials();
|
||||
cy.goToGlossaryList();
|
||||
|
||||
|
||||
cy.clickOptionWithText("Add Term");
|
||||
cy.addViaModal(glossaryTerm, "Create Glossary Term");
|
||||
cy.addViaModal(glossaryTerm, "Create Glossary Term", "Created Glossary Term!");
|
||||
|
||||
cy.clickOptionWithText("Add Term Group");
|
||||
cy.addViaModal(glossaryTermGroup, "Create Term Group");
|
||||
cy.addViaModal(glossaryTermGroup, "Create Term Group", "Created Term Group!");
|
||||
|
||||
cy.addTermToDataset(urn, datasetName, glossaryTerm);
|
||||
cy.waitTextVisible('Added Terms!')
|
||||
|
||||
cy.goToGlossaryList();
|
||||
cy.clickOptionWithText(glossaryTerm);
|
||||
|
@ -1,17 +1,18 @@
|
||||
const glossaryTermUrl =
|
||||
"/glossaryTerm/urn:li:glossaryTerm:CypressNode.CypressColumnInfoType/Related%20Entities";
|
||||
const SampleCypressHdfsDataset = "SampleCypressHdfsDataset";
|
||||
const glossaryTerms = {
|
||||
glossaryTermUrl:"/glossaryTerm/urn:li:glossaryTerm:CypressNode.CypressColumnInfoType/Related%20Entities",
|
||||
SampleCypressHdfsDataset:"SampleCypressHdfsDataset"
|
||||
};
|
||||
|
||||
const applyTagFilter = (tag) => {
|
||||
cy.get('[data-icon="filter"]').click();
|
||||
cy.contains("Filter").should("be.visible");
|
||||
cy.get('[aria-label="filter"]').should('be.visible').click()
|
||||
cy.waitTextVisible("Filter");
|
||||
cy.get(`[data-testid="facet-tags-${tag}"]`).click({ force: true });
|
||||
};
|
||||
|
||||
const applyAdvancedSearchFilter = (filterType, value) => {
|
||||
cy.get('[aria-label="filter"]').click();
|
||||
cy.get('[id="search-results-advanced-search"]').click();
|
||||
cy.get('[class="anticon anticon-plus sc-dvXYtj iduHXF"]').click();
|
||||
cy.clickOptionWithText('Add Filter');
|
||||
|
||||
if (filterType === "Tag") {
|
||||
applyTagFilterInSearch(value);
|
||||
@ -21,21 +22,18 @@ const applyAdvancedSearchFilter = (filterType, value) => {
|
||||
};
|
||||
|
||||
const applyBasicSearchFilter = () => {
|
||||
cy.contains("Basic").should("be.visible");
|
||||
cy.get('[class="anticon anticon-plus sc-dvXYtj iduHXF"]').click();
|
||||
cy.waitTextVisible("Basic");
|
||||
cy.clickOptionWithText('Add Filter');
|
||||
};
|
||||
|
||||
const searchByConceptsWithLogicalOperator = (concept1, concept2, operator) => {
|
||||
cy.contains("Filters");
|
||||
cy.waitTextVisible("Filters");
|
||||
applyBasicSearchFilter();
|
||||
|
||||
applyTagFilterInSearch(concept1);
|
||||
|
||||
cy.get('[class="anticon anticon-plus sc-dvXYtj iduHXF"]').click();
|
||||
cy.clickOptionWithText('Add Filter');
|
||||
applyDescriptionFilterInAdvancedSearch(concept2);
|
||||
|
||||
cy.get('[title="all filters"]').click();
|
||||
cy.contains(operator).click({ force: true });
|
||||
cy.clickOptionWithText(operator)
|
||||
};
|
||||
|
||||
// Helper function to apply tag filter in basic search
|
||||
@ -46,62 +44,59 @@ const applyTagFilterInSearch = (tag) => {
|
||||
|
||||
// Helper function to apply description filter in advanced search
|
||||
const applyDescriptionFilterInAdvancedSearch = (value) => {
|
||||
cy.get('[data-testid="adv-search-add-filter-description"]').click({
|
||||
force: true,
|
||||
});
|
||||
cy.get('[data-testid="adv-search-add-filter-description"]').click({ force: true });
|
||||
cy.get('[data-testid="edit-text-input"]').type(value);
|
||||
cy.get('[data-testid="edit-text-done-btn"]').click({ force: true });
|
||||
};
|
||||
|
||||
describe("glossaryTerm", () => {
|
||||
beforeEach(() => {
|
||||
cy.loginWithCredentials();
|
||||
cy.visit(glossaryTermUrl);
|
||||
cy.loginWithCredentials();
|
||||
cy.visit(glossaryTerms.glossaryTermUrl);
|
||||
});
|
||||
|
||||
it("can visit related entities", () => {
|
||||
cy.contains("of 0").should("not.exist");
|
||||
cy.contains(/of [0-9]+/);
|
||||
cy.waitTextVisible(/of [0-9]+/);
|
||||
});
|
||||
|
||||
it("can search related entities by query", () => {
|
||||
cy.get('[placeholder="Filter entities..."]').click().type("logging{enter}");
|
||||
cy.contains("of 0").should("not.exist");
|
||||
cy.contains(/of 1/);
|
||||
cy.contains("cypress_logging_events");
|
||||
cy.contains(SampleCypressHdfsDataset).should("not.exist");
|
||||
cy.waitTextVisible(/of 1/);
|
||||
cy.waitTextVisible("cypress_logging_events");
|
||||
cy.contains(glossaryTerms.SampleCypressHdfsDataset).should("not.exist");
|
||||
});
|
||||
|
||||
it("can apply filters on related entities", () => {
|
||||
applyTagFilter("urn:li:tag:Cypress2");
|
||||
cy.contains("cypress_logging_events").should("not.exist");
|
||||
cy.contains(SampleCypressHdfsDataset);
|
||||
cy.waitTextVisible(glossaryTerms.SampleCypressHdfsDataset);
|
||||
});
|
||||
|
||||
it("can search related entities by a specific tag using advanced search", () => {
|
||||
applyAdvancedSearchFilter("Tag", "Cypress2");
|
||||
cy.contains(SampleCypressHdfsDataset);
|
||||
cy.contains("of 1");
|
||||
cy.waitTextVisible(glossaryTerms.SampleCypressHdfsDataset);
|
||||
cy.waitTextVisible("of 1");
|
||||
});
|
||||
|
||||
it("can search related entities by AND-ing two concepts using search", () => {
|
||||
applyAdvancedSearchFilter();
|
||||
|
||||
cy.get('[class="anticon anticon-plus sc-dvXYtj iduHXF"]').click();
|
||||
cy.clickOptionWithText('Add Filter');
|
||||
cy.get('[data-testid="adv-search-add-filter-description"]').click({
|
||||
force: true,
|
||||
});
|
||||
cy.get('[data-testid="edit-text-input"]').type("my hdfs");
|
||||
cy.get('[data-testid="edit-text-done-btn"]').click({ force: true });
|
||||
cy.contains(SampleCypressHdfsDataset);
|
||||
cy.contains("of 1");
|
||||
cy.waitTextVisible(glossaryTerms.SampleCypressHdfsDataset);
|
||||
cy.waitTextVisible("of 1");
|
||||
});
|
||||
|
||||
it("can search related entities by OR-ing two concepts using search", () => {
|
||||
applyAdvancedSearchFilter("Description", "single log event");
|
||||
applyBasicSearchFilter("Tag", "Cypress2");
|
||||
searchByConceptsWithLogicalOperator("Cypress", "Tag", "any filter");
|
||||
cy.contains(SampleCypressHdfsDataset);
|
||||
cy.contains("cypress_logging_events");
|
||||
cy.waitTextVisible(glossaryTerms.SampleCypressHdfsDataset);
|
||||
cy.waitTextVisible("cypress_logging_events");
|
||||
});
|
||||
});
|
@ -11,12 +11,11 @@ describe("run managed ingestion", () => {
|
||||
cy.login();
|
||||
cy.goToIngestionPage();
|
||||
cy.clickOptionWithText("Create new source");
|
||||
cy.clickOptionWithText("Other");
|
||||
cy.clickOptionWithTextToScrollintoView("Other");
|
||||
|
||||
cy.waitTextVisible("source-type");
|
||||
readyToTypeEditor().type('{ctrl}a').clear()
|
||||
readyToTypeEditor().type("source:");
|
||||
readyToTypeEditor().type("{enter}");
|
||||
readyToTypeEditor().type("source:{enter}");
|
||||
readyToTypeEditor().type(" type: demo-data");
|
||||
readyToTypeEditor().type("{enter}");
|
||||
// no space because the editor starts new line at same indentation
|
||||
|
@ -1,14 +1,3 @@
|
||||
const datasetNames = {
|
||||
dashboardsType: "Baz Dashboard",
|
||||
pipelinesType: "Users",
|
||||
MlmoduleType: "cypress-model",
|
||||
glossaryTermsType: "CypressColumnInfoType",
|
||||
tags: "some-cypress-feature-1",
|
||||
hivePlatform: "cypress_logging_events",
|
||||
airflowPlatform: "User Creations",
|
||||
hdfsPlatform: "SampleHdfsDataset"
|
||||
};
|
||||
|
||||
const searchToExecute = (value) => {
|
||||
cy.get("input[data-testid=search-input]").eq(0).type(`${value}{enter}`);
|
||||
cy.waitTextPresent("Type");
|
||||
@ -27,32 +16,39 @@ const verifyFilteredEntity = (text) => {
|
||||
cy.get('.ant-typography').contains(text).should('be.visible');
|
||||
};
|
||||
|
||||
const clickAndVerifyEntity = (entity) => {
|
||||
cy.get('[class*="entityUrn-urn"]').first()
|
||||
.find('a[href*="urn:li"] span[class^="ant-typography"]').last().invoke('text')
|
||||
.then((text) => {
|
||||
cy.contains(text).click();
|
||||
verifyFilteredEntity(text);
|
||||
verifyFilteredEntity(entity);
|
||||
});
|
||||
}
|
||||
|
||||
describe("auto-complete dropdown, filter plus query search test", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.loginWithCredentials();
|
||||
cy.visit('/');
|
||||
});
|
||||
|
||||
|
||||
it.skip("Verify the 'filter by type' section + query", () => {
|
||||
|
||||
//Dashboard
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Type", "Dashboards", "filter__entityType");
|
||||
cy.clickOptionWithText(datasetNames.dashboardsType);
|
||||
verifyFilteredEntity('Dashboard');
|
||||
clickAndVerifyEntity('Dashboard')
|
||||
|
||||
//Ml Models
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Type", "ML Models", "filter__entityType");
|
||||
cy.clickOptionWithText(datasetNames.MlmoduleType);
|
||||
verifyFilteredEntity('ML Model');
|
||||
selectFilteredEntity("Type", "ML Models", "filter__entityType");
|
||||
clickAndVerifyEntity('ML Model');
|
||||
|
||||
//Piplines
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Type", "Pipelines", "filter__entityType");
|
||||
cy.clickOptionWithText(datasetNames.pipelinesType);
|
||||
verifyFilteredEntity('Pipeline');
|
||||
selectFilteredEntity("Type", "Pipelines", "filter__entityType");
|
||||
clickAndVerifyEntity('Pipeline');
|
||||
|
||||
});
|
||||
|
||||
@ -61,8 +57,8 @@ describe("auto-complete dropdown, filter plus query search test", () => {
|
||||
//Glossary Term
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Type", "Glossary Terms", "filter__entityType");
|
||||
cy.clickOptionWithText(datasetNames.glossaryTermsType);
|
||||
verifyFilteredEntity('Glossary Term');
|
||||
clickAndVerifyEntity('Glossary Term')
|
||||
|
||||
});
|
||||
|
||||
it("Verify the 'filter by platform' section + query", () => {
|
||||
@ -70,20 +66,17 @@ describe("auto-complete dropdown, filter plus query search test", () => {
|
||||
//Hive
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Platform", "Hive", "filter_platform");
|
||||
cy.clickOptionWithText(datasetNames.hivePlatform);
|
||||
verifyFilteredEntity('Hive');
|
||||
clickAndVerifyEntity('Hive')
|
||||
|
||||
//HDFS
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Platform", "HDFS", "filter_platform");
|
||||
cy.clickOptionWithText(datasetNames.hdfsPlatform);
|
||||
verifyFilteredEntity('HDFS');
|
||||
clickAndVerifyEntity('HDFS')
|
||||
|
||||
//Airflow
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Platform", "Airflow", "filter_platform");
|
||||
cy.clickOptionWithText(datasetNames.airflowPlatform);
|
||||
verifyFilteredEntity('Airflow');
|
||||
clickAndVerifyEntity('Airflow')
|
||||
});
|
||||
|
||||
it("Verify the 'filter by tag' section + query", () => {
|
||||
@ -91,8 +84,8 @@ describe("auto-complete dropdown, filter plus query search test", () => {
|
||||
//CypressFeatureTag
|
||||
searchToExecute("*");
|
||||
selectFilteredEntity("Tag", "CypressFeatureTag", "filter_tags");
|
||||
cy.clickOptionWithText(datasetNames.tags);
|
||||
clickAndVerifyEntity('Tags')
|
||||
cy.mouseover('[data-testid="tag-CypressFeatureTag"]');
|
||||
verifyFilteredEntity('Feature');
|
||||
verifyFilteredEntity('CypressFeatureTag');
|
||||
});
|
||||
});
|
||||
|
@ -27,8 +27,8 @@ Cypress.Commands.add('login', () => {
|
||||
method: 'POST',
|
||||
url: '/logIn',
|
||||
body: {
|
||||
username: Cypress.env('ADMIN_USERNAME'),
|
||||
password: Cypress.env('ADMIN_PASSWORD'),
|
||||
username: Cypress.env('ADMIN_USERNAME'),
|
||||
password: Cypress.env('ADMIN_PASSWORD'),
|
||||
},
|
||||
retryOnStatusCodeFailure: true,
|
||||
});
|
||||
@ -66,7 +66,6 @@ Cypress.Commands.add("logout", () => {
|
||||
Cypress.Commands.add("goToGlossaryList", () => {
|
||||
cy.visit("/glossary");
|
||||
cy.waitTextVisible("Glossary");
|
||||
cy.wait(3000);
|
||||
});
|
||||
|
||||
Cypress.Commands.add("goToDomainList", () => {
|
||||
@ -160,7 +159,11 @@ Cypress.Commands.add("openThreeDotDropdown", () => {
|
||||
});
|
||||
|
||||
Cypress.Commands.add("clickOptionWithText", (text) => {
|
||||
cy.contains(text).click();
|
||||
cy.contains(text).should('be.visible').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("clickOptionWithTextToScrollintoView", (text) => {
|
||||
cy.contains(text).scrollIntoView().click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("deleteFromDropdown", () => {
|
||||
@ -175,10 +178,11 @@ Cypress.Commands.add("addViaFormModal", (text, modelHeader) => {
|
||||
cy.get(".ant-modal-footer > button:nth-child(2)").click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("addViaModal", (text, modelHeader) => {
|
||||
Cypress.Commands.add("addViaModal", (text, modelHeader,verifyMessage) => {
|
||||
cy.waitTextVisible(modelHeader);
|
||||
cy.get(".ant-input-affix-wrapper > input[type='text']").first().type(text);
|
||||
cy.get(".ant-modal-footer > button:nth-child(2)").click();
|
||||
cy.contains(verifyMessage).should('be.visible');
|
||||
});
|
||||
|
||||
Cypress.Commands.add("ensureTextNotPresent", (text) => {
|
||||
@ -333,7 +337,7 @@ Cypress.Commands.add("addGroupMember", (group_name, group_urn, member_name) => {
|
||||
|
||||
Cypress.Commands.add("createGlossaryTermGroup", (term_group_name) => {
|
||||
cy.goToGlossaryList();
|
||||
cy.clickOptionWithTestId("add-term-group-button");
|
||||
cy.clickOptionWithText('Add Term Group');
|
||||
cy.waitTextVisible("Create Term Group");
|
||||
cy.enterTextInTestId("create-glossary-entity-modal-name", term_group_name);
|
||||
cy.clickOptionWithTestId("glossary-entity-modal-create-button");
|
||||
|
Loading…
x
Reference in New Issue
Block a user