How to maximize browser window in NightwatchJS?

How to maximize browser window in NightwatchJS?

Hi Miro,

To maximize browser window in NightwatchJS, you can fix the screen size before each test like that

module.exports = {
  tags: ['myTest'],
  before : function (browser) {
    browser.resizeWindow(800, 600);
  },
  'Test #1' : function (browser) {
    return browser
      .url('http://localhost/test1')
      .waitForElementVisible('body', 2000); 
  },
  'Test #2' : function (browser) {
    return browser
      .url('http://localhost/test2')
      .waitForElementVisible('body', 2000); 
  },
  after : function (browser) {
    browser.end();
  }
}

Ref: selenium - Nightwatch testing: Set browser to fixed size - Stack Overflow