-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.js
More file actions
47 lines (41 loc) · 1.02 KB
/
Copy pathcypress.config.js
File metadata and controls
47 lines (41 loc) · 1.02 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
const { defineConfig } = require('cypress')
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:80/wordpress',
viewportWidth: 1280,
viewportHeight: 720,
video: true,
screenshotOnRunFailure: true,
defaultCommandTimeout: 10000,
requestTimeout: 10000,
responseTimeout: 30000,
// 支持并发测试配置
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
// 可以在这里添加插件事件
return config
},
},
// 环境变量配置
env: {
wpAdminUrl: 'http://localhost:80/wordpress/wp-admin',
wpLoginUrl: 'http://localhost:80/wordpress/wp-login.php',
// 配置多个测试用户
users: (() => {
const users = {
admin: {
username: 'mangp',
password: '123456'
}
};
// 动态生成100个用户配置
for (let i = 1; i <= 100; i++) {
users[`user${i}`] = {
username: `user${i}`,
password: '123456'
};
}
return users;
})()
}
})