mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import { defineConfig } from "cypress";
|
|
import mochawesome from "cypress-mochawesome-reporter/plugin.js";
|
|
|
|
let globalState;
|
|
|
|
// Fetch from environment variable
|
|
const connectorId = process.env.CYPRESS_CONNECTOR || "service";
|
|
const screenshotsFolderName = `screenshots/${connectorId}`;
|
|
const reportName = process.env.REPORT_NAME || `${connectorId}_report`;
|
|
|
|
export default defineConfig({
|
|
e2e: {
|
|
setupNodeEvents(on, config) {
|
|
mochawesome(on);
|
|
|
|
on("task", {
|
|
setGlobalState: (val) => {
|
|
return (globalState = val || {});
|
|
},
|
|
getGlobalState: () => {
|
|
return globalState || {};
|
|
},
|
|
cli_log: (message) => {
|
|
// eslint-disable-next-line no-console
|
|
console.log("Logging console message from task");
|
|
// eslint-disable-next-line no-console
|
|
console.log(message);
|
|
return null;
|
|
},
|
|
});
|
|
|
|
return config;
|
|
},
|
|
experimentalRunAllSpecs: true,
|
|
|
|
reporter: "cypress-mochawesome-reporter",
|
|
reporterOptions: {
|
|
reportDir: `cypress/reports/${connectorId}`,
|
|
reportFilename: reportName,
|
|
reportPageTitle: `[${connectorId}] Cypress test report`,
|
|
embeddedScreenshots: true,
|
|
overwrite: false,
|
|
inlineAssets: true,
|
|
saveJson: true,
|
|
},
|
|
},
|
|
chromeWebSecurity: false,
|
|
defaultCommandTimeout: 10000,
|
|
pageLoadTimeout: 20000,
|
|
screenshotsFolder: screenshotsFolderName,
|
|
});
|