Cannot read property 'lastIndexOf' of undefined
See original GitHub issueI’m submitting a … (check one with “x”)
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead use https://groups.google.com/d/forum/nightwatch-cucumber
Current behavior
Starting selenium server in parallel mode... started - PID: 15495
Started child process for: features/home
Started child process for: features/how-to-apply
Started child process for: features/lending-criteria
Started child process for: features/partners
>> features/home finished.
>> features/how-to-apply finished.
>> features/lending-criteria finished.
>> features/partners finished.
Started child process for: features/top-navigation
>> features/top-navigation finished.
Unhandled Rejection at: Promise Promise {
<rejected> TypeError: Cannot read property 'lastIndexOf' of undefined
at Runner.addIndexToFileName (/Users/arozwalak/Sites/brokers/node_modules/nightwatch-cucumber/lib/runner.js:70:30)
at /Users/arozwalak/Sites/brokers/node_modules/nightwatch-cucumber/lib/runner.js:122:45
at Generator.next (<anonymous>)
at onFulfilled (/Users/arozwalak/Sites/brokers/node_modules/co/index.js:65:19)
at /Users/arozwalak/Sites/brokers/node_modules/co/index.js:54:5
at co (/Users/arozwalak/Sites/brokers/node_modules/co/index.js:50:10)
at createPromise (/Users/arozwalak/Sites/brokers/node_modules/co/index.js:30:15)
at args.(anonymous function) (/Users/arozwalak/Sites/brokers/node_modules/nightwatch-cucumber/lib/hook-utils.js:23:28)
at /Users/arozwalak/Sites/brokers/node_modules/nightwatch/lib/runner/cli/clirunner.js:922:13
at ChildProcess.<anonymous> (/Users/arozwalak/Sites/brokers/node_modules/nightwatch/lib/runner/cli/child-process.js:87:7)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) } reason: TypeError: Cannot read property 'lastIndexOf' of undefined
at Runner.addIndexToFileName (/Users/arozwalak/Sites/brokers/node_modules/nightwatch-cucumber/lib/runner.js:70:30)
at /Users/arozwalak/Sites/brokers/node_modules/nightwatch-cucumber/lib/runner.js:122:45
at Generator.next (<anonymous>)
at onFulfilled (/Users/arozwalak/Sites/brokers/node_modules/co/index.js:65:19)
at /Users/arozwalak/Sites/brokers/node_modules/co/index.js:54:5
at co (/Users/arozwalak/Sites/brokers/node_modules/co/index.js:50:10)
at createPromise (/Users/arozwalak/Sites/brokers/node_modules/co/index.js:30:15)
at args.(anonymous function) (/Users/arozwalak/Sites/brokers/node_modules/nightwatch-cucumber/lib/hook-utils.js:23:28)
at /Users/arozwalak/Sites/brokers/node_modules/nightwatch/lib/runner/cli/clirunner.js:922:13
at ChildProcess.<anonymous> (/Users/arozwalak/Sites/brokers/node_modules/nightwatch/lib/runner/cli/child-process.js:87:7)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://c9.io, http://www.koding.com, https://www.nitrous.io or similar.
Nightwatch.config
require('nightwatch-cucumber')({
nightwatchClientAsParameter: true,
cucumberArgs: [
'--require', 'test/features/step_definitions',
'--format', 'progress',
'--format', 'json:test/reports/cucumber.json',
'--format-options', '{"colorsEnabled": false}',
'test/features'
]
});
module.exports = {
"output_folder": "test/reports",
"page_objects_path" : "test/features/page-objects",
"selenium": {
"start_process": true,
"server_path": BINPATH + "selenium.jar",
"log_path" : "test/logs",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver" : BINPATH + "chromedriver"
}
},
"test_workers": {
"enabled": true,
"workers": "auto"
},
"test_settings": {
"default": {
"globals": {
"url": "http://brokers.project.dev:8080",
"waitForConditionTimeout": 5000
},
"desiredCapabilities": {
"browserName": "chrome"
},
"screenshots" : {
"enabled" : true,
"on_failure" : true,
"on_error" : true,
"path" : SCREENSHOT_PATH
}
},
"uat": {
"disable_colors": true,
"globals": {
"url": "http://intermediaries.uatenv.landbay.co.uk",
},
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions": {
"args": ["--no-sandbox"]
}
}
}
}
}
Please tell us about your environment:
OS X El Capitan
-
nightwatch-cucumber version: 7.0.5
-
nightwatch version: 0.9.11
-
cucumber version: 2.0.0-rc.5
-
Node.js version: 7.3.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
“Cannot read property 'lastIndexOf' of undefined” when ...
0 I get the Cannot read property 'lastIndexOf' of undefined error. Downgrading to 5.2.0 doesn't solve the issue - so it must be...
Read more >Cannot read property 'indexOf' of undefined - Stack Overflow
The problem is that you're modifying the array while jQuery's $.each is looping over it, so by the time it gets to the...
Read more >How to fix "Uncaught TypeError: Cannot read property indexOf ...
The solution to fix Uncaught TypeError: Cannot read property 'indexOf' of undefined ... There is a really simple fix for this JS error!...
Read more >TypeError: Cannot read property 'indexOf' of undefined
Hello, When I go to Analytics > VARIATIONS and when I set more than 3-5 days (different dates react differently) – data loading…...
Read more >PH36402: CANNOT READ PROPERTY 'INDEXOF' OF ... - IBM
When expanding the "Module Where Used" section of a module, users may see the following error:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had the same issue but I found the problem, when you run parallel tests,
'--format', 'json:reports/cucumber.json'must be present in cucumberArgsI am closing this because of no response