@@ -4,69 +4,17 @@ import { config } from 'dotenv';
44// Load .env.e2e file for E2E test configuration
55config ( { path : '.env.e2e' } ) ;
66
7- export interface TestConfig {
8- // Environment settings
9- environment : {
10- tempDir : string ;
11- isolatedPort : number ;
12- clearCache : boolean ;
13- mockData : boolean ;
14- clearStorage : boolean ;
15- } ;
16-
17- // App settings
18- app : {
19- timeout : number ;
20- retryAttempts : number ;
21- waitForSelectorTimeout : number ;
22- } ;
23-
24- // Test data settings
25- testData : {
26- mockProjectName : string ;
27- mockSceneTitle : string ;
28- mockSceneDescription : string ;
29- } ;
30- }
31-
32- export const testConfig : TestConfig = {
33- environment : {
34- // Use absolute path to tests/temp/ directory for all test data
35- tempDir : join ( resolve ( process . cwd ( ) ) , 'tests' , 'temp' ) ,
36- isolatedPort : 3001 ,
37- clearCache : true ,
38- mockData : true ,
39- clearStorage : true ,
40- } ,
41-
42- app : {
43- timeout : parseInt ( process . env . E2E_TIMEOUT || '10000' , 10 ) ,
44- retryAttempts : 3 ,
45- waitForSelectorTimeout : 5000 ,
46- } ,
47-
48- testData : {
49- mockProjectName : 'test-scene' ,
50- mockSceneTitle : process . env . E2E_SCENE_NAME || 'E2E test scene' ,
51- mockSceneDescription : 'A test scene for E2E testing' ,
52- } ,
53- } ;
54-
55- // Helper function to get test-specific temp directory
56- export const getTestTempDir = ( ) : string => {
57- return join ( testConfig . environment . tempDir ) ;
58- } ;
59-
7+ // Helper function to get scene directory path (actually used)
608export const getTestScenesDir = ( sceneName : string ) : string => {
61- return join ( testConfig . environment . tempDir , 'scenes' , sceneName ) ;
9+ return join ( resolve ( process . cwd ( ) ) , 'tests' , 'temp' , 'scenes' , sceneName ) ;
6210} ;
6311
6412// Helper function to get environment variables for tests
6513export const getTestEnv = ( ) : Record < string , string > => ( {
6614 NODE_ENV : 'test' ,
6715 ELECTRON_ENABLE_LOGGING : 'false' ,
6816 ELECTRON_ENABLE_STACK_DUMPING : 'false' ,
69- PORT : testConfig . environment . isolatedPort . toString ( ) ,
17+ PORT : '3001' ,
7018 DISABLE_ANALYTICS : 'true' ,
7119 DISABLE_TELEMETRY : 'true' ,
7220 DISABLE_AUTO_UPDATE : 'true' ,
@@ -78,4 +26,6 @@ export const getTestEnv = (): Record<string, string> => ({
7826 // Include E2E-specific environment variables
7927 E2E : process . env . E2E || 'true' ,
8028 ...( process . env . E2E_NAME ? { E2E_NAME : process . env . E2E_NAME } : { } ) ,
29+ // Debug logging control
30+ DEBUG : process . env . DEBUG || 'false' ,
8131} ) ;
0 commit comments