-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathcypress.config.js
More file actions
65 lines (61 loc) · 1.5 KB
/
cypress.config.js
File metadata and controls
65 lines (61 loc) · 1.5 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
53
54
55
56
57
58
59
60
61
62
63
64
65
const { defineConfig } = require('cypress');
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:5173',
supportFile: 'tests/e2e/support/e2e.js',
specPattern: 'tests/e2e/**/*.cy.{js,jsx,ts,tsx}',
viewportWidth: 1280,
viewportHeight: 720,
video: true,
screenshotOnRunFailure: true,
screenshot: 'only-on-failure',
videoUploadOnPasses: false,
trashAssetsBeforeRuns: true,
defaultCommandTimeout: 10000,
requestTimeout: 10000,
responseTimeout: 10000,
pageLoadTimeout: 30000,
execTimeout: 60000,
taskTimeout: 60000,
retries: {
runMode: 2,
openMode: 0
},
env: {
// Environment variables
apiUrl: 'http://localhost:3000/api',
// Test credentials
testUser: {
email: 'test@example.com',
password: 'Test123!@#',
firstName: 'Test',
lastName: 'User'
}
},
setupNodeEvents(on, config) {
// Implement node event listeners here
on('task', {
// Custom tasks for database cleanup, etc.
clearDatabase() {
// Implementation for clearing test data
return null;
},
seedDatabase() {
// Implementation for seeding test data
return null;
},
log(message) {
console.log(message);
return null;
}
});
return config;
}
},
component: {
devServer: {
framework: 'create-react-app',
port: 3000
}
}
});