Browse Source

test: table operation fixes

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3335/head
Raju Udava 2 years ago
parent
commit
4e73545a79
  1. 35
      scripts/cypress-v2/integration/common/1b_table_column_operations.js
  2. 4
      scripts/cypress-v2/integration/common/3a_filter_sort_fields_operations.js
  3. 2
      scripts/cypress-v2/integration/common/3e_duration_column.js
  4. 2
      scripts/cypress-v2/integration/common/4c_form_view_detailed.js
  5. 2
      scripts/cypress-v2/integration/common/4e_form_view_share.js
  6. 2
      scripts/cypress-v2/integration/common/4f_grid_view_share.js
  7. 2
      scripts/cypress-v2/integration/common/4f_pg_grid_view_share.js
  8. 4
      scripts/cypress-v2/support/commands.js

35
scripts/cypress-v2/integration/common/1b_table_column_operations.js

@ -9,14 +9,21 @@ export const genTest = (apiType, dbType) => {
function addNewRow(index, cellValue) { function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn:visible").should("exist"); cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.get(".nc-add-new-row-btn").click({ force: true }); cy.get(".nc-add-new-row-btn").click();
cy.get("#data-table-form-Title > input").first().type(cellValue); // cy.get("#data-table-form-Title > input").first().type(cellValue);
cy.getActiveModal() cy.get(".nc-expand-col-Title").find(".nc-cell > input")
.should("exist")
.first()
.clear()
.type(cellValue);
cy.getActiveDrawer()
.find("button") .find("button")
.contains("Save row") .contains("Save row")
.click({ force: true }); .click({ force: true });
cy.toastWait("updated successfully"); cy.toastWait("updated successfully");
cy.get("body").type("{esc}");
mainPage.getCell("Title", index).contains(cellValue).should("exist"); mainPage.getCell("Title", index).contains(cellValue).should("exist");
} }
@ -34,7 +41,7 @@ export const genTest = (apiType, dbType) => {
}); });
beforeEach(() => { beforeEach(() => {
cy.fileHook(); cy.fileHook();
}) })
// delete table // delete table
@ -69,17 +76,17 @@ export const genTest = (apiType, dbType) => {
// edit the newly created column // edit the newly created column
it("Edit table column - rename", () => { it("Edit table column - rename", () => {
cy.get(`th:contains(${colName}) .nc-icon.ant-dropdown-trigger`) cy.get(`th:contains(${colName}) .nc-icon.ant-dropdown-trigger`)
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
cy.get(".nc-column-edit").click(); cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible"); cy.get(".nc-column-edit").should("not.be.visible");
// rename column and verify // rename column and verify
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
.should('exist') .should('exist')
.clear() .clear()
.type(updatedColName); .type(updatedColName);
cy.get(".ant-btn-primary:visible").contains("Save").click(); cy.get(".ant-btn-primary:visible").contains("Save").click();
cy.toastWait("Column updated"); cy.toastWait("Column updated");
@ -110,7 +117,7 @@ export const genTest = (apiType, dbType) => {
.clear() .clear()
.type(updatedRandVal); .type(updatedRandVal);
cy.getActiveModal() cy.getActiveDrawer()
.find("button") .find("button")
.contains("Save row") .contains("Save row")
.click({ force: true }); .click({ force: true });
@ -126,7 +133,7 @@ export const genTest = (apiType, dbType) => {
.should("exist"); .should("exist");
}); });
it("Delete row", () => { it("Delete Row", () => {
mainPage mainPage
.getCell("Title", 1) .getCell("Title", 1)
.contains(updatedRandVal) .contains(updatedRandVal)
@ -134,7 +141,7 @@ export const genTest = (apiType, dbType) => {
// delete row // delete row
cy.getActiveMenu() cy.getActiveMenu()
.find('.ant-dropdown-menu-item:contains("Delete row")') .find('.ant-dropdown-menu-item:contains("Delete Row")')
.first() .first()
.click({ force: true }); .click({ force: true });
cy.get("td").contains(randVal).should("not.exist"); cy.get("td").contains(randVal).should("not.exist");
@ -150,12 +157,12 @@ export const genTest = (apiType, dbType) => {
cy.get('.nc-no-label').should('exist').eq(0).trigger('mouseover', { force: true }) cy.get('.nc-no-label').should('exist').eq(0).trigger('mouseover', { force: true })
cy.get(".ant-checkbox").should('exist') cy.get(".ant-checkbox").should('exist')
.eq(0).click({ force: true }); .eq(0).click({ force: true });
// delete selected rows // delete selected rows
mainPage.getCell("Title", 3).rightclick({ force: true }); mainPage.getCell("Title", 3).rightclick({ force: true });
cy.getActiveMenu() cy.getActiveMenu()
.contains("Delete all selected rows") .contains("Delete Selected Rows")
.click({ force: true }); .click({ force: true });
// verify if everything is wiped off // verify if everything is wiped off

4
scripts/cypress-v2/integration/common/3a_filter_sort_fields_operations.js

@ -68,7 +68,7 @@ export const genTest = (apiType, dbType) => {
// delete single row // delete single row
// //
it.skip("Delete row", () => { it.skip("Delete Row", () => {
// delete row added in previous step // delete row added in previous step
mainPage.getCell("Country", 10).rightclick(); mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu().contains("Delete Row").click(); cy.getActiveMenu().contains("Delete Row").click();
@ -130,7 +130,7 @@ export const genTest = (apiType, dbType) => {
mainPage.getCell("Country", 10).rightclick({ force: true }); mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu() cy.getActiveMenu()
.contains("Delete all selected rows") .contains("Delete Selected Rows")
.click({ force: true }); .click({ force: true });
// verify // verify

2
scripts/cypress-v2/integration/common/3e_duration_column.js

@ -95,7 +95,7 @@ export const genTest = (apiType, dbType) => {
if (isNewRow) { if (isNewRow) {
cy.get(".nc-add-new-row-btn:visible").should("exist"); cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.wait(500) cy.wait(500)
cy.get(".nc-add-new-row-btn").click({ force: true }); cy.get(".nc-add-new-row-btn").click();
} else { } else {
mainPage.getRow(index).find(".nc-row-expand-icon").click({ force: true }); mainPage.getRow(index).find(".nc-row-expand-icon").click({ force: true });
} }

2
scripts/cypress-v2/integration/common/4c_form_view_detailed.js

@ -424,7 +424,7 @@ export const genTest = (apiType, dbType) => {
mainPage.getCell("Country", 10).rightclick({ force: true }); mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu() cy.getActiveMenu()
.contains("Delete all selected rows") .contains("Delete Selected Rows")
.click({ force: true }); .click({ force: true });
// mainPage // mainPage

2
scripts/cypress-v2/integration/common/4e_form_view_share.js

@ -212,7 +212,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".ant-checkbox").should('exist').eq(1).click({ force: true }); cy.get(".ant-checkbox").should('exist').eq(1).click({ force: true });
mainPage.getCell("Country", 1).rightclick({ force: true }); mainPage.getCell("Country", 1).rightclick({ force: true });
cy.getActiveMenu() cy.getActiveMenu()
.contains("Delete all selected rows") .contains("Delete Selected Rows")
.click({ force: true }); .click({ force: true });
}); });
}; };

2
scripts/cypress-v2/integration/common/4f_grid_view_share.js

@ -427,7 +427,7 @@ export const genTest = (apiType, dbType) => {
it(`Generate default Shared GRID view URL`, () => { it(`Generate default Shared GRID view URL`, () => {
// add row // add row
cy.get(".nc-add-new-row-btn").click({ force: true }); cy.get(".nc-add-new-row-btn").click();
cy.get("#data-table-form-Country > input") cy.get("#data-table-form-Country > input")
.first() .first()
.click() .click()

2
scripts/cypress-v2/integration/common/4f_pg_grid_view_share.js

@ -423,7 +423,7 @@ export const genTest = (apiType, dbType) => {
it(`Generate default Shared GRID view URL`, () => { it(`Generate default Shared GRID view URL`, () => {
// add row // add row
cy.get(".nc-add-new-row-btn").click({ force: true }); cy.get(".nc-add-new-row-btn").click();
cy.get("#data-table-form-Country > input") cy.get("#data-table-form-Country > input")
.first() .first()
.click() .click()

4
scripts/cypress-v2/support/commands.js

@ -262,6 +262,10 @@ Cypress.Commands.add("getActiveSelection", () => {
return cy.get(".ant-select-dropdown:visible").last(); return cy.get(".ant-select-dropdown:visible").last();
}) })
Cypress.Commands.add("getActiveDrawer", () => {
return cy.get(".ant-drawer-content:visible").last();
});
Cypress.Commands.add("createTable", (name) => { Cypress.Commands.add("createTable", (name) => {
// cy.get(".nc-btn-tbl-add").click(); // cy.get(".nc-btn-tbl-add").click();

Loading…
Cancel
Save