ToolJet/cypress-tests/cypress-platform.config.js

91 lines
3.1 KiB
JavaScript
Raw Normal View History

const { defineConfig } = require("cypress");
const { rmdir } = require("fs");
const fs = require("fs");
const XLSX = require("node-xlsx");
const pg = require("pg");
const path = require("path");
const pdf = require("pdf-parse");
module.exports = defineConfig({
execTimeout: 1800000,
defaultCommandTimeout: 30000,
requestTimeout: 30000,
pageLoadTimeout: 30000,
responseTimeout: 30000,
viewportWidth: 1440,
viewportHeight: 960,
chromeWebSecurity: false,
trashAssetsBeforeRuns: true,
e2e: {
setupNodeEvents (on, config) {
on("task", {
readPdf (pathToPdf) {
return new Promise((resolve) => {
const pdfPath = path.resolve(pathToPdf);
let dataBuffer = fs.readFileSync(pdfPath);
pdf(dataBuffer).then(function ({ text }) {
resolve(text);
});
});
},
});
on("task", {
readXlsx (filePath) {
return new Promise((resolve, reject) => {
try {
let dataBuffer = fs.readFileSync(filePath);
const jsonData = XLSX.parse(dataBuffer);
resolve(jsonData[0]["data"].toString());
} catch (e) {
reject(e);
}
});
},
});
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);
});
});
},
});
on("task", {
dbConnection ({ dbconfig, sql }) {
const client = new pg.Pool(dbconfig);
return client.query(sql);
},
});
return require("./cypress/plugins/index.js")(on, config);
},
downloadsFolder: "cypress/downloads",
experimentalRunAllSpecs: true,
experimentalModfyObstructiveThirdPartyCode: true,
2025-12-05 13:49:10 +00:00
baseUrl: "http://localhost:3000", // Default for local development (GitHub workflow overrides this)
specPattern: [
"cypress/e2e/happyPath/platform/firstUser/firstUserOnboarding.cy.js",
"cypress/e2e/happyPath/platform/ceTestcases/apps/appSlug.cy.js",
Platform LTS Final fixes (#13221) * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * Bugfixes/whitelabelling apis (#13180) * white-labelling apis * removed consoles logs * reverts * fixes for white-labelling * fixes * reverted breadcrumb changes (#13194) * fixes for getting public sso configurations * fix for enable signup on cloud * Cloud Trial and Banners (#13182) * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * Cloud Trial and Banners * revert * initial commit * Added website onboarding APIs * moved ai onboarding controller to auth module * ee banners * fix --------- Co-authored-by: Rohan Lahori <64496391+[email protected]> Co-authored-by: gsmithun4 <[email protected]> * Bugfixes/minor UI fixes-CLoud (#13203) * Bugfixes/UI bugs platform 1 (#13205) * cleanup * Audit logs fix * gitignore changes * postgrest configs removed * removed unused import * improvements * fix * improved startup logs * Platform cypress fix (#13192) * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * Bugfixes/whitelabelling apis (#13180) * white-labelling apis * removed consoles logs * reverts * fixes for white-labelling * fixes * Cypress fix * reverted breadcrumb changes (#13194) * cypress fix * title fix * fixes for getting public sso configurations --------- Co-authored-by: Rohan Lahori <64496391+[email protected]> Co-authored-by: gsmithun4 <[email protected]> * deployment fix * added interfaces and permissions * Bugfixes/lts 3.6 branch 1 platform (#13238) * fix * Licensing Banners Fixes Cloud and EE (#13241) * design: Adds license buttons to header * Refactor header actions * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * subscription page * fix banners --------- Co-authored-by: Nithin David Thomas <1277421+[email protected]> Co-authored-by: Rohan Lahori <64496391+[email protected]> * fix for public apps * fix * CE Instance Signup bug (#13254) * CE Instance Signup bug * improvement * fix * Add WEBSITE_SIGNUP_URL to deployment environment variables * Add WEBSITE_SIGNUP_URL to environment variables for deployment * Super admin banner fix (#13262) * Git Sync Fixes (#13249) * git-sync module changes * git sync fixes * added app resource guard * git-sync fixes * removed require feature * fix * review comment changes * ypress fix * App logo fix inside app builder * fix for subpath cache * fix (#13274) * platform-cypress-fix (#13271) * git sync fixes (#13277) * fix * Add data-cy for new components (#13289) --------- Co-authored-by: Rohan Lahori <64496391+[email protected]> Co-authored-by: Rudhra Deep Biswas <98055396+[email protected]> Co-authored-by: Ajith KV <[email protected]> Co-authored-by: Nithin David Thomas <1277421+[email protected]> Co-authored-by: rohanlahori <[email protected]> Co-authored-by: Adish M <[email protected]> Co-authored-by: Rudra deep Biswas <[email protected]>
2025-07-09 17:06:41 +00:00
"cypress/e2e/happyPath/platform/ceTestcases/**/!(*appSlug).cy.js",
"cypress/e2e/happyPath/platform/commonTestcases/**/*.cy.js",
],
numTestsKeptInMemory: 1,
redirectionLimit: 15,
experimentalMemoryManagement: true,
video: false,
videoUploadOnPasses: false,
retries: {
runMode: 2,
openMode: 0,
},
},
});