From d467fff3a57296cc50957c694d78824a2645d563 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:28:51 +0530 Subject: [PATCH] test: conditional wait for expand row Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../integration/common/1b_table_column_operations.js | 3 +++ .../integration/common/4g_table_view_expanded_form.js | 7 +++++-- scripts/cypress/integration/common/8a_webhook.js | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/cypress/integration/common/1b_table_column_operations.js b/scripts/cypress/integration/common/1b_table_column_operations.js index 75925ba475..0a5369d498 100644 --- a/scripts/cypress/integration/common/1b_table_column_operations.js +++ b/scripts/cypress/integration/common/1b_table_column_operations.js @@ -143,6 +143,9 @@ export const genTest = (apiType, dbType) => { .trigger("mouseover", { force: true }); cy.get(".nc-row-expand").click({ force: true }); + // wait for page render to complete + cy.get('button:contains("Save row"):visible').should("exist"); + cy.get(".nc-expand-col-Title") .find(".nc-cell > input") .should("exist") diff --git a/scripts/cypress/integration/common/4g_table_view_expanded_form.js b/scripts/cypress/integration/common/4g_table_view_expanded_form.js index 1094a7e4df..3031a30654 100644 --- a/scripts/cypress/integration/common/4g_table_view_expanded_form.js +++ b/scripts/cypress/integration/common/4g_table_view_expanded_form.js @@ -31,10 +31,10 @@ export const genTest = (apiType, dbType) => { // open a table to work on views // - cy.openTableTab('Country', 25); + cy.openTableTab("Country", 25); clear = Cypress.LocalStorage.clear; - Cypress.LocalStorage.clear = () => {} + Cypress.LocalStorage.clear = () => {}; }); beforeEach(() => { @@ -91,6 +91,9 @@ export const genTest = (apiType, dbType) => { // click on first row-expand if grid & first card if its gallery if (viewType === "grid") { cy.get(".nc-row-expand").first().click({ force: true }); + + // wait for page render to complete + cy.get('button:contains("Save row"):visible').should("exist"); } else if (viewType === "gallery") { cy.get(".nc-gallery-container .ant-card").first().click(); } diff --git a/scripts/cypress/integration/common/8a_webhook.js b/scripts/cypress/integration/common/8a_webhook.js index f39b8a6935..77f0bf6cb9 100644 --- a/scripts/cypress/integration/common/8a_webhook.js +++ b/scripts/cypress/integration/common/8a_webhook.js @@ -184,6 +184,9 @@ function updateRow(index, cellValue) { .eq(index - 1) .click({ force: true }); + // wait for page render to complete + cy.get('button:contains("Save row"):visible').should("exist"); + cy.get(".nc-expand-col-Title") .should("exist") .find(".nc-cell > input")