badeball / cypress-cucumber-preprocessor

Run cucumber/gherkin-syntaxed specs with Cypress
MIT License
1.32k stars 149 forks source link

Configurable JUnit test case separator #424

Closed maximegel closed 2 years ago

maximegel commented 4 years ago

Current behavior

JUnit reporter (and perhaps other reporters) generate test cases such as [Feature] [Scenario] (i.e. with a single space separator) which makes it hard to distinguish both parts e.g. Another feature Runs first scenario:

Not shure if it's related to this library or Cypress itself.

<testsuite name="Another feature" timestamp="2020-07-31T16:49:37" tests="2" time="26.7660" failures="0">
    <testcase name="Another feature Runs first scenario" time="13.0000" classname="Runs first scenario">
    </testcase>
    <testcase name="Another feature Runs second scenario" time="13.7660" classname="Runs second scenario">
    </testcase>
</testsuite>

Desired behavior

A configuration option would be great. I am thinking of something like:

"cypress-cucumber-preprocessor": {
  "testCaseTitleSeparatedBy": " - "
}

And the report would be:

<testsuite name="Another feature" timestamp="2020-07-31T16:49:37" tests="2" time="26.7660" failures="0">
    <testcase name="Another feature - Runs first scenario" time="13.0000" classname="Runs first scenario">
    </testcase>
    <testcase name="Another feature - Runs second scenario" time="13.7660" classname="Runs second scenario">
    </testcase>
</testsuite>

Test code to reproduce

Versions

markbirbeck commented 4 years ago

As luck would have it, I've just been reading the JUnit Reporter docs whilst looking for something else, and I think I saw what you need. The option suiteTitleSeparatedBy looks about right:

https://github.com/michaelleeallen/mocha-junit-reporter#full-configuration-options

badeball commented 2 years ago

Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.

Read more about the transfer of ownership here.

The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.