Skip to content

Run-Workers does not work for Gherkin / Cucumber BDD Feature Files #2188

@gkushang

Description

@gkushang

What are you trying to achieve?

Run Gherkin Feature Files in Parallel

What do you get instead?

Running Gherkin Features in Parallel does not work with run-workers. It repeats the Same Scenarios in each worker more than once.

Steps to Reproduce:

git clone git@github.com:gkushang/codeceptjs-bdd.git
cd codeceptjs-bdd/packages/codeceptjs-cucumber/
yarn
npx codeceptjs run-workers 2 parallel --features --verbose

VERBOSE OUTPUT

for Two Feature Files, and 3 total Scenarios but it repeated the scenarios in each worker and ran more than 3 times.

➜  codeceptjs-cucumber git:(develop) npx codeceptjs run-workers 2 parallel --features --verbose
Tests are running locally on : "default" browser
Groups vSkGIlzX/1jEQNzjnB1MwWw,PbEPw3AufxPBZGkTuMNbEQ
CodeceptJS v2.4.1
Running tests in 2 workers...

Tests are running locally on : "default" browser
Tests are running locally on : "default" browser
CodeceptJS v2.4.1
Using test root "/Users/kgajjar/Documents/workspace/Salesforce/codeceptjs-bdd/packages/codeceptjs-cucumber"
Helpers: WebDriver, REST, WebDriver_commands
Plugins: screenshotOnFail, allure, autoDelay, retryFailedStep, wdio

[2] Search Github @search --
Search Github @search --
  In order to see Github Search works
  As a Github user
  I want to be able to search for repository
    Emitted | suite.before ([object Object])
CodeceptJS v2.4.1
Using test root "/Users/kgajjar/Documents/workspace/Salesforce/codeceptjs-bdd/packages/codeceptjs-cucumber"
Helpers: WebDriver, REST, WebDriver_commands
Plugins: screenshotOnFail, allure, autoDelay, retryFailedStep, wdio

[1] Login to Github @login --
Login to Github @login --
  In order to contribute to Git repository
  Fred, As a Github user
  Wants to be able to login
    Emitted | suite.before ([object Object])
(node:41363) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(node:41363) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
 › Started SeleniumStandaloneLauncher
 › Started SeleniumStandaloneLauncher
  Fred should see the highlighted results for the searched repository @search_results
  Fred successfully logs in to contribute to the Git repository @login
    Emitted | test.before ([object Object])
    Emitted | test.before ([object Object])
    Emitted | hook.start ([object Object])
    Emitted | test.start ([object Object])
    Emitted | hook.passed ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "/#/")
    Emitted | step.before (I am on page "/#/")
    Emitted | step.after (I am on page "/#/")
    Emitted | step.after (I am on page "/#/")
