| 
									
										
										
										
											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 16:28:06 +03:00
										 |  |  | import { resolve } from 'path'; | 
					
						
							| 
									
										
										
										
											2025-05-01 13:39:10 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | require('dotenv').config({ | 
					
						
							| 
									
										
										
										
											2025-05-01 16:28:06 +03:00
										 |  |  |     path: resolve(__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 */ | 
					
						
							|  |  |  |   webServer: { | 
					
						
							| 
									
										
										
										
											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, | 
					
						
							|  |  |  |     cwd: workspaceRoot | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   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' }, | 
					
						
							|  |  |  |     } */ | 
					
						
							|  |  |  |   ], | 
					
						
							|  |  |  | }); |