We are in the process of setting up Jenkins for our testing projects and we are facing a huge challenge for browser window size. The app we are testing is a Progressing app so with the default screen size of Jenkins hides the menu element and we need to jump through hoops and probably will need to add some if then else conditions if we want to use Jenkins as the CI tool. The test scripts are built using Protractor - Jasmine. In my research I saw some solutions offered for this problem but they are for Java , and I could not find any solution for protractor based tests. Is there any way to maximize the browser window size when running Protractor tests in Jenkins?
2 Answers
You can use your config.js to set window size:
// config.js
specs: [ ... ],
capabilities:
{
browserName: 'chrome',
chromeOptions:
{
args: ['--window-size=800,600']
}
}
Actually, the answer is to run Jenkins as a Java app ($ java -jar jenkins.war) instead of running it as a windows service. If jenkins run as a Java app, the browser window gets maximized without any problem.