From f4855b6044339a4088438e185fa20a16eca63fd7 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 6 Oct 2022 17:31:05 +0530 Subject: [PATCH] test: retain localStorage across tests Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../cypress/integration/common/4h_kanban.js | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/scripts/cypress/integration/common/4h_kanban.js b/scripts/cypress/integration/common/4h_kanban.js index ce13e97a0e..460e5554a9 100644 --- a/scripts/cypress/integration/common/4h_kanban.js +++ b/scripts/cypress/integration/common/4h_kanban.js @@ -101,46 +101,29 @@ let localDebug = false; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; + let clear; + describe(`${apiType.toUpperCase()} api - Kanban`, () => { before(() => { - // if (localDebug) { - // // for standalone tests - // cy.restoreLocalStorage(); - // loginPage.loginAndOpenProject(apiType, dbType); - // - // cy.openTableTab("Film", 25); - // cy.openTableView("kanban", "Kanban-1"); - // - // cy.saveLocalStorageToFile("kanban"); - // } - // cy.restoreLocalStorageFromFile("kanban"); - // cy.wait(1000); - // cy.visit( - // "http://localhost:3000/#/nc/p_42i93khqhge32z/table/Film/Kanban-1", - // { baseUrl: null } - // ); - // verifyKanbanStackCount(7); - // verifyKanbanStackOrder([ - // "uncategorized", - // "G", - // "PG", - // "PG-13", - // "R", - // "NC-17", - // "Test", - // ]); - }); - - beforeEach(() => { cy.restoreLocalStorage(); + + clear = Cypress.LocalStorage.clear; + Cypress.LocalStorage.clear = () => {}; }); - afterEach(() => { + // beforeEach(() => { + // cy.restoreLocalStorage(); + // }); + // + // afterEach(() => { + // cy.saveLocalStorage(); + // }); + + after(() => { + Cypress.LocalStorage.clear = clear; cy.saveLocalStorage(); }); - after(() => {}); - /** class name specific to kanban view .nc-kanban-stacked-by-menu-btn