mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			68 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { defineConfig, devices } from '@playwright/test';
 | 
						|
import { nxE2EPreset } from '@nx/playwright/preset';
 | 
						|
import { workspaceRoot } from '@nx/devkit';
 | 
						|
 | 
						|
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 baseURL = process.env['BASE_URL'] || `http://127.0.0.1:${port}`;
 | 
						|
 | 
						|
/**
 | 
						|
 * 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 */
 | 
						|
  webServer: {
 | 
						|
    command: 'pnpm server:start-prod',
 | 
						|
    url: baseURL,
 | 
						|
    reuseExistingServer: !process.env.CI,
 | 
						|
    cwd: workspaceRoot
 | 
						|
  },
 | 
						|
  projects: [
 | 
						|
    {
 | 
						|
      name: "chromium",
 | 
						|
      use: { ...devices["Desktop Chrome"] },
 | 
						|
    },
 | 
						|
 | 
						|
    // {
 | 
						|
    //   name: "firefox",
 | 
						|
    //   use: { ...devices["Desktop Firefox"] },
 | 
						|
    // },
 | 
						|
 | 
						|
    // {
 | 
						|
    //   name: "webkit",
 | 
						|
    //   use: { ...devices["Desktop Safari"] },
 | 
						|
    // },
 | 
						|
 | 
						|
    // 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' },
 | 
						|
    } */
 | 
						|
  ],
 | 
						|
});
 |