Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the environment flag when using multiple environments only runs against firefox #1948

Closed
gregoryduckworth opened this issue Dec 18, 2018 · 2 comments

Comments

@gregoryduckworth
Copy link

gregoryduckworth commented Dec 18, 2018

When running in multiple environments, they all run as firefox.

For example running the command:

./node_modules/.bin/nightwatch -c conf/remote.conf.js -e chrome,ie --verbose

the log outputs:

Request POST http://hub-cloud.browserstack.com /wd/hub/session
   { capabilities:
      { browserName: 'firefox',
        acceptSslCerts: true,
        build:
         'nightwatchjs',
        project: 'Nightwatch',
        'browserstack.user': 'BROWSERSTACK_USERNAME',
        'browserstack.key': 'BROWSERSTACK_ACCESS_KEY',
        'browserstack.debug': true,
        name: 'Test' },
     desiredCapabilities:
      { browserName: 'firefox',
        acceptSslCerts: true,
        platform: 'ANY',
        build:
         'nightwatchjs',
        project: 'Nightwatch',
        'browserstack.user': 'BROWSERSTACK_USERNAME',
        'browserstack.key': 'BROWSERSTACK_ACCESS_KEY',
        'browserstack.debug': true,
        name: 'Test' } }

but when running a single environment:

./node_modules/.bin/nightwatch -c conf/remote.conf.js -e chrome --verbose

the log outputs correctly and it runs against browserstack correctly:

Request POST http://hub-cloud.browserstack.com /wd/hub/session
   { desiredCapabilities:
      { browserName: 'Chrome',
        acceptSslCerts: true,
        platform: 'ANY',
        build:
         'nightwatchjs',
        project: 'Nightwatch',
        'browserstack.user': 'BROWSERSTACK_USERNAME',
        'browserstack.key': 'BROWSERSTACK_ACCESS_KEY',
        'browserstack.debug': true,
        os: 'Windows',
        os_version: '7',
        resolution: '1366x768',
        name: 'Test' } }

It appears as though the first scenario when using multiple environments creates a capabilities section which it doesn't on the second scenario and some of the values are not getting written.

My configuration is as follows:

var nightwatch_config = {
  src_folders: ['tests'],
  page_objects_path: ['pages'],
  globals_path: 'global.js',

  webdriver: {
    start_process: false,
    host: 'hub-cloud.browserstack.com',
    port: 80,
    default_path_prefix: '/wd/hub',
  },

  test_workers: true,

  test_settings: {
    default: {
      screenshots: {
        enabled: true,
        on_failure: true,
        on_error: true,
        path: 'screenshots/failures',
      },
      javascriptEnabled: true,
      skip_testcases_on_fail: false,
      desiredCapabilities: {
        build: 'nightwatchjs',
        project: 'Nightwatch',
        'browserstack.user':  'BROWSERSTACK_USERNAME',
        'browserstack.key': 'BROWSERSTACK_ACCESS_KEY',
        'browserstack.debug': true,
      },
    },
    chrome: {
      desiredCapabilities: {
        browserName: 'Chrome',
        os: 'Windows',
        os_version: '7',
        resolution: '1366x768',
      }
    },
    ie: {
      desiredCapabilities: {
        browserName: 'IE',
        browser_version: '11.0',
        os: 'Windows',
        os_version: '7',
        resolution: '1366x768',
        'browserstack.customSendKeys': 400,
      }
    },
  },
};
@beatfactor
Copy link
Member

It's because you have test_workers: true, while you are running multiple environments. I will add an improvement to disable test_workers explicitly in such a scenario.

beatfactor added a commit that referenced this issue Dec 18, 2018
@gregoryduckworth
Copy link
Author

Thanks @beatfactor, disabling test_workers has solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants