chore(pages): 🔧 Update 15 TypeScript files in pages directory

This commit is contained in:
Lilith 2026-01-18 09:20:36 -08:00
parent 66b9e28417
commit e1acb255ba
15 changed files with 64 additions and 95 deletions

View file

View file

View file

View file

View file

View file

@ -1,81 +1,51 @@
import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E Test Configuration
*
* Uses @lilith/playwright-e2e-docker config factory for consistency.
* For local development with Vite dev server.
*
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
import { createPlaywrightConfig } from '@lilith/playwright-e2e-docker'
export default createPlaywrightConfig({
// Test configuration
testDir: './e2e',
testMatch: ['**/tests/**/*.spec.ts', '**/integration/**/*.spec.ts'],
appName: 'conversation-assistant',
// Run tests in files in parallel
// Timeouts
timeout: 60000,
expectTimeout: 10000,
actionTimeout: 10000,
navigationTimeout: 30000,
// Parallel execution for local dev
fullyParallel: true,
// 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
reporter: process.env.CI
? [['html'], ['github']]
: [['list'], ['html', { open: 'never' }]],
// Retries
retries: process.env.CI ? 2 : 0,
// Shared settings for all the projects below
use: {
// Base URL to use in actions like `await page.goto('/')`
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
// Device preset - all browsers for local dev
devicePreset: 'all',
// Collect trace when retrying the failed test
trace: 'on-first-retry',
// Base URL
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
// Screenshot on failure
screenshot: 'only-on-failure',
// Video on failure
video: 'retain-on-failure',
// Maximum time each action can take
actionTimeout: 10 * 1000,
},
// Configure projects for major browsers
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
// Mobile viewports (optional, commented out by default)
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
],
// Run your local dev server before starting the tests
// Local dev server
webServer: {
command: 'pnpm dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
},
});
// Recording
video: 'retain-on-failure',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
// Output directory
outputDir: './test-results',
})

View file

@ -1,47 +1,46 @@
import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E Integration Test Configuration for Docker
*
* Simplified config without @lilith/playwright-e2e-docker package
* to ensure tests are found in Docker environment.
* Uses @lilith/playwright-e2e-docker config factory for consistency.
* This config is used when running tests in Docker containers.
*
* Usage:
* docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit
*/
export default defineConfig({
import { createPlaywrightConfig } from '@lilith/playwright-e2e-docker'
export default createPlaywrightConfig({
// Test configuration
testDir: './e2e/integration',
// Default test file pattern
testMatch: '**/*.spec.ts',
appName: 'conversation-assistant',
// Base URL from environment (set by Docker)
use: {
baseURL: process.env.BASE_URL || 'http://localhost:5173',
trace: 'on-first-retry',
video: 'retain-on-failure',
screenshot: 'only-on-failure',
},
// Timeouts
// Timeouts (Docker environments may need longer timeouts)
timeout: 60000,
expect: {
timeout: 15000,
},
expectTimeout: 15000,
actionTimeout: 15000,
navigationTimeout: 30000,
// Run sequentially for database isolation
// Sequential execution for database state consistency
fullyParallel: false,
workers: 1,
// Retries in CI
retries: process.env.CI ? 2 : 0,
// Retries
retries: 2,
// Output
// Device preset - chromium only for Docker
devicePreset: 'chromium-only',
// Base URL - uses Docker service name
baseURL: process.env.BASE_URL || 'http://frontend-dev:5173',
// No webServer config - services are managed by docker-compose
// Recording
video: 'retain-on-failure',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
// Output directory
outputDir: './test-results/artifacts',
reporter: [['list'], ['html', { outputFolder: './test-results/report' }]],
// Use chromium only for integration tests in Docker
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});
})

View file

View file

View file