From 50953fe5be5c32a39e3174f559c2982cc84abdbb Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:05:07 +0530 Subject: [PATCH] test: wait for grid re-render after table rename Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../integration/common/1a_table_operations.js | 3 +++ scripts/cypress/support/commands.js | 23 ++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/cypress/integration/common/1a_table_operations.js b/scripts/cypress/integration/common/1a_table_operations.js index 26a504cd8d..962e206eec 100644 --- a/scripts/cypress/integration/common/1a_table_operations.js +++ b/scripts/cypress/integration/common/1a_table_operations.js @@ -84,6 +84,9 @@ export const genTest = (apiType, dbType) => { // 2. Table tab name has changed cy.get(`.ant-tabs-tab:contains('CityX'):visible`).should("exist"); + // Wait for Grid to render + cy.gridWait(25); + // 3. contents of the table are valid mainPage .getCell(`City`, 1) diff --git a/scripts/cypress/support/commands.js b/scripts/cypress/support/commands.js index a1734a933a..d930229d50 100644 --- a/scripts/cypress/support/commands.js +++ b/scripts/cypress/support/commands.js @@ -163,19 +163,8 @@ Cypress.Commands.add("refreshTableTab", () => { cy.toastWait("Tables refreshed"); }); -// tn: table name -// rc: row count. validate row count if rc!=0 -Cypress.Commands.add("openTableTab", (tn, rc) => { - cy.task("log", `[openTableTab] ${tn} ${rc}`); - - cy.get(`.nc-project-tree-tbl-${tn}`).should("exist").first().click(); - - // kludge to make new tab active - // cy.get('.ant-tabs-tab-btn') - // .contains(tn) - // .should('exist') - // .click(); - +// Wait for grid view render +Cypress.Commands.add("gridWait", (rc) => { // for some tables, linked records are not available immediately cy.wait(1000); @@ -185,6 +174,14 @@ Cypress.Commands.add("openTableTab", (tn, rc) => { if (rc != 0) { cy.get(".nc-grid-row").should("have.length", rc); } +}) + +// tn: table name +// rc: row count. validate row count if rc!=0 +Cypress.Commands.add("openTableTab", (tn, rc) => { + cy.task("log", `[openTableTab] ${tn} ${rc}`); + cy.get(`.nc-project-tree-tbl-${tn}`).should("exist").first().click(); + cy.gridWait(rc); }); Cypress.Commands.add("closeTableTab", (tn) => {