fix(test): improve cypress tests (#9711)

This commit is contained in:
david-leifker 2024-01-24 16:30:40 -06:00 committed by GitHub
parent 9b051e38d6
commit d6a30a74a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
const urn = "urn:li:dataset:(urn:li:dataPlatform:hive,cypress_logging_events,PROD)"; const urn = "urn:li:dataset:(urn:li:dataPlatform:hive,cypress_logging_events,PROD)";
const datasetName = "cypress_logging_events"; const datasetName = "cypress_logging_events";
const glossaryTerm = "CypressGlosssaryTerm"; const glossaryTerm = "CypressGlossaryTerm";
const glossaryTermGroup = "CypressGlossaryGroup"; const glossaryTermGroup = "CypressGlossaryGroup";
describe("glossary", () => { describe("glossary", () => {
@ -8,9 +8,9 @@ describe("glossary", () => {
cy.loginWithCredentials(); cy.loginWithCredentials();
cy.goToGlossaryList(); cy.goToGlossaryList();
cy.clickOptionWithText("Add Term"); cy.clickOptionWithText("Add Term");
cy.addViaModal(glossaryTerm, "Create Glossary Term", glossaryTerm); cy.addViaModal(glossaryTerm, "Create Glossary Term", glossaryTerm, "glossary-entity-modal-create-button");
cy.clickOptionWithText("Add Term Group"); cy.clickOptionWithText("Add Term Group");
cy.addViaModal(glossaryTermGroup, "Create Term Group", glossaryTermGroup); cy.addViaModal(glossaryTermGroup, "Create Term Group", glossaryTermGroup, "glossary-entity-modal-create-button");
cy.addTermToDataset(urn, datasetName, glossaryTerm); cy.addTermToDataset(urn, datasetName, glossaryTerm);
cy.waitTextVisible(glossaryTerm) cy.waitTextVisible(glossaryTerm)
cy.goToGlossaryList(); cy.goToGlossaryList();

View File

@ -26,7 +26,7 @@ describe("run managed ingestion", () => {
cy.enterTextInTestId('source-name-input', testName) cy.enterTextInTestId('source-name-input', testName)
cy.clickOptionWithText("Advanced") cy.clickOptionWithText("Advanced")
cy.enterTextInTestId('cli-version-input', cli_version) cy.enterTextInTestId('cli-version-input', cli_version)
cy.clickOptionWithText("Save & Run") cy.clickOptionWithTextToScrollintoView("Save & Run")
cy.waitTextVisible(testName) cy.waitTextVisible(testName)
cy.contains(testName).parent().within(() => { cy.contains(testName).parent().within(() => {

View File

@ -183,10 +183,10 @@ Cypress.Commands.add("addViaFormModal", (text, modelHeader) => {
cy.get(".ant-modal-footer > button:nth-child(2)").click(); cy.get(".ant-modal-footer > button:nth-child(2)").click();
}); });
Cypress.Commands.add("addViaModal", (text, modelHeader,value) => { Cypress.Commands.add("addViaModal", (text, modelHeader, value, dataTestId) => {
cy.waitTextVisible(modelHeader); cy.waitTextVisible(modelHeader);
cy.get(".ant-input-affix-wrapper > input[type='text']").first().type(text); cy.get(".ant-input-affix-wrapper > input[type='text']").first().type(text);
cy.get(".ant-modal-footer > button:nth-child(2)").click(); cy.get('[data-testid="' + dataTestId + '"]').click();
cy.contains(value).should('be.visible'); cy.contains(value).should('be.visible');
}); });