Files
Trilium/apps/server-e2e/playwright.config.ts

45 lines
1.3 KiB
TypeScript
Raw Permalink Normal View History

import { defineConfig, devices } from '@playwright/test';
2025-09-02 19:00:49 +03:00
import { join } from 'path';
// For CI, you may want to set BASE_URL to the deployed application.
const port = process.env['TRILIUM_PORT'] ?? "8082";
const baseURL = process.env['BASE_URL'] || `http://127.0.0.1:${port}`;
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
2025-09-02 19:00:49 +03:00
testDir: "src",
reporter: [["list"], ["html", { outputFolder: "test-output" }]],
outputDir: "test-output",
retries: 3,
2025-09-02 19:00:49 +03:00
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
2025-09-02 19:00:49 +03:00
/* Run your local dev server before starting the tests */
webServer: !process.env.TRILIUM_DOCKER ? {
2025-09-02 21:45:59 +03:00
command: 'pnpm start-prod-no-dir',
2025-04-28 22:58:00 +03:00
url: baseURL,
reuseExistingServer: !process.env.CI,
2025-09-02 19:00:49 +03:00
cwd: join(__dirname, "../server"),
2025-09-02 21:06:41 +03:00
env: {
TRILIUM_DATA_DIR: "spec/db",
TRILIUM_PORT: port,
TRILIUM_INTEGRATION_TEST: "memory"
2025-09-02 21:06:41 +03:00
},
timeout: 5 * 60 * 1000
} : undefined,
2025-09-02 19:00:49 +03:00
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
2025-09-02 19:00:49 +03:00
}
]
});