2021-11-03 00:45:52 +08:00
|
|
|
require('dotenv').config();
|
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
const CI = process.env.CI === 'true';
|
|
|
|
const DEBUG_MODE = process.env.DEBUG_MODE === 'true';
|
|
|
|
|
2021-11-03 00:45:52 +08:00
|
|
|
const config = {
|
2022-07-14 04:02:15 +08:00
|
|
|
workers: 2,
|
2021-12-23 03:06:42 +08:00
|
|
|
timeout: 3 * 60 * 1000,
|
2022-06-08 02:52:22 +08:00
|
|
|
reporter: [
|
|
|
|
[CI ? 'github' : 'list'],
|
|
|
|
['html', { open: 'never' }],
|
|
|
|
],
|
2022-07-14 04:02:15 +08:00
|
|
|
forbidOnly: CI,
|
2021-11-23 01:06:59 +08:00
|
|
|
use: {
|
|
|
|
headless: true,
|
2022-07-14 04:02:15 +08:00
|
|
|
trace: DEBUG_MODE ? 'on'
|
|
|
|
: CI ? 'retain-on-failure'
|
|
|
|
: 'off',
|
|
|
|
screenshot: 'on',
|
|
|
|
video: 'on',
|
2021-11-23 01:06:59 +08:00
|
|
|
},
|
2021-12-01 01:13:43 +08:00
|
|
|
projects: [
|
|
|
|
{
|
|
|
|
name: 'Chromium',
|
|
|
|
use: {
|
|
|
|
browserName: 'chromium',
|
|
|
|
launchOptions: {
|
|
|
|
args: [
|
|
|
|
'--no-sandbox',
|
2022-04-25 20:11:57 +08:00
|
|
|
'--ignore-certificate-errors',
|
2021-12-01 01:13:43 +08:00
|
|
|
'--use-fake-ui-for-media-stream',
|
|
|
|
'--use-fake-device-for-media-stream',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-02-18 19:41:44 +08:00
|
|
|
{
|
|
|
|
name: 'Firefox',
|
|
|
|
use: {
|
|
|
|
browserName: 'firefox',
|
|
|
|
launchOptions: {
|
2022-03-08 02:56:08 +08:00
|
|
|
firefoxUserPrefs: {
|
|
|
|
"media.navigator.streams.fake": true,
|
|
|
|
"media.navigator.permission.disabled": true,
|
|
|
|
}
|
2022-02-18 19:41:44 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'WebKit',
|
|
|
|
use: {
|
|
|
|
browserName: 'webkit',
|
|
|
|
launchOptions: {
|
|
|
|
args: [
|
|
|
|
'--no-sandbox',
|
|
|
|
'--use-fake-ui-for-media-stream',
|
|
|
|
'--use-fake-device-for-media-stream',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-01 01:13:43 +08:00
|
|
|
],
|
2021-11-03 00:45:52 +08:00
|
|
|
};
|
2021-11-23 01:06:59 +08:00
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
if (CI) config.retries = 1;
|
|
|
|
|
2021-11-03 06:50:20 +08:00
|
|
|
module.exports = config;
|