-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathcypress.config.ts
More file actions
35 lines (32 loc) · 876 Bytes
/
cypress.config.ts
File metadata and controls
35 lines (32 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'cypress';
import vitePreprocessor from 'cypress-vite';
import fs from 'node:fs/promises';
export default defineConfig({
e2e: {
watchForFileChanges: false,
specPattern: 'cypress/e2e/desktop/*.cy.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:5173',
video: true,
retries: {
openMode: 1,
runMode: 2
},
videosFolder: 'cypress/videos/desktop',
defaultBrowser: 'chrome',
setupNodeEvents: on => {
on('file:preprocessor', vitePreprocessor());
on('after:spec', (_spec, results) => {
if (!results || !results.video) {
return;
}
const failures = results.tests.filter(test =>
test.attempts.some(attempt => attempt.state === 'failed')
);
if (failures) {
return;
}
fs.rm(results.video);
});
}
}
});