chore(e2e): merge .env in playwright config + add retry

This commit is contained in:
Elian Doran 2025-09-03 09:02:10 +03:00
parent f63f24ac9d
commit 7db3bde933
No known key found for this signature in database
2 changed files with 5 additions and 9 deletions

View File

@ -1,3 +0,0 @@
TRILIUM_INTEGRATION_TEST=memory
TRILIUM_PORT=8082
TRILIUM_DATA_DIR=spec/db

View File

@ -1,12 +1,8 @@
import { defineConfig, devices } from '@playwright/test';
import { join } from 'path';
require('dotenv').config({
path: __dirname + "/" + ".env"
});
// For CI, you may want to set BASE_URL to the deployed application.
const port = process.env['TRILIUM_PORT'];
const port = process.env['TRILIUM_PORT'] ?? "8082";
const baseURL = process.env['BASE_URL'] || `http://127.0.0.1:${port}`;
/**
@ -16,6 +12,7 @@ export default defineConfig({
testDir: "src",
reporter: [["list"], ["html", { outputFolder: "test-output" }]],
outputDir: "test-output",
retries: 3,
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
@ -31,7 +28,9 @@ export default defineConfig({
reuseExistingServer: !process.env.CI,
cwd: join(__dirname, "../server"),
env: {
TRILIUM_DATA_DIR: "spec/db"
TRILIUM_DATA_DIR: "spec/db",
TRILIUM_PORT: port,
TRILIUM_INTEGRATION_TEST: "memory"
},
timeout: 5 * 60 * 1000
} : undefined,