aruiz-caritsqa / wdio-html-format-reporter

A WebdriverIO plugin. Create a basic HTML formatted report
0 stars 4 forks source link

Reporter getting crashed when one feature file has got multiple scenarios #5

Closed qburst-hari closed 6 years ago

qburst-hari commented 6 years ago

If my feature file has got multiple scenarios in it, for eg :

Scenario: User log in successfully
   Given User inputs username
   Then User inputs password
   When User click Sign in Button
   Then User logs in

Scenario: User log in failure
   Given User inputs username
   Then User dont inputs password
   When User click Sign in Button
   Then User logs in

Then the report is getting crashed and report is not generated. I am getting error

typeError: Cannot read property 'screenshots' of undefined at HtmlReporter. (/mnt/jenkins/workspace/node_modules/wdio-html-format-reporter/lib/reporter.js:50:49) at emitOne (events.js:96:13) at HtmlReporter.emit (events.js:188:7) at BaseReporter.handleEvent (/mnt/jenkins/workspace/node_modules/webdriverio/build/lib/utils/BaseReporter.js:324:35) at Launcher.messageHandler (/mnt/jenkins/workspace/node_modules/webdriverio/build/lib/launcher.js:688:28) at emitTewo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at process.nextTick (internal/child_process.js:744:12) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Any idea why its happening and any solution for this ?

qburst-hari commented 6 years ago

@aruiz-caritsqa : Can you please check

aruiz-caritsqa commented 6 years ago

Hi @qburst-hari

In the package.json file for your project, what version of wdio-cucumber-framework do you have?

When I wrote this reporter, I was using wdio-cucumber-framework@1.1.0 from January, and it wasn't throwing errors. I didn't realise wdio-cucumber-framework v2 had come out, and it looks like I need to make changes to the reporter in order to work with the new output.

Try rolling back the version of wdio-cucumber-framework - wdio-cucumber-framework@1.1.0 from March seems to works as well

There are other issues with using v2 of wdio-cucumber-framework (https://github.com/webdriverio/wdio-cucumber-framework/issues/111) so please check the version you're using

aruiz-caritsqa commented 6 years ago

@qburst-hari, I've updated the version to 0.2.9, which should resolve the issue.

The error you had is caused because there was no filename for the screenshot, and I wasn't handling that.

Should be ok now

qburst-hari commented 6 years ago

Issue not yet fixed. Still getting error " Channel closed "

image

qburst-hari commented 6 years ago

@aruiz-caritsqa , can you please check