Updated tests from the functional tests (#2234)
Co-authored-by: nandan.anantharamu <nandan.anantharamu@thoughtspot.com>
This commit is contained in:
parent
0ccc80127a
commit
4914e0a3f2
|
|
@ -1,10 +1,10 @@
|
|||
/// <reference types="Cypress" />
|
||||
|
||||
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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -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
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
@ -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
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user