@@ -1020,19 +1020,28 @@ export async function init(
10201020 // For browser.executeAsync(). Trying to see if it will work for browser.execute() too.
10211021 await browser . setTimeout ( { script : 5_000 } ) ;
10221022
1023- // larger window for more consistent results
1024- const [ width , height ] = await browser . execute ( ( ) => {
1025- // in case setWindowSize() below doesn't work
1026- window . resizeTo ( window . screen . availWidth , window . screen . availHeight ) ;
1023+ if ( TEST_COMPASS_WEB ) {
1024+ // larger window for more consistent results
1025+ const [ width , height ] = await browser . execute ( ( ) => {
1026+ // in case setWindowSize() below doesn't work
1027+ window . resizeTo ( window . screen . availWidth , window . screen . availHeight ) ;
10271028
1028- return [ window . screen . availWidth , window . screen . availHeight ] ;
1029- } ) ;
1030- debug ( `available width=${ width } , height=${ height } ` ) ;
1031- try {
1032- // window.resizeTo() doesn't work on firefox
1033- await browser . setWindowSize ( width , height ) ;
1034- } catch ( err : any ) {
1035- console . error ( err ?. stack ) ;
1029+ return [ window . screen . availWidth , window . screen . availHeight ] ;
1030+ } ) ;
1031+ // getting available width=1512, height=944 in electron on mac which is arbitrary
1032+ debug ( `available width=${ width } , height=${ height } ` ) ;
1033+ try {
1034+ // window.resizeTo() doesn't work on firefox
1035+ await browser . setWindowSize ( width , height ) ;
1036+ } catch ( err : any ) {
1037+ console . error ( err ?. stack ) ;
1038+ }
1039+ } else {
1040+ await browser . execute ( ( ) => {
1041+ // eslint-disable-next-line @typescript-eslint/no-var-requires
1042+ const { ipcRenderer } = require ( 'electron' ) ;
1043+ ipcRenderer . invoke ( 'compass:maximize' ) ;
1044+ } ) ;
10361045 }
10371046
10381047 if ( compass . needsCloseWelcomeModal ) {
0 commit comments