1515// *****************************************************************************
1616
1717import { Page , PlaywrightWorkerArgs , _electron as electron } from '@playwright/test' ;
18- import * as path from 'path' ;
19- import * as fs from 'fs' ;
2018import { TheiaApp } from './theia-app' ;
2119import { TheiaWorkspace } from './theia-workspace' ;
22- import { OSUtil } from './util' ;
2320
2421export interface TheiaAppFactory < T extends TheiaApp > {
2522 new ( page : Page , initialWorkspace : TheiaWorkspace , isElectron ?: boolean ) : T ;
@@ -104,7 +101,7 @@ namespace TheiaElectronAppLoader {
104101 const appPath = electronConfig . electronAppPath ! ;
105102 const pluginsPath = electronConfig . pluginsPath ;
106103 const launchOptions = electronConfig . launchOptions ?? {
107- additionalArgs : [ '--no-cluster' ] ,
104+ additionalArgs : [ '--no-sandbox' , '--no- cluster'] ,
108105 electronAppPath : appPath ,
109106 pluginsPath : pluginsPath
110107 } ;
@@ -122,14 +119,10 @@ namespace TheiaElectronAppLoader {
122119 export function toPlaywrightOptions (
123120 electronLaunchOptions : { additionalArgs : string [ ] , electronAppPath : string , pluginsPath ?: string } | object ,
124121 workspace ?: TheiaWorkspace
125- ) : { executablePath : string , args : string [ ] } | object {
122+ ) : {
123+ args : string [ ]
124+ } | object {
126125 if ( 'additionalArgs' in electronLaunchOptions && 'electronAppPath' in electronLaunchOptions ) {
127- const executablePath = path . normalize ( path . join ( electronLaunchOptions . electronAppPath , 'node_modules/.bin/electron' ) ) + ( OSUtil . isWindows ? '.cmd' : '' ) ;
128- if ( ! fs . existsSync ( executablePath ) ) {
129- const errorMsg = `executablePath: ${ executablePath } does not exist` ;
130- console . log ( errorMsg ) ;
131- throw new Error ( errorMsg ) ;
132- }
133126 const args = [
134127 electronLaunchOptions . electronAppPath ,
135128 ...electronLaunchOptions . additionalArgs ,
@@ -142,7 +135,9 @@ namespace TheiaElectronAppLoader {
142135 args . push ( workspace . path ) ;
143136 }
144137
145- return { executablePath : executablePath , args : args } ;
138+ return {
139+ args : args
140+ } ;
146141 }
147142 return electronLaunchOptions ;
148143 }
@@ -159,6 +154,7 @@ export namespace TheiaAppLoader {
159154 // disable native elements and early window to avoid issues with the electron app
160155 process . env . THEIA_ELECTRON_DISABLE_NATIVE_ELEMENTS = '1' ;
161156 process . env . THEIA_ELECTRON_NO_EARLY_WINDOW = '1' ;
157+ process . env . THEIA_NO_SPLASH = 'true' ;
162158 return TheiaElectronAppLoader . load ( args , initialWorkspace , factory ) ;
163159 }
164160 const page = await args . browser . newPage ( ) ;
0 commit comments