mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const { defineConfig } = require("cypress");
 | |
| const fs = require("fs-extra");
 | |
| const path = require("path");
 | |
| 
 | |
| 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`;
 | |
| 
 | |
| module.exports = defineConfig({
 | |
|   e2e: {
 | |
|     setupNodeEvents(on, config) {
 | |
|       require("cypress-mochawesome-reporter/plugin")(on);
 | |
| 
 | |
|       on("task", {
 | |
|         setGlobalState: (val) => {
 | |
|           return (globalState = val || {});
 | |
|         },
 | |
|         getGlobalState: () => {
 | |
|           return globalState || {};
 | |
|         },
 | |
|         cli_log: (message) => {
 | |
|           console.log("Logging console message from task");
 | |
|           console.log(message);
 | |
|           return null;
 | |
|         },
 | |
|       });
 | |
|     },
 | |
|     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,
 | |
| });
 | 