-- before Fred should see the highlighted results for the searched repository @search_results --
    Emitted | step.before (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
-- before Fred successfully logs in to contribute to the Git repository @login --
    Emitted | step.after (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.start (I am on page "/#/")
    Emitted | step.before (I press key "Enter")
    Emitted | step.after (I press key "Enter")
    Emitted | step.before (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.after (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.before (I see "MIT license
")
    Emitted | step.after (I see "MIT license
")
    Emitted | step.start (I am on page "/#/")
    Emitted | step.comment (EventEmitter: emit )
    EventEmitter: emit
    Emitted | step.comment (EventEmitter: emit )
      I am on page "/#/"
    EventEmitter: emit
      I am on page "/#/"
    Emitted | step.passed (I am on page "/#/")
    Emitted | step.finish (I am on page "/#/")
    Delaying for 400ms
    Emitted | step.passed (I am on page "/#/")
[1]   ✔ Fred successfully logs in to contribute to the Git repository @login in 1628ms
    Emitted | step.finish (I am on page "/#/")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
-- after Fred successfully logs in to contribute to the Git repository @login --
  ✔ OK in 1631ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])
Login to Github @login --
[1] Login to Github @login --
  In order to contribute to Git repository
  Fred, As a Github user
  Wants to be able to login
    Emitted | suite.before ([object Object])
  Fred successfully logs in to contribute to the Git repository @login
    Emitted | test.before ([object Object])
    Emitted | step.start (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.comment (ghHomePage: search )
    When he searches for the "gkushang/codeceptjs-bdd"
    Emitted | step.comment (ghHomePage: search )
      ghHomePage: search
        I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd"
        › [SmartWait (5000ms)] Locating {css: .header-search-input} in 5000
    Delaying for 200ms
    Emitted | step.passed (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.finish (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Delaying for 400ms
    Emitted | step.start (I press key "Enter")
      I press key "Enter"
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "/#/")
    Emitted | step.after (I am on page "/#/")
-- before Fred successfully logs in to contribute to the Git repository @login --
    Emitted | step.start (I am on page "/#/")
    Emitted | step.comment (EventEmitter: emit )
    EventEmitter: emit
      I am on page "/#/"
    Delaying for 200ms
    Emitted | step.passed (I press key "Enter")
    Emitted | step.finish (I press key "Enter")
    Emitted | step.start (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.comment (Then he sees all the detailed highlighted results including description or license info and many more )
    Then he sees all the detailed highlighted results including description or license info and many more
      I see "CodeceptJS BDD Framework with Cucumber, SauceLabs"
      › [SmartWait (5000ms)] Locating body in 5000
    Emitted | step.passed (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.finish (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.start (I see "MIT license
")
      I see "MIT license
"
      › [SmartWait (5000ms)] Locating body in 5000
    Emitted | step.passed (I see "MIT license
")
[2]   ✔ Fred should see the highlighted results for the searched repository @search_results in 3513ms
    Emitted | step.finish (I see "MIT license
")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
-- after Fred should see the highlighted results for the searched repository @search_results --
  ✔ OK in 3517ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])
Login to Github @login --
[2] Login to Github @login --
  In order to contribute to Git repository
  Fred, As a Github user
  Wants to be able to login
    Emitted | suite.before ([object Object])
  Fred successfully logs in to contribute to the Git repository @login
    Emitted | test.before ([object Object])
    Emitted | step.passed (I am on page "/#/")
[1]   ✔ Fred successfully logs in to contribute to the Git repository @login in 1852ms
    Emitted | step.finish (I am on page "/#/")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
-- after Fred successfully logs in to contribute to the Git repository @login --
  ✔ OK in 1853ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])
Search Github @search --
[1] Search Github @search --
  In order to see Github Search works
  As a Github user
  I want to be able to search for repository
    Emitted | suite.before ([object Object])
  Fred should see the highlighted results for the searched repository @search_results
    Emitted | test.before ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "/#/")
    Emitted | step.after (I am on page "/#/")
-- before Fred successfully logs in to contribute to the Git repository @login --
    Emitted | step.start (I am on page "/#/")
    Emitted | step.comment (EventEmitter: emit )
    EventEmitter: emit
      I am on page "/#/"
    Emitted | hook.start ([object Object])
    Emitted | hook.passed ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "/#/")
    Emitted | step.after (I am on page "/#/")
-- before Fred should see the highlighted results for the searched repository @search_results --
    Emitted | step.before (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.after (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.before (I press key "Enter")
    Emitted | step.after (I press key "Enter")
    Emitted | step.before (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.after (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.before (I see "MIT license
")
    Emitted | step.after (I see "MIT license
")
    Emitted | step.start (I am on page "/#/")
    Emitted | step.comment (EventEmitter: emit )
    EventEmitter: emit
      I am on page "/#/"
    Emitted | step.passed (I am on page "/#/")
[2]   ✔ Fred successfully logs in to contribute to the Git repository @login in 1435ms
    Emitted | step.finish (I am on page "/#/")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
-- after Fred successfully logs in to contribute to the Git repository @login --
  ✔ OK in 1436ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])
Search Github @search --
[2] Search Github @search --
  In order to see Github Search works
  As a Github user
  I want to be able to search for repository
    Emitted | suite.before ([object Object])
  Fred should see the highlighted results for the searched repository @search_results
    Emitted | test.before ([object Object])
    Emitted | step.passed (I am on page "/#/")
    Emitted | step.finish (I am on page "/#/")
    Delaying for 400ms
    Emitted | hook.start ([object Object])
    Emitted | hook.passed ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "/#/")
    Emitted | step.after (I am on page "/#/")
-- before Fred should see the highlighted results for the searched repository @search_results --
    Emitted | step.before (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.after (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.before (I press key "Enter")
    Emitted | step.after (I press key "Enter")
    Emitted | step.before (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.after (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.before (I see "MIT license
")
    Emitted | step.after (I see "MIT license
")
    Emitted | step.start (I am on page "/#/")
    Emitted | step.comment (EventEmitter: emit )
    EventEmitter: emit
      I am on page "/#/"
    Emitted | step.start (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.comment (ghHomePage: search )
    When he searches for the "gkushang/codeceptjs-bdd"
    Emitted | step.comment (ghHomePage: search )
      ghHomePage: search
        I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd"
        › [SmartWait (5000ms)] Locating {css: .header-search-input} in 5000
    Delaying for 200ms
    Emitted | step.passed (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.finish (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Delaying for 400ms
    Emitted | step.start (I press key "Enter")
      I press key "Enter"
    Emitted | step.passed (I am on page "/#/")
    Emitted | step.finish (I am on page "/#/")
    Delaying for 400ms
    Emitted | step.start (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.comment (ghHomePage: search )
    When he searches for the "gkushang/codeceptjs-bdd"
    Emitted | step.comment (ghHomePage: search )
      ghHomePage: search
        I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd"
        › [SmartWait (5000ms)] Locating {css: .header-search-input} in 5000
    Delaying for 200ms
    Delaying for 200ms
    Emitted | step.passed (I press key "Enter")
    Emitted | step.finish (I press key "Enter")
    Emitted | step.start (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.comment (Then he sees all the detailed highlighted results including description or license info and many more )
    Then he sees all the detailed highlighted results including description or license info and many more
      I see "CodeceptJS BDD Framework with Cucumber, SauceLabs"
      › [SmartWait (5000ms)] Locating body in 5000
    Emitted | step.passed (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.finish (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.start (I see "MIT license
")
      I see "MIT license
"
      › [SmartWait (5000ms)] Locating body in 5000
    Emitted | step.passed (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Emitted | step.finish (I fill field {"css":".header-search-input"}, "gkushang/codeceptjs-bdd")
    Delaying for 400ms
    Emitted | step.passed (I see "MIT license
")
[1]   ✔ Fred should see the highlighted results for the searched repository @search_results in 3655ms
    Emitted | step.finish (I see "MIT license
")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
-- after Fred should see the highlighted results for the searched repository @search_results --
  ✔ OK in 3655ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])

  OK  | 3 passed   // 14s
    Emitted | global.result ([object Object])
    Emitted | global.after ([object Object])
 › Stopped SeleniumStandaloneLauncher
    Emitted | step.start (I press key "Enter")
      I press key "Enter"
    Delaying for 200ms
    Emitted | step.passed (I press key "Enter")
    Emitted | step.finish (I press key "Enter")
    Emitted | step.start (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.comment (Then he sees all the detailed highlighted results including description or license info and many more )
    Then he sees all the detailed highlighted results including description or license info and many more
      I see "CodeceptJS BDD Framework with Cucumber, SauceLabs"
      › [SmartWait (5000ms)] Locating body in 5000
    Emitted | step.passed (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.finish (I see "CodeceptJS BDD Framework with Cucumber, SauceLabs")
    Emitted | step.start (I see "MIT license
")
      I see "MIT license
"
      › [SmartWait (5000ms)] Locating body in 5000
    Emitted | step.passed (I see "MIT license
")
[2]   ✔ Fred should see the highlighted results for the searched repository @search_results in 3405ms
    Emitted | step.finish (I see "MIT license
")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
-- after Fred should see the highlighted results for the searched repository @search_results --
  ✔ OK in 3405ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])

  OK  | 3 passed   // 15s
    Emitted | global.result ([object Object])
    Emitted | global.after ([object Object])
 › Stopped SeleniumStandaloneLauncher

  OK  | 6 passed   // 16.179s
git clone git@github.com:gkushang/codeceptjs-bdd.git
cd codeceptjs-bdd/packages/codeceptjs-cucumber/
yarn

node run.js // this runs the workers from this PR

Provide console output if related. Use --verbose mode for more details.

# paste output here

Provide test source code if related

// paste test

Details

  • CodeceptJS version: 2.4.3
  • NodeJS Version: v12.1.0
  • Operating System: MAC-OS
  • webdriverio
  • Configuration file:
# paste config here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions