nightwatch: Tests not running in parallel after release v1.7.6

Describe the bug

Prior to release v1.7.6 tests belonging under the same folder could run concurrently. Now they do not run in parallel even if I use the --parallel tag . The tests run sequentially

Sample test

Test path is

/tests/ci_tests/mt1.js /tests/ci_tests/mt2.js
/tests/ci_tests/mt3.js /tests/ci_tests/mt4.js

Run with command node nightwatch -e chrome .\tests\ci_tests --parallel --verbose

Verbose output

Tests finishing one by one even if I use --parallel tag or workers

debug.log


Running Navigate to MT 1:

 → Running [beforeEach]:
 → Completed [beforeEach].

 → Running command: url ('https://stage.marinetraffic.com/')
   Request POST  /session/8f950e8ef870a3f1eac8a8bf600e9d87/url  
   { url: 'https://stage.marinetraffic.com/' }
   Response 200 POST /session/8f950e8ef870a3f1eac8a8bf600e9d87/url (2712ms)
   { sessionId: '8f950e8ef870a3f1eac8a8bf600e9d87',
     status: 0,
     value: null }
  → Completed command: url ('https://stage.marinetraffic.com/') (2713ms)

 → Running command: windowMaximize ()
   Request POST  /session/8f950e8ef870a3f1eac8a8bf600e9d87/window/current/maximize  
{}
   Response 200 POST /session/8f950e8ef870a3f1eac8a8bf600e9d87/window/current/maximize (225ms)
   { sessionId: '8f950e8ef870a3f1eac8a8bf600e9d87',
     status: 0,
     value: { height: 1056, width: 1936, x: -8, y: 32 } }
  → Completed command: windowMaximize () (227ms)

 → Running command: waitForElementVisible ('body')
   Request POST  /session/8f950e8ef870a3f1eac8a8bf600e9d87/elements  
   { using: 'css selector', value: 'body' }
   Response 200 POST /session/8f950e8ef870a3f1eac8a8bf600e9d87/elements (86ms)
   { sessionId: '8f950e8ef870a3f1eac8a8bf600e9d87',
     status: 0,
     value: [ { ELEMENT: '0.026731140659515207-1' } ] }
   Request GET  /session/8f950e8ef870a3f1eac8a8bf600e9d87/element/0.026731140659515207-1/displayed  
   Response 200 GET /session/8f950e8ef870a3f1eac8a8bf600e9d87/element/0.026731140659515207-1/displayed (174ms)
   { sessionId: '8f950e8ef870a3f1eac8a8bf600e9d87',
     status: 0,
     value: true }
√ Element <body> was visible after 263 milliseconds.
  → Completed command: waitForElementVisible ('body') (264ms)

 → Running command: verify.title ('MarineTraffic: Global Ship Tracking Intelligence | AIS Marine Traffic')

 → Running command: title ([Function])
   Request GET  /session/8f950e8ef870a3f1eac8a8bf600e9d87/title  
   Response 200 GET /session/8f950e8ef870a3f1eac8a8bf600e9d87/title (257ms)
   { sessionId: '8f950e8ef870a3f1eac8a8bf600e9d87',
     status: 0,
     value:
      'MarineTraffic: Global Ship Tracking Intelligence | AIS Marine Traffic' }
√ Testing if the page title equals 'MarineTraffic: Global Ship Tracking Intelligence | AIS Marine Traffic' (259ms)
  → Completed command: verify.title ('MarineTraffic: Global Ship Tracking Intelligence | AIS Marine Traffic') (260ms)
  → Completed command: title ([Function]) (259ms)
 → Running [afterEach]:
 → Completed [afterEach].

OK. 2 assertions passed. (3.468s)

Running end test:

 → Running [beforeEach]:
 → Completed [beforeEach].

 → Running command: closeWindow ()
 
 → Running command: window ('DELETE', [Function])
   Request DELETE  /session/8f950e8ef870a3f1eac8a8bf600e9d87/window  
   Response 200 DELETE /session/8f950e8ef870a3f1eac8a8bf600e9d87/window (4157ms)
   { sessionId: '8f950e8ef870a3f1eac8a8bf600e9d87',
     status: 0,
     value: [] }
  → Completed command: closeWindow () (4173ms)
  → Completed command: window ('DELETE', [Function]) (4160ms)

 → Running command: end ()
 
 → Running command: session ('delete', [Function])
   Request DELETE  /session/8f950e8ef870a3f1eac8a8bf600e9d87  
   Response 200 DELETE /session/8f950e8ef870a3f1eac8a8bf600e9d87 (56ms)
   { value: null }
  → Completed command: end () (67ms)
  → Completed command: session ('delete', [Function]) (57ms)
 → Running [afterEach]:
 → Completed [afterEach].
No assertions ran.

 → Running [after]:
 → Completed [after].




Configuration

debug info

 
// Autogenerated by Nightwatch
// Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/
const Services = {}; loadServices();

