Unable to resize window running TestCafe on Chrome headless

Viewed 1317

I'm having an error when trying to use .resizeWindow on my tests, but it's only failing when I run my tests against headless mode. The error stated as Warning is the following:

    Warnings (1):
 --
  Was unable to resize the window due to an error.

  Cannot read property 'Emulation' of undefined

I'm running my tests in:

 - HeadlessChrome 70.0.3538 / Mac OS X 10.13.6
 Testcafe version 0.20.4

The resizeWindow instruction is set within my beforeEach as follows:

 .beforeEach(async t => {
      await t.navigateTo(`${testDomain}${Var.url_listing_general}`)
        .resizeWindow(1420, 750);
    }
  });
1 Answers

Did you tried to do resize not in beforeEach part, but in a test as first line?

Also, maybe it's foolish and not important, but in you code sample you have extra } at the end beforeEach section, can it be cause of a problem?

Related