58 lines
1.7 KiB
JavaScript
58 lines
1.7 KiB
JavaScript
import { defineConfig } from 'cypress';
|
|
|
|
let urlHost, reporter, reporterOptions;
|
|
|
|
if (process.env.CI) {
|
|
urlHost = 'front';
|
|
reporter = 'junit';
|
|
reporterOptions = {
|
|
mochaFile: 'junit/e2e-[hash].xml',
|
|
toConsole: false,
|
|
};
|
|
} 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,
|
|
};
|
|
}
|
|
|
|
export default defineConfig({
|
|
e2e: {
|
|
baseUrl: `http://${urlHost}:9000`,
|
|
experimentalStudio: false,
|
|
defaultCommandTimeout: 10000,
|
|
trashAssetsBeforeRuns: false,
|
|
requestTimeout: 10000,
|
|
responseTimeout: 30000,
|
|
pageLoadTimeout: 60000,
|
|
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,
|
|
},
|
|
experimentalMemoryManagement: true,
|
|
defaultCommandTimeout: 10000,
|
|
numTestsKeptInMemory: 2,
|
|
});
|