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. 37
      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

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

@ -9,14 +9,21 @@ export const genTest = (apiType, dbType) => {
function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.get(".nc-add-new-row-btn").click({ force: true });
cy.get("#data-table-form-Title > input").first().type(cellValue);
cy.getActiveModal()
cy.get(".nc-add-new-row-btn").click();
// cy.get("#data-table-form-Title > input").first().type(cellValue);
cy.get(".nc-expand-col-Title").find(".nc-cell > input")
.should("exist")
.first()
.clear()
.type(cellValue);
cy.getActiveDrawer()
.find("button")
.contains("Save row")
.click({ force: true });
cy.toastWait("updated successfully");
cy.get("body").type("{esc}");
mainPage.getCell("Title", index).contains(cellValue).should("exist");
}
@ -34,7 +41,7 @@ export const genTest = (apiType, dbType) => {
});
beforeEach(() => {
cy.fileHook();
cy.fileHook();
})
// delete table
@ -69,17 +76,17 @@ export const genTest = (apiType, dbType) => {
// edit the newly created column
it("Edit table column - rename", () => {
cy.get(`th:contains(${colName}) .nc-icon.ant-dropdown-trigger`)
.trigger("mouseover", { force: true })
.click({ force: true });
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible");
// rename column and verify
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(updatedColName);
.should('exist')
.clear()
.type(updatedColName);
cy.get(".ant-btn-primary:visible").contains("Save").click();
cy.toastWait("Column updated");
@ -110,7 +117,7 @@ export const genTest = (apiType, dbType) => {
.clear()
.type(updatedRandVal);
cy.getActiveModal()
cy.getActiveDrawer()
.find("button")
.contains("Save row")
.click({ force: true });
@ -126,7 +133,7 @@ export const genTest = (apiType, dbType) => {
.should("exist");
});
it("Delete row", () => {
it("Delete Row", () => {
mainPage
.getCell("Title", 1)
.contains(updatedRandVal)
@ -134,7 +141,7 @@ export const genTest = (apiType, dbType) => {
// delete row
cy.getActiveMenu()
.find('.ant-dropdown-menu-item:contains("Delete row")')
.find('.ant-dropdown-menu-item:contains("Delete Row")')
.first()
.click({ force: true });
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(".ant-checkbox").should('exist')
.eq(0).click({ force: true });
.eq(0).click({ force: true });
// delete selected rows
mainPage.getCell("Title", 3).rightclick({ force: true });
cy.getActiveMenu()
.contains("Delete all selected rows")
.contains("Delete Selected Rows")
.click({ force: true });
// verify if everything is wiped off
@ -185,4 +192,4 @@ export const genTest = (apiType, dbType) => {
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
*/

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

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

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

@ -95,7 +95,7 @@ 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({ force: true });
cy.get(".nc-add-new-row-btn").click();
} else {
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 });
cy.getActiveMenu()
.contains("Delete all selected rows")
.contains("Delete Selected Rows")
.click({ force: true });
// 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 });
mainPage.getCell("Country", 1).rightclick({ force: true });
cy.getActiveMenu()
.contains("Delete all selected rows")
.contains("Delete Selected Rows")
.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`, () => {
// 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")
.first()
.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`, () => {
// 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")
.first()
.click()

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

@ -262,6 +262,10 @@ Cypress.Commands.add("getActiveSelection", () => {
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) => {
// cy.get(".nc-btn-tbl-add").click();

Loading…
Cancel
Save