From 11ab351d431f73bd58a31dbf3f619b8387d06b6b Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:06:49 +0530 Subject: [PATCH] test: wait for expand form to get loaded before access Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/common/9a_QuickTest.js | 7 ++++++- scripts/cypress/integration/spec/roleValidation.spec.js | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/cypress/integration/common/9a_QuickTest.js b/scripts/cypress/integration/common/9a_QuickTest.js index 24481a2604..f808667d0e 100644 --- a/scripts/cypress/integration/common/9a_QuickTest.js +++ b/scripts/cypress/integration/common/9a_QuickTest.js @@ -56,13 +56,18 @@ let cn = [ ]; function openWebhook(index) { + // http://localhost:8080/api/v1/db/meta/tables/md_dx81kkfdso115u/hooks + cy.intercept("GET", "/api/v1/db/meta/tables/*/hooks").as("getHooks"); + cy.get(".nc-actions-menu-btn").should("exist").click(); cy.getActiveMenu(".nc-dropdown-actions-menu") .find(".ant-dropdown-menu-title-content") .contains("Webhooks") .click(); - cy.get(".nc-hook").eq(index).click(); + cy.wait("@getHooks"); + + cy.get(`.nc-hook:eq(${index})`).should("exist").click(); } // to be invoked after open diff --git a/scripts/cypress/integration/spec/roleValidation.spec.js b/scripts/cypress/integration/spec/roleValidation.spec.js index 6d08ac9273..fc03f211e2 100644 --- a/scripts/cypress/integration/spec/roleValidation.spec.js +++ b/scripts/cypress/integration/spec/roleValidation.spec.js @@ -162,6 +162,10 @@ export function _editData(roleType, mode) { .eq(0) .trigger("mouseover", { force: true }); cy.get(".nc-row-expand").should("exist").eq(10).click({ force: true }); + + // wait for page render to complete + cy.get('button:contains("Save row"):visible').should("exist"); + cy.getActiveDrawer(".nc-drawer-expanded-form") .find("button") .contains("Save row") @@ -175,6 +179,10 @@ export function _editData(roleType, mode) { // update cell contents option using row expander should be disabled // cy.get(".nc-row-expand").should("exist").eq(10).click({ force: true }); + + // wait for page render to complete + cy.get('button:contains("Save row"):visible').should("exist"); + cy.getActiveDrawer(".nc-drawer-expanded-form") .find("button:disabled") .contains("Save row")