Browse Source

test(roles): wait clean up

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3797/head
Raju Udava 2 years ago
parent
commit
56f11aad30
  1. 23
      scripts/cypress/integration/common/5a_user_role.js

23
scripts/cypress/integration/common/5a_user_role.js

@ -110,13 +110,15 @@ export const genTest = (apiType, dbType) => {
}); });
const roleValidation = (roleType) => { const roleValidation = (roleType) => {
let clear;
describe(`User role validation`, () => { describe(`User role validation`, () => {
before(() => { before(() => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
cy.visit(mainPage.roleURL[roleType]); cy.visit(mainPage.roleURL[roleType]);
cy.wait(5000); // cy.wait(5000);
cy.get('button:contains("SIGN UP")').should("exist"); cy.get('button:contains("SIGN UP"):visible').should("exist");
cy.get('input[type="text"]', { timeout: 20000 }).type( cy.get('input[type="text"]', { timeout: 20000 }).type(
roles[roleType].credentials.username roles[roleType].credentials.username
); );
@ -125,11 +127,11 @@ export const genTest = (apiType, dbType) => {
); );
cy.get('button:contains("SIGN UP")').click(); cy.get('button:contains("SIGN UP")').click();
cy.wait(3000); // cy.wait(3000);
cy.get(".nc-project-page-title") cy.get(`.nc-project-page-title:contains("My Projects"):visible`).should(
.contains("My Projects") "exist"
.should("be.visible"); );
if (dbType === "xcdb") { if (dbType === "xcdb") {
if ("rest" == apiType) if ("rest" == apiType)
@ -149,12 +151,15 @@ export const genTest = (apiType, dbType) => {
if (roleType === "creator") { if (roleType === "creator") {
// kludge: wait for page load to finish // kludge: wait for page load to finish
// close team & auth tab // close team & auth tab
cy.wait(2000); cy.wait(500);
cy.get("button.ant-tabs-tab-remove").should("exist").click(); cy.get("button.ant-tabs-tab-remove").should("exist").click();
cy.wait(1000); cy.wait(500);
} }
cy.saveLocalStorage(); cy.saveLocalStorage();
clear = Cypress.LocalStorage.clear;
Cypress.LocalStorage.clear = () => {};
}); });
beforeEach(() => { beforeEach(() => {
@ -169,6 +174,8 @@ export const genTest = (apiType, dbType) => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
cy.signOut(); cy.signOut();
cy.saveLocalStorage(); cy.saveLocalStorage();
Cypress.LocalStorage.clear = clear;
}); });
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////

Loading…
Cancel
Save