2021-11-03 00:45:52 +08:00
|
|
|
require('dotenv').config();
|
2022-08-27 03:13:56 +08:00
|
|
|
const { chromiumConfig, firefoxConfig, webkitConfig } = require('./core/browsersConfig');
|
2023-06-08 10:17:42 +08:00
|
|
|
const { ELEMENT_WAIT_TIME } = require('./core/constants');
|
2021-11-03 00:45:52 +08:00
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
const CI = process.env.CI === 'true';
|
2024-05-15 05:13:32 +08:00
|
|
|
const isParallel = !!process.env.npm_config_parallel;
|
2022-06-08 02:52:22 +08:00
|
|
|
|
2021-11-03 00:45:52 +08:00
|
|
|
const config = {
|
2022-12-15 02:30:19 +08:00
|
|
|
workers: CI ? 1 : 2,
|
2021-12-23 03:06:42 +08:00
|
|
|
timeout: 3 * 60 * 1000,
|
2023-08-29 00:40:49 +08:00
|
|
|
reporter: CI
|
2024-07-18 09:19:39 +08:00
|
|
|
? [['blob'], ['./custom-reporter.js']]
|
2023-08-29 00:40:49 +08:00
|
|
|
: [['list'], ['html', { open: 'never' }],
|
2022-06-08 02:52:22 +08:00
|
|
|
],
|
2024-07-12 00:55:13 +08:00
|
|
|
reportSlowTests: null,
|
2022-07-14 04:02:15 +08:00
|
|
|
forbidOnly: CI,
|
2024-05-15 05:13:32 +08:00
|
|
|
fullyParallel: CI || isParallel,
|
2021-11-23 01:06:59 +08:00
|
|
|
use: {
|
|
|
|
headless: true,
|
2024-03-06 02:57:16 +08:00
|
|
|
trace: 'on',
|
2022-07-14 04:02:15 +08:00
|
|
|
screenshot: 'on',
|
2024-05-15 23:07:15 +08:00
|
|
|
video: CI ? 'retain-on-failure' : 'on',
|
2021-11-23 01:06:59 +08:00
|
|
|
},
|
2021-12-01 01:13:43 +08:00
|
|
|
projects: [
|
2022-08-27 03:13:56 +08:00
|
|
|
chromiumConfig,
|
|
|
|
firefoxConfig,
|
|
|
|
webkitConfig,
|
2021-12-01 01:13:43 +08:00
|
|
|
],
|
2023-06-08 10:17:42 +08:00
|
|
|
expect: {
|
|
|
|
timeout: ELEMENT_WAIT_TIME,
|
|
|
|
toMatchSnapshot: {
|
2023-06-09 03:56:52 +08:00
|
|
|
maxDiffPixelRatio: 0.05,
|
2024-06-07 03:15:36 +08:00
|
|
|
timeout: ELEMENT_WAIT_TIME,
|
2023-06-08 10:17:42 +08:00
|
|
|
},
|
2023-06-09 04:48:18 +08:00
|
|
|
toHaveScreenshot: {
|
|
|
|
maxDiffPixelRatio: 0.05,
|
2024-06-07 03:15:36 +08:00
|
|
|
timeout: ELEMENT_WAIT_TIME,
|
2023-06-09 04:48:18 +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;
|