webdriverio-boneyard / wdio-cucumber-framework

A WebdriverIO v4 plugin. Adapter for Cucumber testing framework.
MIT License
77 stars 61 forks source link

Is there a way for the JSON reporter output to include the Gherkin step (i.e. Given, When , Then)? #50

Closed BrandonDBrown closed 7 years ago

BrandonDBrown commented 7 years ago

I would like the JSON output to include the Given When and Then steps. Is there a way this can be added to the JSON reporter when Cucumber is being used? If not, is there a way to add this to a custom reporter?

christian-bromann commented 7 years ago

@BrandonDBrown sure this can be added to the json reporter. Just do a PR 😉 . The reporter is not owned by us but I am sure @fijijavis won't have anything against it.

BrandonDBrown commented 7 years ago

@christian-bromann Great idea! Part of my question was asking for some help on how to add this to a custom reporter. If you have any ideas?

christian-bromann commented 7 years ago

If you have any ideas?

Just look how the json reporter is implemented and integrate the customer reporter like in here: https://github.com/webdriverio/webdriverio/blob/master/examples/wdio/wdio.customreporter.conf.js

BrandonDBrown commented 7 years ago

@christian-bromann Bingo. I have done all this, but I don't know how to access the Given, Then and When keywords to add to my custom reporter. Sorry my initial question wasn't very detailed.

christian-bromann commented 7 years ago

If you don't get the data via the event payloads we need to enhance the wdio-cucumber-framework do send that data

BrandonDBrown commented 7 years ago

Right now I am not seeing the data in the event payload. Wasn't sure if I was missing something.

christian-bromann commented 7 years ago

Wasn't sure if I was missing something.

as I said then we need to enhance the reporter to send the step name

osmolyar commented 6 years ago

@BrandonDBrown , were you able to create a custom json wdio reporter for cucumber that would at least roll up the status of each Scenario based on the states of its steps ('tests', according to the default json reporter)?