Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit a709177

Browse files
committed
e2e(desktop): create empty project
1 parent 520b862 commit a709177

File tree

8 files changed

+119
-0
lines changed

8 files changed

+119
-0
lines changed

apps/desktop-e2e/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TRILIUM_INTEGRATION_TEST=memory-no-store
2+
TRILIUM_PORT=8082
3+
TRILIUM_DATA_DIR=data

apps/desktop-e2e/eslint.config.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import playwright from "eslint-plugin-playwright";
2+
import baseConfig from "../../eslint.config.mjs";
3+
4+
export default [
5+
playwright.configs["flat/recommended"],
6+
...baseConfig,
7+
{
8+
files: [
9+
"**/*.ts",
10+
"**/*.js"
11+
],
12+
// Override or add rules here
13+
rules: {}
14+
}
15+
];

apps/desktop-e2e/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@triliumnext/desktop-e2e",
3+
"version": "0.0.1",
4+
"private": true,
5+
"nx": {
6+
"name": "desktop-e2e",
7+
"implicitDependencies": [
8+
"client",
9+
"desktop"
10+
],
11+
"targets": {
12+
"e2e": {
13+
"dependsOn": [
14+
"desktop:build",
15+
"desktop:rebuild-deps"
16+
]
17+
}
18+
}
19+
},
20+
"devDependencies": {
21+
"dotenv": "16.5.0",
22+
"electron": "36.5.0"
23+
}
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
import { nxE2EPreset } from '@nx/playwright/preset';
3+
4+
require('dotenv').config({
5+
path: __dirname + "/" + ".env"
6+
});
7+
8+
// For CI, you may want to set BASE_URL to the deployed application.
9+
const port = process.env['TRILIUM_PORT'];
10+
11+
/**
12+
* See https://playwright.dev/docs/test-configuration.
13+
*/
14+
export default defineConfig({
15+
...nxE2EPreset(__filename, { testDir: './src' }),
16+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
17+
use: {
18+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
19+
trace: 'on-first-retry',
20+
},
21+
projects: [
22+
{
23+
name: "chromium",
24+
use: { ...devices["Desktop Chrome"] },
25+
}
26+
],
27+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { test, expect, _electron as electron } from '@playwright/test';
2+
import { join } from 'path';
3+
4+
test('Electron app should display correct title', async () => {
5+
// Launch Electron app
6+
const distPath = join(__dirname, '../../desktop/dist/main.cjs');
7+
const app = await electron.launch({ args: [ distPath ] });
8+
9+
// Get the main window
10+
const window = await app.firstWindow();
11+
await expect(window).toHaveTitle("Setup");
12+
await app.close();
13+
});

apps/desktop-e2e/tsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"outDir": "out-tsc/playwright",
6+
"sourceMap": false
7+
},
8+
"include": [
9+
"**/*.ts",
10+
"**/*.js",
11+
"playwright.config.ts",
12+
"src/**/*.spec.ts",
13+
"src/**/*.spec.js",
14+
"src/**/*.test.ts",
15+
"src/**/*.test.js",
16+
"src/**/*.d.ts"
17+
],
18+
"exclude": [
19+
"out-tsc",
20+
"test-output",
21+
"eslint.config.js",
22+
"eslint.config.mjs",
23+
"eslint.config.cjs"
24+
]
25+
}

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
},
6363
{
6464
"path": "./apps/website"
65+
},
66+
{
67+
"path": "./apps/desktop-e2e"
6568
}
6669
]
6770
}

0 commit comments

Comments
 (0)