Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Not all cucumber data is added to the reporter #133

Closed
wswebcreation opened this issue Jul 3, 2018 · 2 comments
Closed

Not all cucumber data is added to the reporter #133

wswebcreation opened this issue Jul 3, 2018 · 2 comments

Comments

@wswebcreation
Copy link
Contributor

wswebcreation commented Jul 3, 2018

When using CucumberJS standalone you can get an very comprehensive JSON report containing more info than wdio-cucumber-framework is providing.

I miss for example the following data when I try to build my own reporter:

  • The Given|When|Then keywords
  • feature descriptions
  • datatable data

The data itself can be retrieved from the reporter with for example the following feature

Feature: Create data feature
    This is a feature description

    Scenario: a table scenario
        This should be a scenario description
        Given a table step
            | Cucumber     | Cucumis sativus |
            | Burr Gherkin | Cucumis anguria |

When I place some logs in the reporter.js I see I get the data

handleBeforeFeature
feature =  { type: 'Feature',
  tags: [],
  location: { line: 2, column: 1 },
  language: 'en',
  keyword: 'Feature',
  name: 'Create data feature',
  description: '    This is a feature description',
  children: 
   [ { type: 'Scenario',
       tags: [],
       location: [Object],
       keyword: 'Scenario',
       name: 'a table scenario',
       description: '        This should be a scenario description',
       steps: [Array] } ] }

handleBeforeScenario
scenario =  { tags: [],
  name: 'a table scenario',
  language: 'en',
  locations: [ { line: 5, column: 5 } ],
  steps: 
   [ { text: 'a table step', arguments: [Array], locations: [Array] } ] }

handleBeforeStep
step =  { type: 'Hook',
  location: 
   { line: 90,
     column: 0,
     uri: 'Projects/wdio-multiple-cucumber-html-reporter/node_modules/cucumber/src/support_code_library_builder/define_helpers.js' },
  keyword: 'Hook',
  text: '' }

handleBeforeStep
step =  { type: 'Step',
  location: { line: 7, column: 9 },
  keyword: 'Given ',
  text: 'a table step',
  argument: 
   { type: 'DataTable',
     location: { line: 8, column: 13 },
     rows: [ [Object], [Object] ] } }

handleBeforeStep
step =  { type: 'Hook',
  location: 
   { line: 90,
     column: 0,
     uri: 'Projects/wdio-multiple-cucumber-html-reporter/node_modules/cucumber/src/support_code_library_builder/define_helpers.js' },
  keyword: 'Hook',
  text: '' }

Is there a reason to not expose this data? And if not, do you also allow a PR to add that data? It would help a lot making more readable reports.

Tnx in advance

@wswebcreation
Copy link
Contributor Author

Status update:
Started with the initial setup. Reporter is already adjusted, now need to add some tests and make a PR, see https://github.com/wswebcreation/wdio-cucumber-framework/blob/feature/enrich-reporter/lib/reporter.js

@wswebcreation
Copy link
Contributor Author

This has been fixed with #136 and released in version 2.2.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants