1

When I start a new Spectron application (for each test suite) I would like to fix the size of the app (for consistency across all machines and reloads).

Commands like setBounds and maximise do change dimensions, but they only do so after the app has started (which means that some components have already assumed certain dimensions, which then changes test results).

In the Spectron docs various launch options are available. I've tired to use webdriver and chromedriver options but they don't seem to work. Here is an example:

app = new Application({
     path: kElectronPath,
     webdriverOptions: {
        width:1368,
        height:769,
     },

I just assumed that the webdriver options came from the browserwindow class. How are webdriver and chromedriver options accessed in Spectron?

cham
  • 8,666
  • 9
  • 48
  • 69

1 Answers1

1

This should help

 this.app = new Application({
    path: './ac.exe',
    args: ['app'],
    webdriverOptions: ({deprecationWarnings : false})
});

pass the parameters that need to be changed during app launch

and have your new application config in before hook

Bharath Kumar S
  • 1,410
  • 2
  • 10
  • 29
  • Yes, the problem seems to be caused by a bug. `args` is an optional argument that I was not using. Now that we are using it webdriver options also work. – cham Jul 06 '18 at 01:45