- Introduce `USE_ANONYMOUS_AUTH_SESSIONS` to make guest access an opt-in feature. - Transition root-level pages into `(app)` and `(public)` route groups for improved access control. - Adopt Figtree as the primary typeface and implement a pre-render theme initialization script. - Decouple audiobook chapter processing into a standalone API route and harden resource ownership logic. - Replace the legacy footer with a unified layout and add skeleton loading states for document lists. - Update environment documentation and test suites to align with the revised routing and auth flows. BREAKING CHANGE: The audiobook generation API has been restructured, moving specific chapter logic to `/api/audiobook/chapter`.
85 lines
2.4 KiB
TypeScript
85 lines
2.4 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
/**
|
|
* See https://playwright.dev/docs/test-configuration.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: './tests',
|
|
timeout: 30 * 1000,
|
|
outputDir: './tests/results',
|
|
globalTeardown: './tests/global-teardown.ts',
|
|
// fullyParallel: false,
|
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
// workers: '50%',
|
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
reporter: 'html',
|
|
/* 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: 'http://localhost:3003',
|
|
|
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
trace: 'retain-on-first-failure',
|
|
screenshot: 'only-on-failure',
|
|
},
|
|
|
|
/* Run your local dev server before starting the tests */
|
|
webServer: {
|
|
// Disable auth rate limiting for tests to support parallel workers creating sessions
|
|
command: `npm run build && DISABLE_AUTH_RATE_LIMIT=true npm run start`,
|
|
url: 'http://localhost:3003',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120 * 1000,
|
|
},
|
|
|
|
/* Configure projects for major browsers */
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
extraHTTPHeaders: { 'x-openreader-test-namespace': 'chromium' },
|
|
},
|
|
},
|
|
|
|
{
|
|
name: 'firefox',
|
|
testIgnore: '**/unit/**',
|
|
use: {
|
|
...devices['Desktop Firefox'],
|
|
extraHTTPHeaders: { 'x-openreader-test-namespace': 'firefox' },
|
|
},
|
|
},
|
|
|
|
{
|
|
name: 'webkit',
|
|
testIgnore: '**/unit/**',
|
|
use: {
|
|
...devices['Desktop Safari'],
|
|
extraHTTPHeaders: { 'x-openreader-test-namespace': 'webkit' },
|
|
},
|
|
},
|
|
|
|
/* Test against mobile viewports. */
|
|
// {
|
|
// name: 'Mobile Chrome',
|
|
// use: { ...devices['Pixel 5'] },
|
|
// },
|
|
// {
|
|
// name: 'Mobile Safari',
|
|
// use: { ...devices['iPhone 12'] },
|
|
// },
|
|
|
|
/* Test against branded browsers. */
|
|
// {
|
|
// name: 'Microsoft Edge',
|
|
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
// },
|
|
// {
|
|
// name: 'Google Chrome',
|
|
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
// },
|
|
],
|
|
});
|