diff --git a/scripts/cypress/integration/common/6b_downloadCsv.js b/scripts/cypress/integration/common/6b_downloadCsv.js index f1c189a026..eabb77c034 100644 --- a/scripts/cypress/integration/common/6b_downloadCsv.js +++ b/scripts/cypress/integration/common/6b_downloadCsv.js @@ -9,33 +9,22 @@ export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${apiType.toUpperCase()} Upload/ Download CSV`, () => { - before(() => { - - // kludge: wait for page load to finish - cy.wait(2000); - // close team & auth tab - cy.get('button.ant-tabs-tab-remove').should('exist').click(); - cy.wait(1000); - - cy.openTableTab("Country", 25); - cy.wait(1000); - - cy.saveLocalStorage(); - cy.wait(1000); - }); + // before(() => { + // // standalone test + // // loginPage.loginAndOpenProject(apiType, dbType); + // }); beforeEach(() => { cy.restoreLocalStorage(); - cy.wait(1000); }); - after(() => { - cy.closeTableTab("Country"); + afterEach(() => { cy.saveLocalStorage(); - cy.wait(1000); - }); + }) it("Download verification- base view, default columns", () => { + cy.openTableTab("Country", 25); + mainPage.hideField("LastUpdate"); const verifyCsv = (retrievedRecords) => { // expected output, statically configured @@ -78,6 +67,8 @@ export const genTest = (apiType, dbType) => { // download & verify mainPage.downloadAndVerifyCsv(`Country_exported_1.csv`, verifyCsv); mainPage.unhideField("LastUpdate"); + + cy.closeTableTab("Country"); }); }); }; diff --git a/scripts/cypress/integration/common/6d_language_validation.js b/scripts/cypress/integration/common/6d_language_validation.js index 3ffd65de69..d4bf98dbd0 100644 --- a/scripts/cypress/integration/common/6d_language_validation.js +++ b/scripts/cypress/integration/common/6d_language_validation.js @@ -8,26 +8,27 @@ export const genTest = (apiType, dbType) => { describe(`Language support`, () => { before(() => { cy.restoreLocalStorage(); - cy.wait(1000); cy.visit("/") cy.wait(5000); - - cy.saveLocalStorage(); - cy.wait(1000); }); beforeEach(() => { cy.restoreLocalStorage(); - cy.wait(1000); - }); + }) + + afterEach(() => { + cy.saveLocalStorage(); + }) after(() => { + cy.restoreLocalStorage(); cy.get('.nc-menu-accounts').should('exist').click(); cy.getActiveMenu('.nc-dropdown-user-accounts-menu').find('.ant-dropdown-menu-item').eq(1).click(); cy.wait(5000); cy.get('button:contains("SIGN")').should('exist') + cy.saveLocalStorage(); }) const langVerification = (idx, lang) => { diff --git a/scripts/cypress/integration/common/6e_project_operations.js b/scripts/cypress/integration/common/6e_project_operations.js index 3013dd13b7..28131b2c83 100644 --- a/scripts/cypress/integration/common/6e_project_operations.js +++ b/scripts/cypress/integration/common/6e_project_operations.js @@ -8,13 +8,18 @@ export const genTest = (apiType, dbType) => { before(() => { cy.restoreLocalStorage(); - cy.wait(1000); - - // loginPage.signIn(roles.owner.credentials); cy.visit("/"); cy.wait(4000); }); + cy.beforeEach(() => { + cy.restoreLocalStorage(); + }) + + cy.afterEach(() => { + cy.saveLocalStorage(); + }) + it("Delete Project", () => { cy.get(`.nc-action-btn`) diff --git a/scripts/cypress/integration/common/6f_attachments.js b/scripts/cypress/integration/common/6f_attachments.js index 25fc8597c4..b78e56d779 100644 --- a/scripts/cypress/integration/common/6f_attachments.js +++ b/scripts/cypress/integration/common/6f_attachments.js @@ -9,20 +9,19 @@ export const genTest = (apiType, dbType) => { before(() => { loginPage.loginAndOpenProject(apiType, dbType); cy.openTableTab("Country", 25); - cy.wait(1000); - cy.saveLocalStorage(); - cy.wait(1000); }); beforeEach(() => { cy.restoreLocalStorage(); - cy.wait(1000); - }); + }) + + afterEach(() => { + cy.saveLocalStorage(); + }) after(() => { cy.restoreLocalStorage(); - cy.wait(1000); // clean up mainPage.deleteColumn("testAttach"); @@ -44,6 +43,7 @@ export const genTest = (apiType, dbType) => { cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Delete Row").click(); cy.closeTableTab("Country"); + cy.saveLocalStorage(); }); it(`Add column of type attachments`, () => { @@ -62,9 +62,8 @@ export const genTest = (apiType, dbType) => { }); it(`Form view with Attachment field- Submit & verify`, () => { - - // open right navbar - cy.get('.nc-toggle-right-navbar').should('exist').click(); + // // open right navbar + // cy.get('.nc-toggle-right-navbar').should('exist').click(); // create form-view cy.get(`.nc-create-form-view`).click(); @@ -85,6 +84,8 @@ export const genTest = (apiType, dbType) => { let linkText = $obj.text().trim(); cy.log(linkText); + cy.signOut(); + cy.visit(linkText, { baseUrl: null, }); @@ -101,7 +102,6 @@ export const genTest = (apiType, dbType) => { cy.get('.ant-picker-dropdown').find(".ant-picker-now-btn").click(); cy.get('.ant-picker-dropdown').find("button.ant-btn-primary").click(); - cy.get('.nc-attachment-cell') .attachFile(`sampleFiles/1.json`, { subjectType: 'drag-n-drop' }); @@ -117,11 +117,11 @@ export const genTest = (apiType, dbType) => { it(`Filter column which contain only attachments, download CSV`, () => { // come back to main window - // loginPage.loginAndOpenProject(apiType, dbType); - cy.visit('/') - cy.wait(5000) + loginPage.loginAndOpenProject(apiType, dbType); + // cy.visit('/') + // cy.wait(5000) + // projectsPage.openConfiguredProject(apiType, dbType); - projectsPage.openConfiguredProject(apiType, dbType); cy.openTableTab("Country", 25); cy.wait(1000); diff --git a/scripts/cypress/integration/common/6g_base_share.js b/scripts/cypress/integration/common/6g_base_share.js index 2b9e41da6a..2c481e7db6 100644 --- a/scripts/cypress/integration/common/6g_base_share.js +++ b/scripts/cypress/integration/common/6g_base_share.js @@ -57,20 +57,21 @@ export const genTest = (apiType, dbType) => { describe(`${apiType.toUpperCase()} Base VIEW share`, () => { before(() => { - loginPage.loginAndOpenProject(apiType, dbType); - + // loginPage.loginAndOpenProject(apiType, dbType); + cy.restoreLocalStorage(); cy.openTableTab("Country", 25); - cy.wait(1000); - cy.saveLocalStorage(); - cy.wait(1000); }); - it(`Generate base share URL`, () => { - + beforeEach(() => { cy.restoreLocalStorage(); - cy.wait(1000); + }) + afterEach(() => { + cy.saveLocalStorage(); + }) + + it(`Generate base share URL`, () => { // click SHARE cy.get(".nc-share-base:visible").should('exist').click(); @@ -121,10 +122,6 @@ style="background: transparent; "> cy.log(linkText); cy.signOut(); - cy.deleteLocalStorage(); - cy.wait(1000); - cy.printLocalStorage(); - }); permissionValidation("viewer"); @@ -143,10 +140,6 @@ style="background: transparent; "> .click(); cy.signOut(); - cy.deleteLocalStorage(); - cy.wait(1000); - cy.printLocalStorage(); - }); permissionValidation("editor"); @@ -178,7 +171,6 @@ style="background: transparent; "> // validate data (row-1) cy.iframe().find(`.nc-grid-cell`).eq(1).contains("PENELOPE").should("exist"); cy.iframe().find(`.nc-grid-cell`).eq(2).contains("GUINESS").should("exist"); - }); }) } diff --git a/scripts/cypress/integration/common/7a_create_project_from_excel.js b/scripts/cypress/integration/common/7a_create_project_from_excel.js index 8d5632bf81..75273034f8 100644 --- a/scripts/cypress/integration/common/7a_create_project_from_excel.js +++ b/scripts/cypress/integration/common/7a_create_project_from_excel.js @@ -68,11 +68,9 @@ export const genTest = (apiType, dbType) => { describe(`Import from excel`, () => { before(() => { - // loginPage.signIn(roles.owner.credentials); cy.restoreLocalStorage(); - cy.wait(1000); cy.task("readSheetList", { file: `./scripts/cypress/fixtures/${filepath}`, @@ -89,19 +87,21 @@ export const genTest = (apiType, dbType) => { sheetData = rows; }); - // loginPage.signIn(roles.owner.credentials); + cy.visit("/") projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {}) cy.wait(4000); cy.saveLocalStorage(); - cy.wait(1000); }); beforeEach(() => { cy.restoreLocalStorage(); - cy.wait(1000); }); + afterEach(() => { + cy.saveLocalStorage(); + }) + it("File Upload: Upload excel as template", () => { cy.get('.nc-add-new-table').should('exist').trigger('mouseover') @@ -265,24 +265,6 @@ export const genTest = (apiType, dbType) => { } cy.closeTableTab("Sheet1"); }); - - after(() => { - // delete project once all operations are completed - // mainPage.toolBarTopLeft(mainPage.HOME).click(); - // projectsPage.deleteProject("importSample"); - - // cy.get('.nc-noco-brand-icon').click(); - // - // cy.get(`.nc-action-btn`) - // .should("exist") - // .last() - // .click(); - // - // cy.getActiveModal() - // .find(".ant-btn-dangerous") - // .should("exist") - // .click(); - }); }); }; diff --git a/scripts/cypress/integration/common/8a_webhook.js b/scripts/cypress/integration/common/8a_webhook.js index 713bf4567f..224a801e8b 100644 --- a/scripts/cypress/integration/common/8a_webhook.js +++ b/scripts/cypress/integration/common/8a_webhook.js @@ -228,20 +228,21 @@ export const genTest = (apiType, dbType) => { before(() => { loginPage.loginAndOpenProject(apiType, dbType); cy.createTable("Temp"); - cy.wait(1000); - cy.saveLocalStorage(); }); beforeEach(() => { cy.restoreLocalStorage(); - cy.wait(1000); }); + afterEach(() => { + cy.saveLocalStorage(); + }) + after(() => { + cy.restoreLocalStorage(); cy.deleteTable("Temp"); cy.saveLocalStorage(); - cy.wait(1000); }); it("Create: 'After Insert' event", () => {