From 4151b2dcb230e1f22854c1a9ffaf90fcc7d1495d Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:59:02 +0530 Subject: [PATCH] test: fix local storage & tab handling in quickTest suite Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../common/7b_import_from_airtable.js | 11 +++++++- .../integration/common/9a_QuickTest.js | 27 ++++++++----------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/scripts/cypress/integration/common/7b_import_from_airtable.js b/scripts/cypress/integration/common/7b_import_from_airtable.js index 5cd6d1c88f..1d746c1013 100644 --- a/scripts/cypress/integration/common/7b_import_from_airtable.js +++ b/scripts/cypress/integration/common/7b_import_from_airtable.js @@ -18,12 +18,21 @@ export const genTest = (apiType, dbType) => { loginPage.signIn(roles.owner.credentials); projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {}) + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); }); - after(() => { + afterEach(() => { cy.saveLocalStorage(); }); + // after(() => { + // cy.saveLocalStorage(); + // }); + it("Import", () => { cy.log(apiKey, sharedBase); diff --git a/scripts/cypress/integration/common/9a_QuickTest.js b/scripts/cypress/integration/common/9a_QuickTest.js index c73492490e..38db921a45 100644 --- a/scripts/cypress/integration/common/9a_QuickTest.js +++ b/scripts/cypress/integration/common/9a_QuickTest.js @@ -81,8 +81,6 @@ export const genTest = (apiType, dbType, testMode) => { } before(() => { - cy.restoreLocalStorage(); - if( testMode === 'CY_QUICK') { // cy.task("copyFile") loginPage.signIn(roles.owner.credentials); @@ -93,28 +91,31 @@ export const genTest = (apiType, dbType, testMode) => { // close team & auth tab cy.get('button.ant-tabs-tab-remove').should('exist').click(); cy.wait(1000); - - cy.saveLocalStorage(); } + else { + cy.restoreLocalStorage(); + } + + cy.openTableTab("Film", 3) + cy.saveLocalStorage(); + }); beforeEach(() => { cy.restoreLocalStorage(); }) - // afterEach(() => { - // cy.saveLocalStorage(); - // }) + afterEach(() => { + cy.saveLocalStorage(); + }) after(() => { cy.restoreLocalStorage(); - - // sign out cy.signOut(); + cy.saveLocalStorage(); }); it("Verify Schema", () => { - cy.openTableTab("Film", 3) // verify if all tables exist for(let i=0; i { }); it("Verify Data types", () => { - cy.openTableTab("Film", 3); // normal cells for (let [key, value] of Object.entries(records)) { @@ -188,12 +188,9 @@ export const genTest = (apiType, dbType, testMode) => { mainPage.getCell("Producer", cellIdx).find('.chip').eq(1).contains(records2.Producer[1]).should('exist') } - cy.closeTableTab("Film"); }); it("Verify Views & Shared base", () => { - cy.openTableTab("Film", 3); - mainPage.toggleRightSidebar(); cy.get('.nc-form-view-item:visible') .should('exist') .eq(0) @@ -333,7 +330,6 @@ export const genTest = (apiType, dbType, testMode) => { it("Verify Fields, Filter & Sort", () => { cy.openTableTab("Actor", 25); - mainPage.toggleRightSidebar(); cy.get(".nc-grid-view-item").eq(1).click() @@ -387,7 +383,6 @@ export const genTest = (apiType, dbType, testMode) => { if( testMode === 'CY_QUICK') { cy.openTableTab("Producer", 3) - mainPage.toggleRightSidebar(); cy.get('.nc-grid-view-item').should('have.length', 4) cy.get('.nc-form-view-item').should('have.length', 4)