diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 0000000..5cba965 --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,46 @@ +// @ts-check +const { defineConfig, devices } = require('@playwright/test'); + +/** + * @see https://playwright.dev/docs/test-configuration + */ +module.exports = defineConfig({ + testDir: './tests', + timeout: 30 * 1000, + expect: { + timeout: 5000 + }, + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + reporter: 'html', + + use: { + actionTimeout: 0, + trace: 'on-first-retry', + baseURL: 'http://localhost:8080', + screenshot: 'only-on-failure', + }, + + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + }, + ], + + webServer: { + command: 'node tests/serve.js', + port: 8080, + reuseExistingServer: true, + }, +}); \ No newline at end of file