Browse Source

test: wait for grid re-render after table rename

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3945/head
Raju Udava 2 years ago
parent
commit
50953fe5be
  1. 3
      scripts/cypress/integration/common/1a_table_operations.js
  2. 23
      scripts/cypress/support/commands.js

3
scripts/cypress/integration/common/1a_table_operations.js

@ -84,6 +84,9 @@ export const genTest = (apiType, dbType) => {
// 2. Table tab name has changed
cy.get(`.ant-tabs-tab:contains('CityX'):visible`).should("exist");
// Wait for Grid to render
cy.gridWait(25);
// 3. contents of the table are valid
mainPage
.getCell(`City`, 1)

23
scripts/cypress/support/commands.js

@ -163,19 +163,8 @@ Cypress.Commands.add("refreshTableTab", () => {
cy.toastWait("Tables refreshed");
});
// tn: table name
// rc: row count. validate row count if rc!=0
Cypress.Commands.add("openTableTab", (tn, rc) => {
cy.task("log", `[openTableTab] ${tn} ${rc}`);
cy.get(`.nc-project-tree-tbl-${tn}`).should("exist").first().click();
// kludge to make new tab active
// cy.get('.ant-tabs-tab-btn')
// .contains(tn)
// .should('exist')
// .click();
// Wait for grid view render
Cypress.Commands.add("gridWait", (rc) => {
// for some tables, linked records are not available immediately
cy.wait(1000);
@ -185,6 +174,14 @@ Cypress.Commands.add("openTableTab", (tn, rc) => {
if (rc != 0) {
cy.get(".nc-grid-row").should("have.length", rc);
}
})
// tn: table name
// rc: row count. validate row count if rc!=0
Cypress.Commands.add("openTableTab", (tn, rc) => {
cy.task("log", `[openTableTab] ${tn} ${rc}`);
cy.get(`.nc-project-tree-tbl-${tn}`).should("exist").first().click();
cy.gridWait(rc);
});
Cypress.Commands.add("closeTableTab", (tn) => {

Loading…
Cancel
Save