You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue where when declaring additional options to cucumber runners, they do not seem to be getting passed to the cucumber runner. I've tried retry and format, but they do not seem to work.
Forcefully changing the additionalOptions variable to the string 'retry=1' results in the expected behaviour with the scenario being retried once.
Expected behaviour: When specifying e.g. retry: 1 as an option when declaring a cucumber.js runner, if there was a failure in my test run, for the failing scenario to be retried once.
Sample test
N/A Affects any test that runs with a cucumber runner
npx nightwatch --env chrome.local
ℹ Connected to ChromeDriver on port 4444 (1452ms).
Using: chrome (100.0.4896.127) on MAC OS X.
ℹ Loaded url <***>in 3766ms
✔ Element <.header-text> was visible after 22 milliseconds.
DEPRECATED: the assertion .containsText() has been deprecated and will be removed from future versions. Use assert.textContains().
✔ Testing if element <.header-text> contains text 'Welcome' (17ms)
.. ✖ Testing if the URL contains '<***>' in 5000ms - expected "contains '<***>'" but got: "<***>" (5279ms)
at Object.verifyLoggedIn (***)
at World.<anonymous> (***)
F-.
ℹ Connected to ChromeDriver on port 4444 (1262ms).
Using: chrome (100.0.4896.127) on MAC OS X.
ℹ Loaded url <***> in 6081ms
✔ Element <.header-text> was visible after 20 milliseconds.
DEPRECATED: the assertion .containsText() has been deprecated and will be removed from future versions. Use assert.textContains().
✔ Testing if element <.header-text> contains text 'Welcome' (15ms)
..✔ Element <//h1//span[contains(text(), "Open returns")]> was visible after 545 milliseconds.
..
Failures:
1) Scenario: Successful log in to the SVR application # features/login.feature:3
✔ Before # node_modules/nightwatch/cucumber-js/_setup_cucumber_runner.js:6
✔ Given I have navigated to the SVR login page # step-definitions/login.js:4
✔ When I enter my correct login credentials # step-definitions/login.js:23
✖ Then I see I have logged into the correct environment # step-definitions/login.js:60
Testing if the URL contains '<***>' in 5000ms - expected "contains '<***>'" but got: "<***>" (5279ms)
at Proxy.<anonymous> (<***>)
at Object.verifyLoggedIn (<***>)
at World.<anonymous> (<***>)
- Then I see I have logged into the correct environment again # step-definitions/login.js:74
✔ After # node_modules/nightwatch/cucumber-js/_setup_cucumber_runner.js:66
2 scenarios (1 failed, 1 passed)
7 steps (1 failed, 1 skipped, 5 passed)
0m29.174s (executing steps: 0m29.161s)
Describe the bug
I'm having an issue where when declaring additional options to cucumber runners, they do not seem to be getting passed to the cucumber runner. I've tried
retry
andformat
, but they do not seem to work.While debugging, I can verify, the options I have declared in the configuration file are being picked up in the
options
variable at https://github.com/nightwatchjs/nightwatch/blob/main/lib/runner/test-runners/cucumber.js#L93, but theadditionalOptions
variable is empty afterbuildArgvValue()
has been run at https://github.com/nightwatchjs/nightwatch/blob/main/lib/runner/test-runners/cucumber.js#L100Forcefully changing the
additionalOptions
variable to the string'retry=1'
results in the expected behaviour with the scenario being retried once.Expected behaviour: When specifying e.g.
retry: 1
as an option when declaring a cucumber.js runner, if there was a failure in my test run, for the failing scenario to be retried once.Sample test
N/A Affects any test that runs with a cucumber runner
Run with command
Verbose output
Output
Configuration
The env with the retry config is
chrome.local
nightwatch.json
Your Environment
nightwatch --version
npm --version
node --version
cucumber js
| OS | Version |
| macOS Montery | 12.3 |
The text was updated successfully, but these errors were encountered: