Files
gridpilot.gg/playwright.api.config.ts
2026-01-08 21:36:15 +01:00

45 lines
1.1 KiB
TypeScript

import { defineConfig } from '@playwright/test';
/**
* Playwright configuration for API smoke tests
*
* Purpose: Test API endpoints directly without browser interaction
* Scope: HTTP requests to API server, response validation, error handling
*/
export default defineConfig({
testDir: './tests/e2e/api',
testMatch: ['**/api-smoke.test.ts'],
// Setup for authentication
globalSetup: './tests/e2e/api/api-auth.setup.ts',
// Serial execution for consistent results
fullyParallel: false,
workers: 1,
// Timeout: API calls should be fast
timeout: 30_000,
// Base URL for the API
use: {
baseURL: process.env.API_BASE_URL || 'http://localhost:3101',
// No default storage state - tests will specify which auth to use
storageState: undefined,
},
// Reporter: verbose for debugging
reporter: [
['list'],
['html', { open: 'never' }]
],
// No retry - tests must pass on first run
retries: 0,
// No webServer - API should be running externally
webServer: undefined,
// No browser projects needed for API tests
projects: [],
});