在尝试在我的测试中使用.resizeWindow时,我遇到了一个错误,但只有在使用无头模式运行我的测试时才会失败。错误如下所示:
Warnings (1):
--
Was unable to resize the window due to an error.
Cannot read property 'Emulation' of undefined
我正在运行测试:
- HeadlessChrome 70.0.3538 / Mac OS X 10.13.6
Testcafe version 0.20.4
在我的beforeEach中,resizeWindow指令设置如下:
.beforeEach(async t => {
await t.navigateTo(`${testDomain}${Var.url_listing_general}`)
.resizeWindow(1420, 750);
}
});
testcafe 'chrome:headless --window-size="1420,740" test.js'
。 - Alextgda