Repository: nightwatchjs/nightwatch
Pull request #3204 (2022-05-19 22:36:07)

Fix/sauce labs resolution setting move
Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.

- [X] Create a new branch from master (e.g. `features/my-new-feature` or `issue/123-my-bugfix`);
- [X] If you're fixing a bug also create an issue if one doesn't exist yet;
- [ ] If it's a new feature explain why do you think it's necessary. Please check with the maintainers beforehand to make sure it is something that we will accept. Usually we only accept new features if we feel that they will benefit the entire community;
- [ ] Please avoid sending PRs which contain drastic or low level changes. If you are certain that the changes are needed, please discuss them beforehand and indicate what the impact will be;
- [ ] If your change is based on existing functionality please consider refactoring first. Pull requests that duplicate code will most likely be ignored;
- [ ] Do not include changes that are not related to the issue at hand;
- [ ] Follow the same coding style with regards to spaces, semicolons, variable naming etc.;
- [ ] Always add unit tests - PRs without tests are most of the times ignored.

Fixes [https://github.com/nightwatchjs/nightwatch/issues/3203](https://github.com/nightwatchjs/nightwatch/issues/3203)


Patch:
diff --git a/lib/runner/cli/nightwatch.conf.ejs b/lib/runner/cli/nightwatch.conf.ejs
index 17475e1c..74ee1e13 100644
--- a/lib/runner/cli/nightwatch.conf.ejs
+++ b/lib/runner/cli/nightwatch.conf.ejs
@@ -270,6 +270,7 @@ module.exports = {
         'sauce:options' : {
           username: '${SAUCE_USERNAME}',
           accessKey: '${SAUCE_ACCESS_KEY}',
+          screenResolution: '1280x1024'
           // https://docs.saucelabs.com/dev/cli/sauce-connect-proxy/#--region
           // region: 'us-west-1'
           // https://docs.saucelabs.com/dev/test-configuration-options/#tunnelidentifier
@@ -286,7 +287,6 @@ module.exports = {
       extends: 'saucelabs',
       desiredCapabilities: {
         browserName: 'chrome',
-        screenResolution: '1280x1024',
         browserVersion: 'latest',
         javascriptEnabled: true,
         acceptSslCerts: true,
@@ -300,7 +300,6 @@ module.exports = {
       extends: 'saucelabs',
       desiredCapabilities: {
         browserName: 'firefox',
-        screenResolution: '1280x1024',
         browserVersion: 'latest',
         javascriptEnabled: true,
         acceptSslCerts: true,


Test patch:
diff --git a/test/src/cli/testCliRunnerGenerate.js b/test/src/cli/testCliRunnerGenerate.js
index 61eab2e9..510c30cb 100644
--- a/test/src/cli/testCliRunnerGenerate.js
+++ b/test/src/cli/testCliRunnerGenerate.js
@@ -171,7 +171,8 @@ describe('Test CLI Runner Generate', function() {
           desiredCapabilities: {
             'sauce:options': {
               username: '${SAUCE_USERNAME}',
-              accessKey: '${SAUCE_ACCESS_KEY}'
+              accessKey: '${SAUCE_ACCESS_KEY}',
+              screenResolution: '1280x1024'
               // https://docs.saucelabs.com/dev/cli/sauce-connect-proxy/#--region
               // region: 'us-west-1'
               // https://docs.saucelabs.com/dev/test-configuration-options/#tunnelidentifier
@@ -195,7 +196,6 @@ describe('Test CLI Runner Generate', function() {
           extends: 'saucelabs',
           desiredCapabilities: {
             browserName: 'chrome',
-            screenResolution: '1280x1024',
             browserVersion: 'latest',
             javascriptEnabled: true,
             acceptSslCerts: true,
@@ -210,7 +210,6 @@ describe('Test CLI Runner Generate', function() {
           extends: 'saucelabs',
           desiredCapabilities: {
             browserName: 'firefox',
-            screenResolution: '1280x1024',
             browserVersion: 'latest',
             javascriptEnabled: true,
             acceptSslCerts: true,