From 9ee43eca5519d2bec03d8a3764fb966b46bc89b5 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Sun, 25 Sep 2022 10:58:45 +0530 Subject: [PATCH] test: use intercept for unlink Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/common/3e_duration_column.js | 1 - .../integration/common/3f_link_to_another_record.js | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/cypress/integration/common/3e_duration_column.js b/scripts/cypress/integration/common/3e_duration_column.js index 3d6f6a3cf4..e86c36b1b4 100644 --- a/scripts/cypress/integration/common/3e_duration_column.js +++ b/scripts/cypress/integration/common/3e_duration_column.js @@ -123,7 +123,6 @@ export const genTest = (apiType, dbType) => { ) => { if (isNewRow) { cy.get(".nc-add-new-row-btn:visible").should("exist"); - cy.wait(500); cy.get(".nc-add-new-row-btn").click(); } else { // mainPage.getRow(index).find(".nc-row-expand-icon").click({ force: true }); diff --git a/scripts/cypress/integration/common/3f_link_to_another_record.js b/scripts/cypress/integration/common/3f_link_to_another_record.js index 422fb37468..3891fd5404 100644 --- a/scripts/cypress/integration/common/3f_link_to_another_record.js +++ b/scripts/cypress/integration/common/3f_link_to_another_record.js @@ -94,6 +94,11 @@ export const genTest = (apiType, dbType) => { // Unlink LTAR cell // function ltarUnlink(columnName, index) { + // http://localhost:8080/api/v1/db/meta/audits/comments/count?ids[]=1&fk_model_id=md_f4y7jp89pe8vkt + cy.intercept("GET", `/api/v1/db/meta/audits/comments/count?**`).as( + "unlinkCount" + ); + // Click on cell to enable unlink icon cy.get(`:nth-child(${index}) > [data-title="${columnName}"]`) .last() @@ -107,7 +112,7 @@ export const genTest = (apiType, dbType) => { .click(); // Glitch; hence wait - cy.wait(1000); + cy.wait("@unlinkCount"); } // before(() => {