module.exports = {
  // An array of folders (excluding subfolders) where your tests are located;
  // if this is not specified, the test source must be passed as the second argument to the test runner.
  src_folders: [],

  // See https://nightwatchjs.org/guide/working-with-page-objects/
  page_objects_path: '',

  // See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands
  custom_commands_path:  '',

  // See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-assertions
  custom_assertions_path: '',

  // See https://nightwatchjs.org/guide/#external-globals
  globals_path : '',

  webdriver: {},

  test_settings: {
    default: {
      test_workers : {"enabled" : true, "workers" : 10},
      disable_error_log: false,
      launch_url: 'https://nightwatchjs.org',

      screenshots: {
        enabled: false,
        path: 'screens',
        on_failure: true
      },

      desiredCapabilities: {
        browserName : 'firefox'
      },

      webdriver: {
        start_process: true,
        server_path: (Services.geckodriver ? Services.geckodriver.path : '')
      }
    },

    

    firefox: {
      desiredCapabilities : {
        browserName : 'firefox',
        alwaysMatch: {
          acceptInsecureCerts: true,
          'moz:firefoxOptions': {
            args: [
              // '-headless',
              // '-verbose'
            ]
          }
        }

      },
      webdriver: {
        start_process: true,
        port: 4444,
        server_path: (Services.geckodriver ? Services.geckodriver.path : ''),
        cli_args: [
          // very verbose geckodriver logs
          // '-vv'
        ]
      }
    },

    chrome: {
      desiredCapabilities : {
        browserName : 'chrome',
        'goog:chromeOptions' : {
          // More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
          //
          // This tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
          w3c: false,
          args: [
            //'--no-sandbox',
            //'--ignore-certificate-errors',
            //'--allow-insecure-localhost',
            //'--headless'
          ]
        }
      },

      webdriver: {
        start_process: true,
        port: 9515,
        server_path: (Services.chromedriver ? Services.chromedriver.path : ''),
        cli_args: [
          // --verbose
        ]
      }
    },

    edge: {
      desiredCapabilities : {
        browserName : 'MicrosoftEdge',
        'ms:edgeOptions' : {
          w3c: false,
          // More info on EdgeDriver: https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options
          args: [
            //'--headless'
          ]
        }
      },

      webdriver: {
        start_process: true,
        // Download msedgedriver from https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/
        //  and set the location below:
        server_path: '',
        cli_args: [
          // --verbose
        ]
      }
    },

    //////////////////////////////////////////////////////////////////////////////////
    // Configuration for when using the browserstack.com cloud service               |
    //                                                                               |
    // Please set the username and access key by setting the environment variables:  |
    // - BROWSERSTACK_USER                                                           |
    // - BROWSERSTACK_KEY                                                            |
    // .env files are supported                                                      |
    //////////////////////////////////////////////////////////////////////////////////
    browserstack: {
      selenium: {
        host: 'hub-cloud.browserstack.com',
        port: 443
      },
      // More info on configuring capabilities can be found on:
      // https://www.browserstack.com/automate/capabilities?tag=selenium-4
      desiredCapabilities: {
        'bstack:options' : {
          userName: '${BROWSERSTACK_USER}',
          accessKey: '${BROWSERSTACK_KEY}',
        }
      },

      disable_error_log: true,
      webdriver: {
        timeout_options: {
          timeout: 15000,
          retry_attempts: 3
        },
        keep_alive: true,
        start_process: false
      }
    },

    'browserstack.local': {
      extends: 'browserstack',
      desiredCapabilities: {
        'browserstack.local': true
      }
    },

    'browserstack.chrome': {
      extends: 'browserstack',
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions : {
          w3c: false
        }
      }
    },

    'browserstack.firefox': {
      extends: 'browserstack',
      desiredCapabilities: {
        browserName: 'firefox'
      }
    },

    'browserstack.ie': {
      extends: 'browserstack',
      desiredCapabilities: {
        browserName: 'internet explorer',
        browserVersion: '11.0'
      }
    },

    'browserstack.safari': {
      extends: 'browserstack',
      desiredCapabilities: {
        browserName: 'safari'
      }
    },

    'browserstack.local_chrome': {
      extends: 'browserstack.local',
      desiredCapabilities: {
        browserName: 'chrome'
      }
    },

    'browserstack.local_firefox': {
      extends: 'browserstack.local',
      desiredCapabilities: {
        browserName: 'firefox'
      }
    },
    //////////////////////////////////////////////////////////////////////////////////
    // Configuration for when using the Selenium service, either locally or remote,  |
    //  like Selenium Grid                                                           |
    //////////////////////////////////////////////////////////////////////////////////
    selenium_server: {
      // Selenium Server is running locally and is managed by Nightwatch
      selenium: {
        start_process: true,
        port: 4444,
        server_path: (Services.seleniumServer ? Services.seleniumServer.path : ''),
        cli_args: {
          'webdriver.gecko.driver': (Services.geckodriver ? Services.geckodriver.path : ''),
          'webdriver.chrome.driver': (Services.chromedriver ? Services.chromedriver.path : '')
        }
      }
    },

    'selenium.chrome': {
      extends: 'selenium_server',
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions : {
          w3c: false
        }
      }
    },

    'selenium.firefox': {
      extends: 'selenium_server',
      desiredCapabilities: {
        browserName: 'firefox',
        'moz:firefoxOptions': {
          args: [
            // '-headless',
            // '-verbose'
          ]
        }
      }
    }
  }
};

function loadServices() {
  try {
    Services.seleniumServer = require('selenium-server');
  } catch (err) {}

  try {
    Services.chromedriver = require('chromedriver');
  } catch (err) {}

  try {
    Services.geckodriver = require('geckodriver');
  } catch (err) {}
}





Your Environment

Executable Version
nightwatch --version version: 1.7.6
npm --version 6.9.0
yarn --version VERSION
node --version v10.16.3
Browser driver Version
Google Chrome Version 91.0.4472.106 (Official Build) (64-bit)
OS Version
NAME VERSION
Windows 10

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (15 by maintainers)

Most upvoted comments

@chriscuba23 Should be fixed in v1.7.7.

@vaibhavsingh97 thanx for verifying. I am leaving it open then

@chriscuba23 Oops!! Yes, can confirm that it is broken. Instead of running parallel, it is running single test files.