Files
tilbudgivern/tests/playwright.config.js
T
alexpolo1 faaf9500f5 feat: Add API test HTML page and update server check documentation
- Created a new HTML page for testing the Tømmer Opgaver API with buttons for various endpoints.
- Added a LICENSE file for React and related libraries in the frontend build.
- Documented a complete server check report, detailing fixes, test results, and server status.
- Added sample test data for quotes, including project details, geometry, labor, materials, and calculations.
2025-11-07 08:44:35 +00:00

68 lines
2.0 KiB
JavaScript

// @ts-check
const { defineConfig, devices } = require('@playwright/test');
/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: './',
/* 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: 'https://tilbudsgiveren.alw.dk',
/* 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'] },
}
],
/* 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
});