From 42aebcf463cf1bc7c1e6fd34eb953ebafe49618b Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Sat, 24 Sep 2022 12:12:56 +0530 Subject: [PATCH 1/2] test(expanded-form): wait for page load Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../integration/common/4g_table_view_expanded_form.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 18dd683a38..74148918c3 100644 --- a/scripts/cypress/integration/common/4g_table_view_expanded_form.js +++ b/scripts/cypress/integration/common/4g_table_view_expanded_form.js @@ -66,7 +66,8 @@ export const genTest = (apiType, dbType) => { .should("exist"); if (viewType === "gallery") { - // cy.intercept('/api/v1/db/meta/galleries/*').as('getGalleryView'); + // http://localhost:8080/api/v1/db/data/noco/p_4ufoizgrorwyey/md_g0zc9d40w8zpmy/views/vw_xauikhkm8r49fy?offset=0&limit=25 + cy.intercept("/api/v1/db/data/noco/**").as("getGalleryViewData"); // mainPage.unhideField("City List"); cy.get(".nc-fields-menu-btn").click(); @@ -75,9 +76,8 @@ export const genTest = (apiType, dbType) => { .click(); cy.get(".nc-fields-menu-btn").click(); + cy.wait(["@getGalleryViewData"]); cy.get('.ant-card-body [title="City List"]').should("exist"); - cy.wait(1000); - // cy.wait(['@getGalleryView']) } }); From a5f0bd179325be0fd5dd440c6b04a56cd3c8e405 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 24 Sep 2022 12:54:26 +0530 Subject: [PATCH 2/2] chore(cypress): persist localstorage across tests Signed-off-by: Pranav C --- .../integration/common/4g_table_view_expanded_form.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 74148918c3..1094a7e4df 100644 --- a/scripts/cypress/integration/common/4g_table_view_expanded_form.js +++ b/scripts/cypress/integration/common/4g_table_view_expanded_form.js @@ -23,13 +23,18 @@ function verifyExpandFormHeader(title) { export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; + let clear; + describe(`${apiType.toUpperCase()} api - Table views: Expanded form`, () => { before(() => { cy.restoreLocalStorage(); // open a table to work on views // - cy.openTableTab("Country", 25); + cy.openTableTab('Country', 25); + + clear = Cypress.LocalStorage.clear; + Cypress.LocalStorage.clear = () => {} }); beforeEach(() => { @@ -44,6 +49,7 @@ export const genTest = (apiType, dbType) => { cy.restoreLocalStorage(); cy.closeTableTab("Country"); cy.saveLocalStorage(); + Cypress.LocalStorage.clear = clear; }); // Common routine to create/edit/delete GRID & GALLERY view