2024-04-29 14:32:14 +08:00
|
|
|
import { defineConfig } from 'cypress';
|
2024-06-03 11:20:45 +08:00
|
|
|
import registerCodeCoverageTasks from '@cypress/code-coverage/task';
|
2024-04-29 14:32:14 +08:00
|
|
|
|
2024-09-21 10:39:09 +08:00
|
|
|
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';
|
|
|
|
|
2024-04-29 14:32:14 +08:00
|
|
|
export default defineConfig({
|
2024-06-03 11:20:45 +08:00
|
|
|
env: {
|
|
|
|
codeCoverage: {
|
|
|
|
exclude: ['cypress/**/*.*', '**/__tests__/**/*.*', '**/*.test.*'],
|
|
|
|
},
|
|
|
|
},
|
2024-10-03 13:54:42 +08:00
|
|
|
watchForFileChanges: false,
|
2024-04-29 14:32:14 +08:00
|
|
|
component: {
|
|
|
|
devServer: {
|
|
|
|
framework: 'react',
|
|
|
|
bundler: 'vite',
|
|
|
|
},
|
2024-09-21 10:39:09 +08:00
|
|
|
setupNodeEvents (on, config) {
|
2024-06-03 11:20:45 +08:00
|
|
|
registerCodeCoverageTasks(on, config);
|
2024-09-21 10:39:09 +08:00
|
|
|
addMatchImageSnapshotPlugin(on, config);
|
2024-06-03 11:20:45 +08:00
|
|
|
return config;
|
|
|
|
},
|
|
|
|
supportFile: 'cypress/support/component.ts',
|
2024-04-29 14:32:14 +08:00
|
|
|
},
|
|
|
|
retries: {
|
|
|
|
// Configure retry attempts for `cypress run`
|
|
|
|
// Default is 0
|
2024-11-04 14:14:16 +08:00
|
|
|
runMode: 10,
|
2024-04-29 14:32:14 +08:00
|
|
|
// Configure retry attempts for `cypress open`
|
|
|
|
// Default is 0
|
|
|
|
openMode: 0,
|
|
|
|
},
|
|
|
|
});
|