diff --git a/scripts/cypress-v2/integration/common/5b_preview_role.js b/scripts/cypress-v2/integration/common/5b_preview_role.js index 0edd32b94d..71e1143514 100644 --- a/scripts/cypress-v2/integration/common/5b_preview_role.js +++ b/scripts/cypress-v2/integration/common/5b_preview_role.js @@ -29,20 +29,23 @@ export const genTest = (apiType, dbType, roleType) => { describe("Role preview validations", () => { // Sign in/ open project before(() => { - cy.fileHook(); loginPage.loginAndOpenProject(apiType, dbType); cy.openTableTab("City", 25); + cy.wait(3000); + settingsPage.openProjectMenu(); cy.getActiveMenu().find(`[data-submenu-id="preview-as"]`).should('exist').click() cy.wait(1000) - cy.get('.ant-dropdown-menu-submenu').eq(3).find(`[data-menu-id="editor"]`).should('exist').click() + cy.get('.ant-dropdown-menu-submenu').eq(4).find(`[data-menu-id="editor"]`).should('exist').click() cy.wait(10000) + + cy.saveLocalStorage(); }); beforeEach(() => { - cy.fileHook(); + cy.restoreLocalStorage(); }); after(() => { @@ -93,6 +96,9 @@ export const genTest = (apiType, dbType, roleType) => { .find(`[type="radio"][value="${roleType}"]`) .should('exist') .click(); + + cy.wait(5000) + cy.saveLocalStorage(); }); it(`Role preview: ${roleType}: Advance settings`, () => { diff --git a/scripts/cypress-v2/integration/spec/roleValidation.spec.js b/scripts/cypress-v2/integration/spec/roleValidation.spec.js index cfe60d86c8..a2c1a32057 100644 --- a/scripts/cypress-v2/integration/spec/roleValidation.spec.js +++ b/scripts/cypress-v2/integration/spec/roleValidation.spec.js @@ -218,6 +218,10 @@ export function _viewMenu(roleType, mode) { cy.get('.nc-toggle-right-navbar').click(); cy.wait(1000); + // hard-wire + // window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}') + + let validationString = true === roles[roleType].validations.shareView ? "exist" : "not.exist";