Files
tilbudgivern/tests/playwright.config.js
alexpolo1 c4af45924c feat: Kør alle UI tests mod production environment
 Production Testing Setup
- Ændret Playwright baseURL til https://tilbudsgiveren.alw.dk
- Ændret Selenium baseURL til production
- Alle 14 UI tests kører nu mod live miljø
- Test resultater: 14/14 PASSED (100%)

🎯 Test Coverage på Production
✓ FormField validation virker i prod
✓ LoadingSpinner vises korrekt
✓ Autosave fungerer på live site
✓ Tooltips virker
✓ Performance < 3 sekunder
✓ Accessibility features fungerer
✓ ARIA labels korrekt implementeret
✓ Keyboard navigation virker

🔧 Nye Scripts
- test:pw - Kør Playwright mod production (default)
- test:pw:local - Kør mod localhost hvis nødvendigt
- test:selenium - Kør Selenium mod production
- test:selenium:local - Kør Selenium mod localhost

Nu tester vi samme miljø som kunderne bruger! 🚀
2025-12-22 23:21:26 +00:00

82 lines
2.4 KiB
JavaScript

// @ts-check
const { defineConfig, devices } = require('@playwright/test');
/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: './',
testMatch: /.*\.spec\.(js|ts)$/,
testIgnore: ['**/selenium-ui.test.js', '**/selenium/**'],
/* Run tests in files in parallel */
fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html'],
['list']
],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'https://tilbudsgiveren.alw.dk',
/* Run in headless mode */
headless: true,
/* Use system Chrome/Chromium for CachyOS compatibility */
channel: 'chromium',
/* Extra headers to send with requests */
extraHTTPHeaders: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
},
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
/* Take screenshot on failure */
screenshot: 'only-on-failure',
/* Capture video on failure */
video: 'retain-on-failure',
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 30000,
/* Maximum time each assertion such as `expect(locator).toBeVisible()` can take. */
expect: {
timeout: 15000
}
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Use system Chromium on CachyOS
launchOptions: {
executablePath: '/snap/bin/chromium'
}
},
}
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:4031',
// reuseExistingServer: !process.env.CI,
// },
/* Global setup and teardown */
globalTimeout: 300000, // 5 minutes for all tests
timeout: 60000 // 1 minute per test
});