alextiley / wdio-cucumber-json-reporter

Generates a JSON report for cucumber via webdriver.io
9 stars 2 forks source link

TypeError: Cannot read property 'line' of undefined at ' line: scenario.location.line,' #3

Closed osmolyar closed 6 years ago

osmolyar commented 6 years ago

Getting the following error trying to run tests using with the reporter; how/where is 'scenario.location' supposed to be defined? The tests run fine with default reporters.

C:\Users\osmolyar\AppData\Roaming\npm\node_modules\webdriverio\build\lib\utils\BaseReporter.js:336 throw _iteratorError; ^

TypeError: Cannot read property 'line' of undefined at CucumberJSONReporter. (C:\Users\osmolyar\AppData\Roaming\npm\node_modules\wdio-json-cucumber-reporter\lib\reporter.js:104:35) at emitOne (events.js:116:13) at CucumberJSONReporter.emit (events.js:211:7) at BaseReporter.handleEvent (C:\Users\osmolyar\AppData\Roaming\npm\node_modules\webdriverio\build\lib\utils\BaseReporter.js:324:35) at Launcher.messageHandler (C:\Users\osmolyar\AppData\Roaming\npm\node_modules\webdriverio\build\lib\launcher.js:623:28) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at emit (internal/child_process.js:772:12) at _combinedTickCallback (internal/process/next_tick.js:141:11) at process._tickDomainCallback (internal/process/next_tick.js:218:9) Submitting [object Object] in LoginPage.open(): testConfig.config.baseUrl ishttp://redhatlinux1.iscinternal.com:52773

Package versions:

"wdio-cucumber-framework": "^1.1.0", "wdio-cucumber-reporter": "^1.2.2", "wdio-junit-reporter": "^0.3.1", "wdio-json-reporter": "~0.3.1", "wdio-spec-reporter": "0.0.5", "webdriverio": "^4.6.2",

alextiley commented 6 years ago

Hi @osmolyar, sorry for the delay - I've just been moving house and have limited web access at the moment. Thanks for raising a bug.

Could you tell me which version of this project you're using? Also have you been able to isolate the error to a specific feature file? If so, would it be possible for you to supply the feature file so that I can debug it? If you could find out which feature is triggering the error then that would really help.

osmolyar commented 6 years ago

Hi @alextiley , thanks for your response, and for writing the reporter! I've since adapted it to our specific purposes and am no longer getting that error.