configure it once and for all in the env configuration (under test_settings in the test_settings configuration file):
"desiredCapabilities": { "chromeOptions": { "args": [ "window-size=1280,800" ] } }
note that this method will work because we set the chrome flag, so the implementation may be different (for example, safari does not have such flags).
for browsers that do not support these options, it is best to resize in the globals beforeEach hook:
{ beforeEach: function (browser, done) { browser.resizeWindow(1280, 800, done); } }
read in dows docs to find out how global characters are used.
using the above methods, you do not need to specify it in each test :)
Eliran malka
source share