Skip to content

Build your personal knowledge base with Trilium Notes

chore(server-e2e): allow starting via VS Code

Elian Dorana08341890609
diff --git a/_regroup/playwright.config.ts b/_regroup/playwright.config.ts
deleted file mode 100644
index f5ac29541d..0000000000
--- a/_regroup/playwright.config.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { defineConfig, devices } from "@playwright/test";
-
-const SERVER_URL = "http://127.0.0.1:8082";
-
-/**
- * Read environment variables from file.
- * https://github.com/motdotla/dotenv
- */
-// import dotenv from 'dotenv';
-// import path from 'path';
-// dotenv.config({ path: path.resolve(__dirname, '.env') });
-
-/**
- * See https://playwright.dev/docs/test-configuration.
- */
-export default defineConfig({
- testDir: "./e2e",
- /* Run tests in files in parallel */
- 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. 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: {
- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
- trace: "on-first-retry"
- },
-
- /* Configure projects for major browsers */
- projects: [
- {
- name: "chromium",
- use: { ...devices["Desktop Chrome"] }
- }
-
- // {
- // name: 'firefox',
- // use: { ...devices['Desktop Firefox'] },
- // },
-
- // {
- // name: 'webkit',
- // use: { ...devices['Desktop Safari'] },
- // },
-
- /* 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' },
- // },
- ],
-
- /* Run your local dev server before starting the tests */
- webServer: !process.env.TRILIUM_DOCKER
- ? {
- command: "npm run test:integration-mem-db-dev",
- url: SERVER_URL,
- reuseExistingServer: !process.env.CI
- }
- : undefined
-});
diff --git a/apps/server-e2e/package.json b/apps/server-e2e/package.json
index 5e58a70e09..abc51d690b 100644
--- a/apps/server-e2e/package.json
+++ b/apps/server-e2e/package.json
@@ -8,5 +8,8 @@
"client",
"server"
]
+ },
+ "devDependencies": {
+ "dotenv": "16.5.0"
}
}
diff --git a/apps/server-e2e/playwright.config.ts b/apps/server-e2e/playwright.config.ts
index 0e87606535..cd6dea265d 100644
--- a/apps/server-e2e/playwright.config.ts
+++ b/apps/server-e2e/playwright.config.ts
@@ -1,17 +1,16 @@
import { defineConfig, devices } from '@playwright/test';
import { nxE2EPreset } from '@nx/playwright/preset';
import { workspaceRoot } from '@nx/devkit';
+import path from 'path';
+
+require('dotenv').config({
+ path: path.resolve(__dirname, ".env")
+});
// For CI, you may want to set BASE_URL to the deployed application.
const port = process.env['TRILIUM_PORT'];
const baseURL = process.env['BASE_URL'] || `http://localhost:${port}`;
-/**
- * Read environment variables from file.
- * https://github.com/motdotla/dotenv
- */
-// require('dotenv').config();
-
/**
* See https://playwright.dev/docs/test-configuration.
*/
diff --git a/apps/server-e2e/tsconfig.json b/apps/server-e2e/tsconfig.json
index 1df867f3a5..5e023db985 100644
--- a/apps/server-e2e/tsconfig.json
+++ b/apps/server-e2e/tsconfig.json
@@ -3,7 +3,8 @@
"compilerOptions": {
"allowJs": true,
"outDir": "out-tsc/playwright",
- "sourceMap": false
+ "sourceMap": false,
+ "verbatimModuleSyntax": false
},
"include": [
"**/*.ts",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a46b0f6d95..9ba3c0eb8a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -349,7 +349,7 @@ importers:
version: 1.0.2
copy-webpack-plugin:
specifier: 13.0.0
electron:
specifier: 35.1.5
version: 35.1.5
@@ -405,7 +405,7 @@ importers:
version: 11.0.4
copy-webpack-plugin:
specifier: 13.0.0
electron:
specifier: 35.1.5
version: 35.1.5
@@ -583,7 +583,7 @@ importers:
version: 1.4.7
copy-webpack-plugin:
specifier: 13.0.0
csrf-csrf:
specifier: 3.1.0
version: 3.1.0
@@ -754,7 +754,7 @@ importers:
version: 1.0.1
webpack:
specifier: 5.99.6
ws:
specifier: 8.18.1
@@ -765,7 +765,11 @@ importers:
specifier: 3.2.0
version: 3.2.0
- apps/server-e2e: {}
+ apps/server-e2e:
+ devDependencies:
+ dotenv:
+ specifier: 16.5.0
+ version: 16.5.0
packages/commons:
dependencies:
@@ -5435,6 +5439,10 @@ packages:
resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==}
hasBin: true
@@ -15798,14 +15806,14 @@ snapshots:
serialize-javascript: 6.0.2
dependencies:
glob-parent: 6.0.2
normalize-path: 3.0.0
schema-utils: 4.3.2
serialize-javascript: 6.0.2
tinyglobby: 0.2.13
dependencies:
@@ -16459,6 +16467,8 @@ snapshots:
+
dependencies:
minimatch: 3.1.2
@@ -21511,14 +21521,14 @@ snapshots:
'@swc/core': 1.5.29(@swc/[email protected])
esbuild: 0.19.12
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 4.3.2
serialize-javascript: 6.0.2
terser: 5.39.0
optionalDependencies:
'@swc/core': 1.5.29(@swc/[email protected])
esbuild: 0.19.12
@@ -22259,7 +22269,7 @@ snapshots:
- esbuild
- uglify-js
dependencies:
'@types/eslint-scope': 3.7.7
'@types/estree': 1.0.7
@@ -22281,7 +22291,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 4.3.2
tapable: 2.2.1
watchpack: 2.4.2
webpack-sources: 3.2.3
optionalDependencies: