2023-10-11 13:24:33 +03:00
|
|
|
/** @file Playwright browser testing configuration. */
|
|
|
|
/** Note that running Playwright in CI poses a number of issues:
|
|
|
|
* - `backdrop-filter: blur` is disabled, due to issues with Chromium's `--disable-gpu` flag
|
|
|
|
* (see below).
|
|
|
|
* - System validation dialogs are not reliable between computers, as they may have different
|
|
|
|
* default fonts. */
|
|
|
|
import * as test from '@playwright/test'
|
|
|
|
|
2024-04-29 10:27:00 +03:00
|
|
|
import * as appConfig from 'enso-common/src/appConfig'
|
|
|
|
|
|
|
|
appConfig.loadTestEnvironmentVariables()
|
|
|
|
|
2023-10-11 13:24:33 +03:00
|
|
|
/* eslint-disable @typescript-eslint/no-magic-numbers, @typescript-eslint/strict-boolean-expressions */
|
|
|
|
|
|
|
|
export default test.defineConfig({
|
2024-01-31 14:35:41 +03:00
|
|
|
testDir: './e2e',
|
|
|
|
fullyParallel: true,
|
|
|
|
forbidOnly: true,
|
2024-06-12 13:20:07 +03:00
|
|
|
workers: process.env.PROD ? 8 : 1,
|
2024-02-13 14:43:56 +03:00
|
|
|
repeatEach: process.env.CI ? 3 : 1,
|
2024-01-23 00:26:15 +03:00
|
|
|
expect: {
|
|
|
|
toHaveScreenshot: { threshold: 0 },
|
2024-02-06 18:52:03 +03:00
|
|
|
timeout: 30_000,
|
2024-01-23 00:26:15 +03:00
|
|
|
},
|
2024-02-19 14:47:48 +03:00
|
|
|
timeout: 30_000,
|
2024-03-05 10:06:11 +03:00
|
|
|
reporter: 'html',
|
2024-01-23 00:26:15 +03:00
|
|
|
use: {
|
|
|
|
baseURL: 'http://localhost:8080',
|
2024-03-05 10:06:11 +03:00
|
|
|
trace: 'retain-on-failure',
|
2024-01-23 00:26:15 +03:00
|
|
|
launchOptions: {
|
|
|
|
ignoreDefaultArgs: ['--headless'],
|
|
|
|
args: [
|
|
|
|
// Much closer to headful Chromium than classic headless.
|
|
|
|
'--headless=new',
|
|
|
|
// Required for `backdrop-filter: blur` to work.
|
|
|
|
'--use-angle=swiftshader',
|
|
|
|
// FIXME: `--disable-gpu` disables `backdrop-filter: blur`, which is not handled by
|
|
|
|
// the software (CPU) compositor. This SHOULD be fixed eventually, but this flag
|
|
|
|
// MUST stay as CI does not have a GPU.
|
|
|
|
'--disable-gpu',
|
|
|
|
// Fully disable GPU process.
|
|
|
|
'--disable-software-rasterizer',
|
|
|
|
// Disable text subpixel antialiasing.
|
|
|
|
'--font-render-hinting=none',
|
|
|
|
'--disable-skia-runtime-opts',
|
|
|
|
'--disable-system-font-check',
|
|
|
|
'--disable-font-subpixel-positioning',
|
|
|
|
'--disable-lcd-text',
|
|
|
|
],
|
2023-10-11 13:24:33 +03:00
|
|
|
},
|
2024-01-23 00:26:15 +03:00
|
|
|
},
|
|
|
|
webServer: {
|
2024-06-12 13:20:07 +03:00
|
|
|
command: process.env.CI || process.env.PROD ? 'npm run dev:e2e:ci' : 'npm run dev:e2e',
|
2024-01-23 00:26:15 +03:00
|
|
|
port: 8080,
|
|
|
|
reuseExistingServer: false,
|
|
|
|
},
|
2023-10-11 13:24:33 +03:00
|
|
|
})
|