Browse Source

test(cypress): stability- metasync toast message validation re-order

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/1027/head
Raju Udava 3 years ago
parent
commit
a201ac9de7
  1. 61
      scripts/cypress/support/page_objects/mainPage.js

61
scripts/cypress/support/page_objects/mainPage.js

@ -130,7 +130,8 @@ export class _mainPage {
cy.get(".nc-invite-or-save-btn").click();
cy.toastWait("Successfully updated the user details");
this.roleURL[role] = "http://localhost:3000/#/user/authentication/signin";
this.roleURL[role] =
"http://localhost:3000/#/user/authentication/signin";
};
getCell = (columnHeader, cellNumber) => {
@ -230,28 +231,28 @@ export class _mainPage {
};
shareView = () => {
return cy.get('.nc-btn-share-view');
}
return cy.get(".nc-btn-share-view");
};
shareViewList = () => {
cy.get('.nc-actions-menu-btn').click();
cy.get(".nc-actions-menu-btn").click();
return cy.getActiveMenu().find('[role="menuitem"]').eq(2);
}
};
downloadCsv = () => {
cy.get('.nc-actions-menu-btn').click();
cy.get(".nc-actions-menu-btn").click();
return cy.getActiveMenu().find('[role="menuitem"]').eq(0);
}
};
uploadCsv = () => {
cy.get('.nc-actions-menu-btn').click();
cy.get(".nc-actions-menu-btn").click();
return cy.getActiveMenu().find('[role="menuitem"]').eq(1);
}
};
automations = () => {
cy.get('.nc-actions-menu-btn').click();
cy.get(".nc-actions-menu-btn").click();
return cy.getActiveMenu().find('[role="menuitem"]').eq(3);
}
};
hideField = (field) => {
cy.get(".nc-grid-header-cell").contains(field).should("be.visible");
@ -298,11 +299,16 @@ export class _mainPage {
cy.contains("Add Filter").click();
cy.get(".nc-filter-field-select").last().click();
cy.getActiveMenu().find(`.v-list-item:contains(${field})`).first().click();
cy.getActiveMenu()
.find(`.v-list-item:contains(${field})`)
.first()
.click();
cy.get(".nc-filter-operation-select").last().click();
cy.getActiveMenu().find(`.v-list-item:contains(${operation})`).click();
if (operation != "is null" && operation != "is not null") {
cy.get(".nc-filter-value-select input:text").last().type(`${value}`);
cy.get(".nc-filter-value-select input:text")
.last()
.type(`${value}`);
cy.get(".nc-filter-operation-select").last().click();
}
@ -359,10 +365,10 @@ export class _mainPage {
.then(() => {
cy.toastWait("Deleted shared view successfully");
// close modal
cy.get('.v-overlay--active > .v-overlay__scrim').click({force: true});
cy.get(".v-overlay--active > .v-overlay__scrim").click({
force: true,
});
});
};
// download CSV & verify
@ -395,7 +401,9 @@ export class _mainPage {
getIFrameCell = (columnHeader, cellNumber) => {
return cy
.iframe()
.find(`tbody > :nth-child(${cellNumber}) > [data-col="${columnHeader}"]`);
.find(
`tbody > :nth-child(${cellNumber}) > [data-col="${columnHeader}"]`
);
};
// https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Sharing-Context
@ -414,9 +422,13 @@ export class _mainPage {
// open Project metadata tab
//
this.navigationDraw(this.PROJ_METADATA).click();
cy.get(".nc-meta-mgmt-metadata-tab").should("exist").click({ force: true });
cy.get(".nc-meta-mgmt-metadata-tab")
.should("exist")
.click({ force: true });
// kludge, at times test failed to open tab on click
cy.get(".nc-meta-mgmt-metadata-tab").should("exist").click({ force: true });
cy.get(".nc-meta-mgmt-metadata-tab")
.should("exist")
.click({ force: true });
}
closeMetaTab() {
@ -429,9 +441,14 @@ export class _mainPage {
}
metaSyncValidate(tbl, msg) {
cy.get(".nc-btn-metasync-reload").should("exist").click({ force: true });
cy.get(".nc-btn-metasync-reload")
.should("exist")
.click({ force: true });
cy.get(`.nc-metasync-row-${tbl}`).contains(msg).should("exist");
cy.get(".nc-btn-metasync-sync-now").should("exist").click({ force: true });
cy.get(".nc-btn-metasync-sync-now")
.should("exist")
.click({ force: true });
cy.toastWait(`Table metadata recreated successfully`);
cy.get(".nc-metasync-row").then((row) => {
for (let i = 0; i < row.length; i++) {
cy.wrap(row).contains("No change identified").should("exist");
@ -441,7 +458,7 @@ export class _mainPage {
// cy.get(`.nc-metasync-row-${tbl}`)
// .contains("No change identified")
// .should("exist");
cy.toastWait(`Table metadata recreated successfully`);
// cy.get(`.nc-metasync-row-${tbl}`).should("exist");
}
}

Loading…
Cancel
Save