From deaf103eb56be98fb4c2fd2d983624d3b4598c52 Mon Sep 17 00:00:00 2001 From: Kos Korchak Date: Thu, 7 Sep 2023 12:47:53 -0400 Subject: [PATCH 1/3] Glossary Navigation Cypress test --- .../e2e/glossary/glossary_navigation.js | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js diff --git a/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js b/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js new file mode 100644 index 0000000000000..c3655f43cb541 --- /dev/null +++ b/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js @@ -0,0 +1,57 @@ +const glossaryTerm = "CypressGlosssaryNavigationTerm"; +const glossaryTermGroup = "CypressGlosssaryNavigationGroup"; +const glossaryParentGroup = "CypressGlosssaryGroup"; + +describe("glossary sidebar navigation test", () => { + it("create term and term parent group, move and delete term group", () => { + //create a new term group and term, move term to the group + cy.loginWithCredentials(); + cy.goToGlossaryList(); + cy.clickOptionWithText("Add Term Group"); + cy.addViaAffixModal(glossaryTermGroup, "Create Term Group"); + cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTermGroup).should("be.visible"); + cy.clickOptionWithText("Add Term"); + cy.addViaAffixModal(glossaryTerm, "Create Glossary Term"); + cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTerm).click(); + cy.waitTextVisible("No documentation yet"); + cy.openThreeDotDropdown(); + cy.clickOptionWithText("Move"); + cy.get('[role="dialog"] [data-icon="close-circle"]').click({force: true}); + cy.get('[role="dialog"]').contains(glossaryTermGroup).click(); + cy.get('[role="dialog"]').contains(glossaryTermGroup).should("be.visible"); + cy.get("button").contains("Move").click(); + cy.waitTextVisible("Moved Glossary Term!"); + //ensure the new term is under the parent term group in the navigation sidebar + cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTermGroup).click(); + cy.get('*[class^="GlossaryEntitiesList"]').contains(glossaryTerm).should("be.visible"); + cy.get('*[class^="GlossaryBrowser"] [aria-label="down"]').click().wait(1000); + cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTerm).should("not.exist"); + //move a term group from the root level to be under a parent term group + cy.goToGlossaryList(); + cy.clickOptionWithText(glossaryTermGroup); + cy.openThreeDotDropdown(); + cy.clickOptionWithText("Move"); + cy.get('[role="dialog"] [data-icon="close-circle"]').click({force: true}); + cy.get('[role="dialog"]').contains(glossaryParentGroup).click(); + cy.get('[role="dialog"]').contains(glossaryParentGroup).should("be.visible"); + cy.get("button").contains("Move").click(); + cy.waitTextVisible("Moved Term Group!"); + //ensure it is no longer on the sidebar navigator at the top level but shows up under the new parent + cy.get('*[class^="GlossaryBrowser"] [aria-label="down"]').click().wait(1000); + cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTermGroup).should("not.exist"); + //delete a term group + cy.goToGlossaryList(); + cy.clickOptionWithText(glossaryParentGroup); + cy.clickOptionWithText(glossaryTermGroup); + cy.clickOptionWithText(glossaryTerm).wait(3000); + cy.deleteFromDropdown(); + cy.waitTextVisible("Deleted Glossary Term!"); + cy.clickOptionWithText(glossaryParentGroup); + cy.clickOptionWithText(glossaryTermGroup).wait(3000); + cy.deleteFromDropdown(); + cy.waitTextVisible("Deleted Term Group!"); + //ensure it is no longer in the sidebar navigator + cy.ensureTextNotPresent(glossaryTerm); + cy.ensureTextNotPresent(glossaryTermGroup); + }); +}); \ No newline at end of file From 9deb4d0639783a2a465c85d59675125679b4e31b Mon Sep 17 00:00:00 2001 From: Kos Korchak Date: Thu, 7 Sep 2023 14:00:32 -0400 Subject: [PATCH 2/3] Minor fix --- .../tests/cypress/cypress/e2e/glossary/glossary_navigation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js b/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js index c3655f43cb541..72be83f33aa2b 100644 --- a/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js +++ b/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js @@ -8,10 +8,10 @@ describe("glossary sidebar navigation test", () => { cy.loginWithCredentials(); cy.goToGlossaryList(); cy.clickOptionWithText("Add Term Group"); - cy.addViaAffixModal(glossaryTermGroup, "Create Term Group"); + cy.addViaModal(glossaryTermGroup, "Create Term Group"); cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTermGroup).should("be.visible"); cy.clickOptionWithText("Add Term"); - cy.addViaAffixModal(glossaryTerm, "Create Glossary Term"); + cy.addViaModal(glossaryTerm, "Create Glossary Term"); cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTerm).click(); cy.waitTextVisible("No documentation yet"); cy.openThreeDotDropdown(); From 5d890ecbfc6d2faef87f7e167ed7184717383830 Mon Sep 17 00:00:00 2001 From: Kos Korchak Date: Thu, 7 Sep 2023 16:07:11 -0400 Subject: [PATCH 3/3] Fix for missing cypress command methos --- .../cypress/e2e/glossary/glossary_navigation.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js b/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js index 72be83f33aa2b..cd5622d0cd903 100644 --- a/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js +++ b/smoke-test/tests/cypress/cypress/e2e/glossary/glossary_navigation.js @@ -1,6 +1,6 @@ const glossaryTerm = "CypressGlosssaryNavigationTerm"; const glossaryTermGroup = "CypressGlosssaryNavigationGroup"; -const glossaryParentGroup = "CypressGlosssaryGroup"; +const glossaryParentGroup = "Cypress"; describe("glossary sidebar navigation test", () => { it("create term and term parent group, move and delete term group", () => { @@ -8,10 +8,14 @@ describe("glossary sidebar navigation test", () => { cy.loginWithCredentials(); cy.goToGlossaryList(); cy.clickOptionWithText("Add Term Group"); - cy.addViaModal(glossaryTermGroup, "Create Term Group"); + cy.waitTextVisible("Create Term Group"); + cy.get(".ant-input-affix-wrapper > input[type='text']").first().type(glossaryTermGroup); + cy.get(".ant-modal-footer > button:last-child").click(); cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTermGroup).should("be.visible"); cy.clickOptionWithText("Add Term"); - cy.addViaModal(glossaryTerm, "Create Glossary Term"); + cy.waitTextVisible("Create Glossary Term"); + cy.get(".ant-input-affix-wrapper > input[type='text']").first().type(glossaryTerm); + cy.get(".ant-modal-footer > button:last-child").click(); cy.get('*[class^="GlossaryBrowser"]').contains(glossaryTerm).click(); cy.waitTextVisible("No documentation yet"); cy.openThreeDotDropdown();