-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathcypress.config.ts
More file actions
52 lines (47 loc) · 1.39 KB
/
cypress.config.ts
File metadata and controls
52 lines (47 loc) · 1.39 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from 'cypress';
import * as fs from 'fs';
const getFiles = (path: string) => {
return fs.readdirSync(path);
};
const removeFile = (path: string) => {
return fs.rmSync(path);
};
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
supportFile: 'cypress/support/index.ts',
experimentalStudio: true,
retries: process.env.CI ? 2 : 0,
setupNodeEvents(on) {
on('task', {
getFileContent({
directory,
pattern,
}: {
directory: string;
pattern: string | RegExp;
}) {
const file = getFiles('cypress/downloads').find((file) =>
file.match(pattern),
);
const path = `${directory}/${file}`;
if (!file) {
return null;
}
const content = fs.readFileSync(path, 'utf8');
removeFile(path);
return content;
},
});
},
},
viewportWidth: 1920,
viewportHeight: 1080,
video: false,
defaultCommandTimeout: 30000,
execTimeout: 60000,
taskTimeout: 60000,
pageLoadTimeout: 60000,
requestTimeout: 30000,
responseTimeout: 30000,
});