import { defineConfig } from 'cypress'; let urlHost, reporter, reporterOptions, timeouts; if (process.env.CI) { urlHost = 'front'; reporter = 'junit'; reporterOptions = { mochaFile: 'junit/e2e-[hash].xml', }; timeouts = { defaultCommandTimeout: 1500, requestTimeout: 1500, responseTimeout: 3000, pageLoadTimeout: 3000, }; } else { urlHost = 'localhost'; reporter = 'cypress-mochawesome-reporter'; reporterOptions = { charts: true, reportPageTitle: 'Cypress Inline Reporter', reportFilename: '[status]_[datetime]-report', embeddedScreenshots: true, reportDir: 'test/cypress/reports', inlineAssets: true, }; timeouts = { defaultCommandTimeout: 500, requestTimeout: 500, responseTimeout: 1500, pageLoadTimeout: 3000, }; } export default defineConfig({ e2e: { baseUrl: `http://${urlHost}:9000`, experimentalStudio: false, trashAssetsBeforeRuns: false, defaultBrowser: 'chromium', fixturesFolder: 'test/cypress/fixtures', screenshotsFolder: 'test/cypress/screenshots', supportFile: 'test/cypress/support/index.js', videosFolder: 'test/cypress/videos', downloadsFolder: 'test/cypress/downloads', video: false, specPattern: 'test/cypress/integration/**/*.spec.js', experimentalRunAllSpecs: true, watchForFileChanges: true, reporter, reporterOptions, component: { componentFolder: 'src', testFiles: '**/*.spec.js', supportFile: 'test/cypress/support/unit.js', }, viewportWidth: 1280, viewportHeight: 720, ...timeouts, includeShadowDom: true, waitForAnimations: true, testIsolation: false, }, });