enso/app/ide-desktop/lib/dashboard/playwright-component.config.ts
somebody1234 8597de1d43
Re-organize lib/dashboard/ (#8587)
- Significantly flattens directory structure of `lib/dashboard/`

# Important Notes
- Basic testing done on:
- dashboard's `npm run dev` which (since quite recently) uses Vite.
- specifically: `npm run dev` in `app/ide-desktop/lib/dashboard`, OR `npm run dashboard:dev` in `app/ide-desktop`
- dashboard's bundle script (`npm run build`) which uses ESBuild.
- GUI2's own entry point (GUI2's `npm run dev`).
- `./run ide build`
- `./run ide watch`
- `./run ide2 build`
- `./run gui watch`
2024-01-10 16:22:11 +00:00

48 lines
1.6 KiB
TypeScript

/** @file Playwright component testing configuration. */
import vitePluginYaml from '@modyfi/vite-plugin-yaml'
import * as componentTesting from '@playwright/experimental-ct-react'
// This is an autogenerated file.
/* eslint-disable @typescript-eslint/strict-boolean-expressions, @typescript-eslint/no-magic-numbers */
export default componentTesting.defineConfig({
testDir: './test-component',
snapshotDir: './__snapshots__',
timeout: 10_000,
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
...(process.env.CI ? { workers: 1 } : {}),
projects: [
{
name: 'chromium',
use: { ...componentTesting.devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...componentTesting.devices['Desktop Firefox'] },
},
...(process.env.CI
? []
: [
{
name: 'webkit',
use: { ...componentTesting.devices['Desktop Safari'] },
},
]),
],
use: {
trace: 'on-first-retry',
ctPort: 3100,
ctViteConfig: {
plugins: [vitePluginYaml()],
define: {
// These are constants, and MUST be `CONSTANT_CASE`.
// eslint-disable-next-line @typescript-eslint/naming-convention
['REDIRECT_OVERRIDE']: 'undefined',
// eslint-disable-next-line @typescript-eslint/naming-convention
['process.env.NODE_ENV']: JSON.stringify('production'),
},
},
},
})