| 
									
										
										
										
											2025-04-22 22:06:10 +03:00
										 |  |  | import { defineConfig, devices } from '@playwright/test'; | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  | import { join } from 'path'; | 
					
						
							| 
									
										
										
										
											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({ | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  |   testDir: "src", | 
					
						
							|  |  |  |   reporter: [["list"], ["html", { outputFolder: "test-output" }]], | 
					
						
							|  |  |  |   outputDir: "test-output", | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-22 22:06:10 +03:00
										 |  |  |   /* 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', | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-22 22:06:10 +03:00
										 |  |  |   /* Run your local dev server before starting the tests */ | 
					
						
							| 
									
										
										
										
											2025-05-15 17:24:24 +03:00
										 |  |  |   webServer: !process.env.TRILIUM_DOCKER ? { | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  |     command: 'pnpm start-prod', | 
					
						
							| 
									
										
										
										
											2025-04-28 22:58:00 +03:00
										 |  |  |     url: baseURL, | 
					
						
							| 
									
										
										
										
											2025-04-22 22:06:10 +03:00
										 |  |  |     reuseExistingServer: !process.env.CI, | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  |     cwd: join(__dirname, "../server"), | 
					
						
							| 
									
										
										
										
											2025-05-22 18:32:03 +03:00
										 |  |  |     timeout: 5 * 60 * 1000 | 
					
						
							| 
									
										
										
										
											2025-05-15 17:24:24 +03:00
										 |  |  |   } : undefined, | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-22 22:06:10 +03:00
										 |  |  |   projects: [ | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       name: "chromium", | 
					
						
							|  |  |  |       use: { ...devices["Desktop Chrome"] }, | 
					
						
							| 
									
										
										
										
											2025-09-02 19:00:49 +03:00
										 |  |  |     } | 
					
						
							|  |  |  |   ] | 
					
						
							| 
									
										
										
										
											2025-04-22 22:06:10 +03:00
										 |  |  | }); |