From 4914e0a3f22850c81488bb8baa8417aafa4d2062 Mon Sep 17 00:00:00 2001 From: NandanAnantharamu <67676905+NandanAnantharamu@users.noreply.github.com> Date: Thu, 17 Dec 2020 11:40:50 +0530 Subject: [PATCH] Updated tests from the functional tests (#2234) Co-authored-by: nandan.anantharamu --- .../CreateDuplicateAppWithinOrg_spec.js | 7 +++++-- .../OrganisationTests/CreateOrgTests_spec.js | 20 ++++++++++--------- .../cypress/manual_TestSuite/Org_Logo_Del.js | 19 ------------------ .../cypress/manual_TestSuite/Org_Logo_Set.js | 18 ----------------- .../manual_TestSuite/Share_User_Icon.js | 17 ---------------- app/client/cypress/support/commands.js | 12 +++++++++-- 6 files changed, 26 insertions(+), 67 deletions(-) delete mode 100644 app/client/cypress/manual_TestSuite/Org_Logo_Del.js delete mode 100644 app/client/cypress/manual_TestSuite/Org_Logo_Set.js delete mode 100644 app/client/cypress/manual_TestSuite/Share_User_Icon.js diff --git a/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateDuplicateAppWithinOrg_spec.js b/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateDuplicateAppWithinOrg_spec.js index 41692b1e3c..92d16d5d54 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateDuplicateAppWithinOrg_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateDuplicateAppWithinOrg_spec.js @@ -1,10 +1,10 @@ /// -describe("Create new org and an app within the same", function() { +describe("Create new org and an app within the same", function () { let orgid; let appid; - it("create multiple apps and validate", function() { + it("create multiple apps and validate", function () { cy.NavigateToHome(); cy.generateUUID().then(uid => { orgid = uid; @@ -12,6 +12,9 @@ describe("Create new org and an app within the same", function() { localStorage.setItem("OrgName", orgid); cy.createOrg(orgid); cy.CreateAppForOrg(orgid, appid); + cy.DeleteAppByApi(); + cy.NavigateToHome(); + cy.CreateAppForOrg(orgid, appid); cy.NavigateToHome(); cy.CreateApp(appid); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateOrgTests_spec.js b/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateOrgTests_spec.js index 4c0f39bf6f..06956c5dd4 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateOrgTests_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/OrganisationTests/CreateOrgTests_spec.js @@ -2,28 +2,30 @@ const homePage = require("../../../locators/HomePage.json"); -describe("Create new org and share with a user", function() { +describe("Create new org and share with a user", function () { let orgid; let appid; - it("create org and then share with a user from UI", function() { + it("create org and then share with a user from UI", function () { cy.NavigateToHome(); cy.generateUUID().then(uid => { orgid = uid; appid = uid; localStorage.setItem("OrgName", orgid); cy.createOrg(orgid); + cy.CheckShareIcon(orgid, 1); cy.inviteUserForOrg( orgid, Cypress.env("TESTUSERNAME1"), homePage.viewerRole, ); + cy.CheckShareIcon(orgid, 2); cy.CreateAppForOrg(orgid, appid); }); cy.LogOut(); }); - it("login as invited user and then validate viewer privilage", function() { + it("login as invited user and then validate viewer privilage", function () { cy.LogintoApp(Cypress.env("TESTUSERNAME1"), Cypress.env("TESTPASSWORD1")); cy.get(homePage.searchInput).type(appid); cy.wait(2000); @@ -37,7 +39,7 @@ describe("Create new org and share with a user", function() { cy.LogOut(); }); - it("login as Org owner and update the invited user role to developer", function() { + it("login as Org owner and update the invited user role to developer", function () { cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); cy.visit("/applications"); cy.wait("@applications").should( @@ -56,7 +58,7 @@ describe("Create new org and share with a user", function() { cy.LogOut(); }); - it("login as invited user and then validate developer privilage", function() { + it("login as invited user and then validate developer privilage", function () { cy.LogintoApp(Cypress.env("TESTUSERNAME1"), Cypress.env("TESTPASSWORD1")); cy.get(homePage.searchInput).type(appid); cy.wait(2000); @@ -74,7 +76,7 @@ describe("Create new org and share with a user", function() { cy.LogOut(); }); - it("login as Org owner and update the invited user role to administrator", function() { + it("login as Org owner and update the invited user role to administrator", function () { cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); cy.visit("/applications"); cy.wait("@applications").should( @@ -93,7 +95,7 @@ describe("Create new org and share with a user", function() { cy.LogOut(); }); - it("login as invited user and then validate administrator privilage", function() { + it("login as invited user and then validate administrator privilage", function () { cy.LogintoApp(Cypress.env("TESTUSERNAME1"), Cypress.env("TESTPASSWORD1")); cy.get(homePage.searchInput).type(appid); cy.wait(2000); @@ -106,7 +108,7 @@ describe("Create new org and share with a user", function() { cy.LogOut(); }); - it("login as Org owner and delete App ", function() { + it("login as Org owner and delete App ", function () { cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); cy.visit("/applications"); cy.wait("@applications").should( @@ -117,7 +119,7 @@ describe("Create new org and share with a user", function() { cy.get(homePage.searchInput).type(appid); cy.wait(2000); cy.navigateToOrgSettings(orgid); - cy.get(homePage.emailList).then(function($list) { + cy.get(homePage.emailList).then(function ($list) { expect($list).to.have.length(3); expect($list.eq(0)).to.contain(Cypress.env("USERNAME")); expect($list.eq(1)).to.contain(Cypress.env("TESTUSERNAME1")); diff --git a/app/client/cypress/manual_TestSuite/Org_Logo_Del.js b/app/client/cypress/manual_TestSuite/Org_Logo_Del.js deleted file mode 100644 index 9f90bcf735..0000000000 --- a/app/client/cypress/manual_TestSuite/Org_Logo_Del.js +++ /dev/null @@ -1,19 +0,0 @@ -const homePage = require("../../../locators/HomePage.json"); - - -describe("Deletion of organisational Logo ", function() { - it(" org logo upload ", function() - { - //Click on the dropdown next to organisational Name - // Navigate between tabs - // Naviagte to General Tab - // Add an Organisational Logo - // Wait until it loads - // Switch between Tabs - // Click on the remove Icon - //Ensure the organisational Logo is deleted - } - ) -} -) - diff --git a/app/client/cypress/manual_TestSuite/Org_Logo_Set.js b/app/client/cypress/manual_TestSuite/Org_Logo_Set.js deleted file mode 100644 index 9ef5c824ef..0000000000 --- a/app/client/cypress/manual_TestSuite/Org_Logo_Set.js +++ /dev/null @@ -1,18 +0,0 @@ -const homePage = require("../../../locators/HomePage.json"); - - -describe("insert organisational Logo ", function() { - it(" org logo upload ", function() - { - //Click on the dropdown next to organisational Name - // Navigate between tabs - // Naviagte to General Tab - // Add an Organisational Logo - //Wait until it loads - // Switch between Tabs - // Navigate to General Tab and ensure the logo exsits - //navigate back to Homepage - } - ) -} -) \ No newline at end of file diff --git a/app/client/cypress/manual_TestSuite/Share_User_Icon.js b/app/client/cypress/manual_TestSuite/Share_User_Icon.js deleted file mode 100644 index dd662a021b..0000000000 --- a/app/client/cypress/manual_TestSuite/Share_User_Icon.js +++ /dev/null @@ -1,17 +0,0 @@ -const homePage = require("../../../locators/HomePage.json"); - - -describe("Shared user icon ", function() { - it(" User Icon is disaplyed to user ", function() - { - // Navigate to home Page - //Click on Share Icon - // Click on Field to add an Email Id - // Click on the Roles field - // Add an role from the Dropdown - // CLick on Invite - //Now observe the icon next to the Share Icon - } - ) -} -) \ No newline at end of file diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 842fc5a92f..203448f987 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -90,6 +90,14 @@ Cypress.Commands.add("inviteUserForOrg", (orgName, email, role) => { .click(); }); +Cypress.Commands.add("CheckShareIcon", (orgName, count) => { + cy.get(homePage.orgList.concat(orgName).concat(")")) + .scrollIntoView() + .should("be.visible"); + cy.get(homePage.orgList.concat(orgName).concat(") .org-share-user-icons")) + .should('have.length', count) +}); + Cypress.Commands.add("shareApp", (email, role) => { cy.xpath(homePage.email) .click({ force: true }) @@ -1136,8 +1144,8 @@ Cypress.Commands.add("Deletepage", Pagename => { cy.get(".t--page-sidebar-" + Pagename + ""); cy.get( ".t--page-sidebar-" + - Pagename + - ">.t--page-sidebar-menu-actions>.bp3-popover-target", + Pagename + + ">.t--page-sidebar-menu-actions>.bp3-popover-target", ).click({ force: true }); cy.get(pages.Menuaction).click({ force: true }); cy.get(pages.Delete).click({ force: true });