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

Loading…
Cancel
Save