mirror of
https://github.com/ghndrx/k8s-game-2048.git
synced 2026-02-10 06:45:07 +00:00
- 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
50 lines
1.1 KiB
TypeScript
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,
|
|
},
|
|
});
|