Browse Source

test: replace wait with intercept

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3801/head
Raju Udava 2 years ago committed by braks
parent
commit
a89358a0dc
  1. 24
      scripts/cypress/integration/common/3f_link_to_another_record.js

24
scripts/cypress/integration/common/3f_link_to_another_record.js

@ -169,6 +169,9 @@ export const genTest = (apiType, dbType) => {
// Expand form [Add new row]
//
it("Add HM, BT, MM Link, Expand form", () => {
// http://localhost:8080/api/v1/db/data/noco/p_0l53e1xgsxlecb/md_mn4xgb2jnq16a7?limit=10&offset=0&where=&fields[]=Title&fields[]=Id
cy.intercept("GET", `/api/v1/db/data/noco/**`).as("waitForCardLoad");
cy.openTableTab("Sheet2", 0);
// Click on `Add new row` button
@ -193,7 +196,8 @@ export const genTest = (apiType, dbType) => {
.find(".nc-action-icon")
.should("exist")
.click({ force: true });
cy.wait(1000);
// cy.wait(1000);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
@ -202,7 +206,8 @@ export const genTest = (apiType, dbType) => {
// MM
cy.get(".nc-expand-col-Sheet1.List").find(".ant-btn-primary").click();
cy.wait(1000);
// cy.wait(1000);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
@ -211,7 +216,8 @@ export const genTest = (apiType, dbType) => {
// HM
cy.get(".nc-expand-col-Link2-1hm").find(".ant-btn-primary").click();
cy.wait(1000);
// cy.wait(1000);
cy.wait("@waitForCardLoad");
cy.getActiveModal().find(".ant-card").should("exist").eq(0).click();
// Save row
@ -273,6 +279,9 @@ export const genTest = (apiType, dbType) => {
// Existing row, expand record
it("Add HM, BT, MM Link, expand record", () => {
// http://localhost:8080/api/v1/db/data/noco/p_0l53e1xgsxlecb/md_mn4xgb2jnq16a7?limit=10&offset=0&where=&fields[]=Title&fields[]=Id
cy.intercept("GET", `/api/v1/db/data/noco/**`).as("waitForCardLoad");
addRow(3, "2c");
cy.get(".nc-row-expand").eq(2).click({ force: true });
@ -282,7 +291,8 @@ export const genTest = (apiType, dbType) => {
.find(".nc-action-icon")
.should("exist")
.click({ force: true });
cy.wait(1000);
// cy.wait(1000);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
@ -291,7 +301,8 @@ export const genTest = (apiType, dbType) => {
// MM
cy.get(".nc-expand-col-Sheet1.List").find(".ant-btn-primary").click();
cy.wait(1000);
// cy.wait(1000);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
@ -301,7 +312,8 @@ export const genTest = (apiType, dbType) => {
// HM
cy.get(".nc-expand-col-Link2-1hm").find(".ant-btn-primary").click();
cy.wait(1000);
// cy.wait(1000);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")

Loading…
Cancel
Save