2025-04-05 21:25:21 -07:00
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See https://playwright.dev/docs/test-configuration.
|
|
|
|
|
*/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
testDir: './e2e',
|
|
|
|
|
/* Run tests in files in parallel */
|
2026-05-12 21:13:10 -07:00
|
|
|
fullyParallel: true,
|
2025-04-05 21:25:21 -07:00
|
|
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
2026-01-19 15:19:10 -08:00
|
|
|
reporter: 'line',
|
2025-04-05 21:25:21 -07:00
|
|
|
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
|
|
|
use: {
|
|
|
|
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
|
|
|
trace: 'on-first-retry',
|
2026-01-18 22:17:02 -08:00
|
|
|
|
|
|
|
|
animations: 'disabled',
|
|
|
|
|
colorScheme: 'light',
|
2026-01-19 15:19:10 -08:00
|
|
|
|
|
|
|
|
launchOptions: {
|
2026-05-12 21:13:10 -07:00
|
|
|
executablePath: process.env.PLAYWRIGHT_CHROMIUM_PATH,
|
2026-01-19 15:19:10 -08:00
|
|
|
},
|
2026-01-18 22:17:02 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
expect: {
|
|
|
|
|
toHaveScreenshot: {
|
|
|
|
|
maxDiffPixels: 50,
|
|
|
|
|
},
|
2025-04-05 21:25:21 -07:00
|
|
|
},
|
|
|
|
|
|
2026-05-12 21:13:10 -07:00
|
|
|
/* Configure projects for Chrome */
|
2025-04-05 21:25:21 -07:00
|
|
|
projects: [
|
|
|
|
|
{
|
2026-01-18 22:16:48 -08:00
|
|
|
name: 'chromium',
|
|
|
|
|
use: { ...devices['Desktop Chrome'] },
|
2025-04-05 21:25:21 -07:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
/* Run your local dev server before starting the tests */
|
2026-05-12 21:13:10 -07:00
|
|
|
webServer: {
|
|
|
|
|
command: `python3 -m http.server 8081 --directory ${process.env.blogWithRelativeLinks}`,
|
|
|
|
|
url: 'http://localhost:8081',
|
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
|
}
|
2025-04-05 21:25:21 -07:00
|
|
|
});
|