test: cy views-test suite

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
This commit is contained in:
Raju Udava
2022-08-25 23:15:36 +05:30
parent c6a878ed32
commit b69bc6e9f4
4 changed files with 143 additions and 72 deletions

View File

@@ -401,6 +401,25 @@ export class _mainPage {
});
};
downloadAndVerifyCsvFromSharedView = (filename, verifyCsv) => {
cy.get(".nc-actions-menu-btn").click();
cy.get('.nc-project-menu-item').contains('Download as CSV').should('exist').click();
cy.toastWait("Successfully exported all table data").then(() => {
// download folder path, read from config file
const downloadsFolder = Cypress.config("downloadsFolder");
let filePath = path.join(downloadsFolder, filename);
// append download folder path with filename to generate full file path, retrieve file
cy.readFile(filePath).then((fileData) => {
// from CSV, split into records (rows)
const rows = fileData.replace(/\r\n/g, "\n").split("\n");
verifyCsv(rows);
deleteDownloadsFolder();
});
});
};
getIFrameCell = (columnHeader, cellNumber) => {
return cy
.iframe()