Reputation: 4798
I'm looking for the Protractor to run in the maximum browser size before the actual tests start running.
I think you have to use a beforeAll() function, but not sure how to set the size? Any ideas?
Upvotes: 0
Views: 2320
Reputation: 1288
If you're running on a virtual machine, sometimes the maximize() command doesn't do what you expect.
in protractor.conf.js onPrepare
var getScreenSize = function() {
return browser.driver.executeScript(function() {
return {
width: window.screen.availWidth,
height: window.screen.availHeight
};
});
};
getScreenSize.then(function(screenSize) {
browser.driver.manage().window().setSize(screenSize.width, screenSize.height);
});
Upvotes: 0
Reputation: 619
The below code
var width = 200;
var height = 300;
browser.driver.manage().window().setSize(width, height);
Upvotes: 2