ToolJet/cypress-tests/cypress.config.js
Ajith KV 46abf0bdfe
Cypress test for dashboard, app and folder CRUD operations (#3677)
* Add and modify data-cy attribute for elements

* Add and modify common and dashboard selector and text

* Add task to delete download folder

* Modify faker file

* Add common methods

* Add methods specific for dashboard spec

* Modify dashboard spec

* Review changes

* Add and modify data-cy for elements

* Add custom command to verify elements

* Modify verify elements command

* Remove exported app file
2022-08-04 20:40:46 +05:30

35 lines
930 B
JavaScript

const { defineConfig } = require("cypress");
const { rmdir } = require("fs");
module.exports = defineConfig({
execTimeout: 1800000,
defaultCommandTimeout: 30000,
requestTimeout: 10000,
pageLoadTimeout: 20000,
responseTimeout: 10000,
viewportWidth: 1200,
viewportHeight: 960,
chromeWebSecurity: true,
trashAssetsBeforeRuns: true,
e2e: {
setupNodeEvents(on, config) {
on("task", {
deleteFolder(folderName) {
return new Promise((resolve, reject) => {
rmdir(folderName, { maxRetries: 10, recursive: true }, (err) => {
if (err) {
console.error(err);
return reject(err);
}
resolve(null);
});
});
},
});
return require("./cypress/plugins/index.js")(on, config);
},
baseUrl: "http://localhost:8082",
specPattern: "cypress/e2e/**/*.cy.js",
},
});