Files
k8s-game-2048/playwright.config.ts
greg aeccfa3717 feat: add comprehensive Playwright testing suite with visual regression
- Add Playwright configuration with multi-browser testing
- Create basic functionality tests for game mechanics
- Add gameplay tests with keyboard and touch interactions
- Implement visual regression testing with screenshots
- Add environment-specific tests for dev/staging/prod
- Include health endpoint and security header validation
- Set up test infrastructure for CI/CD pipeline
2025-06-30 20:51:05 -07:00

50 lines
1.1 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [
['html'],
['json', { outputFile: 'test-results.json' }],
['junit', { outputFile: 'test-results.xml' }]
],
use: {
baseURL: process.env.BASE_URL || 'http://localhost:8080',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
{
name: 'mobile-chrome',
use: { ...devices['Pixel 5'] },
},
{
name: 'mobile-safari',
use: { ...devices['iPhone 12'] },
},
],
webServer: process.env.CI ? undefined : {
command: 'npm start',
port: 8080,
reuseExistingServer: !process.env.CI,
},
});