How to make Chromdriver run in circleci?

Viewed 25

In my react project I am using nightwatch for testing. After nightwatch version upgrade from 1.7 -> 2.0 everything is working fine locally(As a side comment everything was working fine on previous 1.7 version as well and had same config I wrote below), but once I push my changes I see that tests are failing in circleci and main reason is that chromdriver can't start. Those are errors I see:

Failed to connect to ChromeDriver on localhost with port 9515 WebDriverError: An error occurred while creating a new ChromeDriver session: [WebDriverError] unknown error: Chrome failed to start: exited abnormally

This is my nightwatch config:

const chrome = require('chromedriver');

module.exports = {
 src_folders: ['./tests/e2e/specs'],
 test_settings: {
   default: {
    desiredCapabilities: {
     browserName: 'chrome',
     chromeOptions: {
       args: [
         '--no-sandbox',
         '--headless',
       ],
       mobileEmulation: {
         'deviceName': 'iPhone 6/7/8',
       },
     },
   },
   filter: '**/*.spec.js',
   },
 },
 webdriver: {
   port: 9515,
   server_path: chrome.path,
   start_process: true,
},

};

Any thoughts? Thank you!

0 Answers
Related