salix-front/cypress.config.js

85 lines
2.5 KiB
JavaScript
Raw Normal View History

2025-01-22 09:57:59 +00:00
import { defineConfig } from 'cypress';
let urlHost, reporter, reporterOptions, timeouts;
if (process.env.CI) {
urlHost = 'front';
reporter = 'mocha-multi-reporters';
reporterOptions = {
reporterEnabled: 'mocha-junit-reporter, mochawesome',
mochaJunitReporterReporterOptions: {
mochaFile: 'junit/e2e-[hash].xml',
},
mochawesomeReporterOptions: {
reportDir: 'test/cypress/results',
overwrite: false,
html: false,
json: false,
},
};
timeouts = {
defaultCommandTimeout: 30000,
requestTimeout: 30000,
responseTimeout: 60000,
pageLoadTimeout: 60000,
};
} 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: 10000,
requestTimeout: 10000,
responseTimeout: 30000,
pageLoadTimeout: 60000,
};
}
2022-12-20 13:59:53 +00:00
2025-01-22 09:57:59 +00:00
export default defineConfig({
2022-12-21 08:19:29 +00:00
e2e: {
baseUrl: `http://${urlHost}:9000`,
experimentalStudio: false,
trashAssetsBeforeRuns: false,
2025-02-26 09:30:17 +00:00
defaultBrowser: 'chromium',
2023-01-03 13:17:22 +00:00
fixturesFolder: 'test/cypress/fixtures',
screenshotsFolder: 'test/cypress/screenshots',
supportFile: 'test/cypress/support/index.js',
videosFolder: 'test/cypress/videos',
2025-02-18 13:20:31 +00:00
downloadsFolder: 'test/cypress/downloads',
video: false,
2025-02-19 09:19:41 +00:00
specPattern: 'test/cypress/integration/**/*.spec.js',
2025-02-26 09:30:17 +00:00
experimentalRunAllSpecs: true,
watchForFileChanges: true,
reporter,
reporterOptions,
2022-12-21 08:19:29 +00:00
component: {
componentFolder: 'src',
testFiles: '**/*.spec.js',
2023-01-03 13:17:22 +00:00
supportFile: 'test/cypress/support/unit.js',
},
2025-01-21 09:48:04 +00:00
viewportWidth: 1280,
viewportHeight: 720,
...timeouts,
// setupNodeEvents(on, config) {
// process.env.NODE_OPTIONS = '--loader ts-node/esm';
// return config;
// },
includeShadowDom: true,
waitForAnimations: true,
2025-02-28 06:28:02 +00:00
// setupNodeEvents(on, config) {
// on('before:browser:launch', (browser = {}, launchOptions) => {
// launchOptions.args.push('--disable-gpu');
// return launchOptions;
// });
// },
2022-12-20 13:59:53 +00:00
},
});