From f73f1d5c4dc9e3692d01c7b1ca722517edb552e0 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:18:47 +0530 Subject: [PATCH 1/3] test: enable duration column tests Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../integration/common/3e_duration_column.js | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/scripts/cypress/integration/common/3e_duration_column.js b/scripts/cypress/integration/common/3e_duration_column.js index e86c36b1b4..c0f9f466df 100644 --- a/scripts/cypress/integration/common/3e_duration_column.js +++ b/scripts/cypress/integration/common/3e_duration_column.js @@ -13,21 +13,26 @@ export const genTest = (apiType, dbType) => { cy.get("label").contains(label).parents(".ant-row").first().click(); }; - // Run once before test- create table - // before(() => { - mainPage.tabReset(); - - // // close team & auth tab - // cy.get('button.ant-tabs-tab-remove').should('exist').click(); - + cy.restoreLocalStorage(); cy.createTable(tableName); + cy.saveLocalStorage(); }); - beforeEach(() => {}); + // Run once before test- create table + // + beforeEach(() => { + cy.restoreLocalStorage(); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); after(() => { + cy.restoreLocalStorage(); cy.deleteTable(tableName); + cy.saveLocalStorage(); }); // Routine to create a new look up column @@ -42,7 +47,6 @@ export const genTest = (apiType, dbType) => { .should("exist") .clear() .type(columnName); - // cy.get(".nc-column-type-input").last().click().type("Duration"); cy.getActiveMenu(".nc-dropdown-grid-add-column") .find(".nc-column-type-input") .last() @@ -60,7 +64,6 @@ export const genTest = (apiType, dbType) => { .contains(durationFormat) .click(); - // cy.get(".ant-btn-primary").contains("Save").should('exist').click(); cy.getActiveMenu(".nc-dropdown-grid-add-column") .find(".ant-btn-primary:visible") .contains("Save") @@ -83,8 +86,6 @@ export const genTest = (apiType, dbType) => { .trigger("mouseover", { force: true }) .click({ force: true }); - // cy.get(".nc-column-edit").click(); - // cy.get(".nc-column-edit").should("not.be.visible"); cy.getActiveMenu(".nc-dropdown-column-operations") .find(".nc-column-edit") .click(); @@ -102,7 +103,6 @@ export const genTest = (apiType, dbType) => { .contains(newDurationFormat) .click(); - // cy.get(".ant-btn-primary:visible").contains("Save").click(); cy.getActiveMenu(".nc-dropdown-edit-column") .find(".ant-btn-primary:visible") .contains("Save") @@ -145,9 +145,6 @@ export const genTest = (apiType, dbType) => { .contains("Cancel") .should("exist") .click(); - // mainPage.getCell(colName, index).find('input').then(($e) => { - // expect($e[0].value).to.equal(expectedValue) - // }) mainPage.getCell(colName, index).contains(expectedValue).should("exist"); }; From 9dacc167983e8fbb1296e12efbb8f58c11a45558 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:19:33 +0530 Subject: [PATCH 2/3] test: enable duration column tests Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/test/pg-restTableOps.js | 2 +- scripts/cypress/integration/test/restTableOps.js | 2 +- scripts/cypress/integration/test/xcdb-restTableOps.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cypress/integration/test/pg-restTableOps.js b/scripts/cypress/integration/test/pg-restTableOps.js index b60b13805f..d4a2d52e9f 100644 --- a/scripts/cypress/integration/test/pg-restTableOps.js +++ b/scripts/cypress/integration/test/pg-restTableOps.js @@ -31,7 +31,7 @@ const nocoTestSuite = (apiType, dbType) => { t3b.genTest(apiType, dbType); t3c.genTest(apiType, dbType); t3d.genTest(apiType, dbType); - // NcGUI v2 t3e.genTest(apiType, dbType); + t3e.genTest(apiType, dbType); }; nocoTestSuite("rest", "postgres"); diff --git a/scripts/cypress/integration/test/restTableOps.js b/scripts/cypress/integration/test/restTableOps.js index 75777ca93d..755e78599b 100644 --- a/scripts/cypress/integration/test/restTableOps.js +++ b/scripts/cypress/integration/test/restTableOps.js @@ -31,7 +31,7 @@ const nocoTestSuite = (apiType, dbType) => { t3b.genTest(apiType, dbType); t3c.genTest(apiType, dbType); t3d.genTest(apiType, dbType); - // NcGUI v2 t3e.genTest(apiType, dbType); + t3e.genTest(apiType, dbType); t3f.genTest(apiType, dbType); }; diff --git a/scripts/cypress/integration/test/xcdb-restTableOps.js b/scripts/cypress/integration/test/xcdb-restTableOps.js index ff9e8b9460..c10904d458 100644 --- a/scripts/cypress/integration/test/xcdb-restTableOps.js +++ b/scripts/cypress/integration/test/xcdb-restTableOps.js @@ -30,7 +30,7 @@ const nocoTestSuite = (apiType, dbType) => { t3b.genTest(apiType, dbType); t3c.genTest(apiType, dbType); t3d.genTest(apiType, dbType); - // NcGUI v2 t3e.genTest(apiType, dbType); + t3e.genTest(apiType, dbType); }; nocoTestSuite("rest", "xcdb"); From 5bcbe6bd5058e59e5b1cd30a1b8ebdf8c851852c Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:15:21 +0530 Subject: [PATCH 3/3] test: kludge for name highlight render on column modal Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/common/3e_duration_column.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/cypress/integration/common/3e_duration_column.js b/scripts/cypress/integration/common/3e_duration_column.js index c0f9f466df..ce7691d5ca 100644 --- a/scripts/cypress/integration/common/3e_duration_column.js +++ b/scripts/cypress/integration/common/3e_duration_column.js @@ -57,6 +57,10 @@ export const genTest = (apiType, dbType) => { .contains("Duration") .click(); + // fix me! wait till the modal rendering (input highlight) is completed + // focus shifts back to the input field to select text after the dropdown is rendered + cy.wait(500); + // Configure Duration format fetchParentFromLabel("Duration Format"); cy.getActiveSelection(".nc-dropdown-duration-option") @@ -96,6 +100,11 @@ export const genTest = (apiType, dbType) => { .should("exist") .clear() .type(newName); + + // fix me! wait till the modal rendering (input highlight) is completed + // focus shifts back to the input field to select text after the dropdown is rendered + cy.wait(500); + // Configure Duration format fetchParentFromLabel("Duration Format"); cy.getActiveSelection(".nc-dropdown-duration-option")