2025-04-22 22:06:10 +03:00
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
import { nxE2EPreset } from '@nx/playwright/preset';
|
|
|
|
import { workspaceRoot } from '@nx/devkit';
|
2025-05-01 13:39:10 +03:00
|
|
|
|
|
|
|
require('dotenv').config({
|
2025-05-01 16:36:42 +03:00
|
|
|
path: __dirname + "/" + ".env"
|
2025-05-01 13:39:10 +03:00
|
|
|
});
|
2025-04-22 22:06:10 +03:00
|
|
|
|
|
|
|
// For CI, you may want to set BASE_URL to the deployed application.
|
2025-04-28 22:58:00 +03:00
|
|
|
const port = process.env['TRILIUM_PORT'];
|
2025-05-01 14:29:45 +03:00
|
|
|
const baseURL = process.env['BASE_URL'] || `http://127.0.0.1:${port}`;
|
2025-04-22 22:06:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See https://playwright.dev/docs/test-configuration.
|
|
|
|
*/
|
|
|
|
export default defineConfig({
|
|
|
|
...nxE2EPreset(__filename, { testDir: './src' }),
|
|
|
|
/* 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',
|
|
|
|
},
|
|
|
|
/* Run your local dev server before starting the tests */
|
2025-05-15 17:24:24 +03:00
|
|
|
webServer: !process.env.TRILIUM_DOCKER ? {
|
2025-04-28 22:58:00 +03:00
|
|
|
command: 'pnpm server:start-prod',
|
|
|
|
url: baseURL,
|
2025-04-22 22:06:10 +03:00
|
|
|
reuseExistingServer: !process.env.CI,
|
2025-05-22 18:32:03 +03:00
|
|
|
cwd: workspaceRoot,
|
|
|
|
timeout: 5 * 60 * 1000
|
2025-05-15 17:24:24 +03:00
|
|
|
} : undefined,
|
2025-04-22 22:06:10 +03:00
|
|
|
projects: [
|
|
|
|
{
|
|
|
|
name: "chromium",
|
|
|
|
use: { ...devices["Desktop Chrome"] },
|
|
|
|
},
|
|
|
|
|
2025-04-28 22:58:00 +03:00
|
|
|
// {
|
|
|
|
// name: "firefox",
|
|
|
|
// use: { ...devices["Desktop Firefox"] },
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
// name: "webkit",
|
|
|
|
// use: { ...devices["Desktop Safari"] },
|
|
|
|
// },
|
2025-04-22 22:06:10 +03:00
|
|
|
|
|
|
|
// Uncomment for mobile browsers support
|
|
|
|
/* {
|
|
|
|
name: 'Mobile Chrome',
|
|
|
|
use: { ...devices['Pixel 5'] },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Mobile Safari',
|
|
|
|
use: { ...devices['iPhone 12'] },
|
|
|
|
}, */
|
|
|
|
|
|
|
|
// Uncomment for branded browsers
|
|
|
|
/* {
|
|
|
|
name: 'Microsoft Edge',
|
|
|
|
use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Google Chrome',
|
|
|
|
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
|
|
} */
|
|
|
|
],
|
|
|
|
});
|