@@ -35,6 +35,7 @@ export class VSBrowser {
3535 private codeVersion : string ;
3636 private releaseType : ReleaseQuality ;
3737 private logLevel : logging . Level ;
38+ private locale : string ;
3839 private static _instance : VSBrowser ;
3940 private readonly _startTimestamp : string ;
4041
@@ -43,13 +44,20 @@ export class VSBrowser {
4344 return `${ date . getFullYear ( ) } ${ pad ( date . getMonth ( ) + 1 ) } ${ pad ( date . getDate ( ) ) } T${ pad ( date . getHours ( ) ) } ${ pad ( date . getMinutes ( ) ) } ${ pad ( date . getSeconds ( ) ) } ` ;
4445 }
4546
46- constructor ( codeVersion : string , releaseType : ReleaseQuality , customSettings : object = { } , logLevel : logging . Level = logging . Level . INFO ) {
47+ constructor (
48+ codeVersion : string ,
49+ releaseType : ReleaseQuality ,
50+ customSettings : object = { } ,
51+ logLevel : logging . Level = logging . Level . INFO ,
52+ locale : string = '' ,
53+ ) {
4754 this . storagePath = process . env . TEST_RESOURCES ? process . env . TEST_RESOURCES : path . resolve ( DEFAULT_STORAGE_FOLDER ) ;
4855 this . extensionsFolder = process . env . EXTENSIONS_FOLDER ? process . env . EXTENSIONS_FOLDER : undefined ;
4956 this . customSettings = customSettings ;
5057 this . codeVersion = codeVersion ;
5158 this . releaseType = releaseType ;
5259 this . logLevel = logLevel ;
60+ this . locale = locale ;
5361 this . _startTimestamp = this . formatTimestamp ( new Date ( ) ) ;
5462
5563 VSBrowser . _instance = this ;
@@ -87,7 +95,12 @@ export class VSBrowser {
8795 fs . writeJSONSync ( path . join ( userSettings , 'settings.json' ) , defaultSettings ) ;
8896 console . log ( `Writing code settings to ${ path . join ( userSettings , 'settings.json' ) } ` ) ;
8997
90- const args = [ '--no-sandbox' , '--disable-dev-shm-usage' , `--user-data-dir=${ path . join ( this . storagePath , 'settings' ) } ` ] ;
98+ const args = [ '--no-sandbox' , '--disable-dev-shm-usage' , `--user-data-dir=${ path . join ( this . storagePath , 'settings' ) } ` ] ; // sem pridam locale
99+
100+ if ( this . locale ) {
101+ console . log ( 'locale is in args with value ' + this . locale ) ;
102+ args . push ( `--locale ${ this . locale } ` ) ;
103+ }
91104
92105 if ( this . extensionsFolder ) {
93106 args . push ( `--extensions-dir=${ this . extensionsFolder } ` ) ;
@@ -102,10 +115,14 @@ export class VSBrowser {
102115 args . push ( `--extensionDevelopmentPath=${ process . env . EXTENSION_DEV_PATH } ` ) ;
103116 }
104117
118+ console . log ( 'args' , args ) ;
119+
105120 let options = new Options ( ) . setChromeBinaryPath ( codePath ) . addArguments ( ...args ) as any ;
106121 options [ 'options_' ] . windowTypes = [ 'webview' ] ;
107122 options = options as Options ;
108123
124+ console . log ( 'options' , options ) ;
125+
109126 const prefs = new logging . Preferences ( ) ;
110127 prefs . setLevel ( logging . Type . DRIVER , this . logLevel ) ;
111128 options . setLoggingPrefs ( prefs ) ;
@@ -117,6 +134,9 @@ export class VSBrowser {
117134 }
118135
119136 console . log ( 'Launching browser...' ) ;
137+ // Print the full launch command for debugging
138+ console . log ( 'Launching VS Code with command:' , `"${ codePath } " ${ args . join ( ' ' ) } ` ) ;
139+
120140 this . _driver = await new Builder ( )
121141 . setChromeService ( new ServiceBuilder ( chromeDriverBinaryPath ) )
122142 . forBrowser ( Browser . CHROME )
0 commit comments