diff --git a/scripts/cypress/integration/common/1b_table_column_operations.js b/scripts/cypress/integration/common/1b_table_column_operations.js index e01b1a97a4..5c0bab0826 100644 --- a/scripts/cypress/integration/common/1b_table_column_operations.js +++ b/scripts/cypress/integration/common/1b_table_column_operations.js @@ -8,10 +8,7 @@ export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; function addNewRow(index, cellValue) { - cy.get(".nc-add-new-row-btn:visible").should("exist"); - cy.get(".nc-add-new-row-btn").click(); - - cy.wait(2000); + mainPage.addNewRowExpand("tablex"); // cy.get("#data-table-form-Title > input").first().type(cellValue); cy.get(".nc-expand-col-Title") diff --git a/scripts/cypress/integration/common/3a_filter_sort_fields_operations.js b/scripts/cypress/integration/common/3a_filter_sort_fields_operations.js index 67c42329bb..ba95b20028 100644 --- a/scripts/cypress/integration/common/3a_filter_sort_fields_operations.js +++ b/scripts/cypress/integration/common/3a_filter_sort_fields_operations.js @@ -52,7 +52,7 @@ export const genTest = (apiType, dbType) => { ); // add a row to end of Country table - cy.get(".nc-add-new-row-btn").click(); + mainPage.addNewRowExpand("Country"); cy.get(".nc-expand-col-Country") .find(".nc-cell > input") .first() diff --git a/scripts/cypress/integration/common/3e_duration_column.js b/scripts/cypress/integration/common/3e_duration_column.js index 8824b1eaf0..3b7ac4e3b2 100644 --- a/scripts/cypress/integration/common/3e_duration_column.js +++ b/scripts/cypress/integration/common/3e_duration_column.js @@ -127,8 +127,7 @@ export const genTest = (apiType, dbType) => { isNewRow = false ) => { if (isNewRow) { - cy.get(".nc-add-new-row-btn:visible").should("exist"); - cy.get(".nc-add-new-row-btn").click(); + mainPage.addNewRowExpand("DurationTable"); } else { // mainPage.getRow(index).find(".nc-row-expand-icon").click({ force: true }); cy.get(".nc-row-expand") 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 7414773786..efada58e54 100644 --- a/scripts/cypress/integration/common/3f_link_to_another_record.js +++ b/scripts/cypress/integration/common/3f_link_to_another_record.js @@ -183,8 +183,7 @@ export const genTest = (apiType, dbType) => { cy.openTableTab("Sheet2", 0); // Click on `Add new row` button - cy.get(".nc-add-new-row-btn:visible").should("exist"); - cy.get(".nc-add-new-row-btn").click(); + mainPage.addNewRowExpand("Sheet2"); // Title cy.get(".nc-expand-col-Title") diff --git a/scripts/cypress/integration/common/4f_grid_view_share.js b/scripts/cypress/integration/common/4f_grid_view_share.js index 9b45ec7480..271cec9bb8 100644 --- a/scripts/cypress/integration/common/4f_grid_view_share.js +++ b/scripts/cypress/integration/common/4f_grid_view_share.js @@ -401,7 +401,7 @@ export const genTest = (apiType, dbType) => { it(`Generate default Shared GRID view URL`, () => { // add row - cy.get(".nc-add-new-row-btn").click(); + mainPage.addNewRowExpand("Country"); cy.get(".nc-expand-col-Country") .find(".nc-cell > input") .should("exist") diff --git a/scripts/cypress/integration/common/4f_pg_grid_view_share.js b/scripts/cypress/integration/common/4f_pg_grid_view_share.js index 4a2b948a3c..0a9f89a077 100644 --- a/scripts/cypress/integration/common/4f_pg_grid_view_share.js +++ b/scripts/cypress/integration/common/4f_pg_grid_view_share.js @@ -428,7 +428,7 @@ export const genTest = (apiType, dbType) => { it(`Generate default Shared GRID view URL`, () => { // add row - cy.get(".nc-add-new-row-btn").click(); + mainPage.addNewRowExpand("Country"); cy.get(".nc-expand-col-Country") .find(".nc-cell > input") .should("exist") diff --git a/scripts/cypress/integration/common/8a_webhook.js b/scripts/cypress/integration/common/8a_webhook.js index 4f9e633fc7..0905b42552 100644 --- a/scripts/cypress/integration/common/8a_webhook.js +++ b/scripts/cypress/integration/common/8a_webhook.js @@ -148,8 +148,7 @@ function clearServerData() { } function addNewRow(index, cellValue) { - cy.get(".nc-add-new-row-btn:visible").should("exist"); - cy.get(".nc-add-new-row-btn").click(); + mainPage.addNewRowExpand("Temp"); cy.get(".nc-expand-col-Title") .should("exist") diff --git a/scripts/cypress/support/page_objects/mainPage.js b/scripts/cypress/support/page_objects/mainPage.js index ab4f9f0692..ba272ac871 100644 --- a/scripts/cypress/support/page_objects/mainPage.js +++ b/scripts/cypress/support/page_objects/mainPage.js @@ -161,6 +161,21 @@ export class _mainPage { }); }; + addNewRowExpand(table) { + cy.get(".nc-add-new-row-btn:visible").should("exist"); + cy.get(".nc-add-new-row-btn").click(); + + // cy.wait(2000); + // cy.get(`.nc-tooltip-content:contains("Add new row")`).should("not.exist"); + + // 'Add new row' tooltip persists for a while; force click on header to make it disappear + cy.get( + `.nc-drawer-expanded-form .nc-expanded-form-header :contains("${table}")` + ) + .should("exist") + .click({ force: true }); + } + // addExistingUserToProject = (emailId, role) => { // cy.get('.v-list-item:contains("Team & Auth")').click(); // cy.get(`tr:contains(${emailId})`)