-
Notifications
You must be signed in to change notification settings - Fork 29
Cucumber Scala final output shows 0 failures even when a scenario fails #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello @rhande-mdsol , Could it be that you have multiple scenarios with the same name (in the same file), or Scenario Outlines? If so, this is is a known issue in sbt-junit interface: |
Might be worth adding a work around to detect if sbt-junit is used and act accordingly. The project seems dead. |
Or ensure the names provided to the JUnit Description are always unique. That way sbt will also be able to handle identical features, scenarios, examples, ect. Shouldn't be too much of a burden if the |
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline [#1] A scenario outline [#2] A scenario outline [#3] A scenario outline [#4] ``` The `[...]` come from JUnit 4s `Parameterized` runner which outputs similar names. And the `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Would either of you mind checking if cucumber/cucumber-jvm#2045 solves the problem. |
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Sorry Closed by mistake. |
@mpkorstanje I am using "io.cucumber" % "cucumber-core" % "5.7.0", So it is cucumber scala. Your code in cucumber/cucumber-jvm#2045 I will try publishing your code and let you know |
@rhande-mdsol Cucumber Scala is using Cucumber JVM which is the foundation for various Cucumber libraries targeting the JVM. In this case, it's the project I will also try the PR on my side but probably later today. @rhande-mdsol Do you confirm that your case is multiple scenarios with the same name in the same file, or using Scenario Outlines ? |
Hi @gaeljw , Yes, this problem happens when I have a For example : Scenario 1 => Scenario: Scenario 2 => Scenario: If Scenario 2 fails here, the final result still shows all have passed. I also tried failing a scenario without an outline (i.e. Thanks |
Thanks for confirming. cucumber/cucumber-jvm#2045 should fix the issue then. |
Individual examples do not have a unique name. And while a unique name is not required by Junit, various integrations such as sbt-junit assume this the case. By appending ` [#n]` to a scenario name it becomes unique again. So JUnit 4s output becomes: ``` A feature with scenario outlines A scenario outline #1 A scenario outline #2 A scenario outline #3 A scenario outline #4 ``` The `#n` was taken from JUnit 5 which renders examples as: ``` A feature with scenario outlines A scenario outline With some other text Example #1 Example #2 With some text Example #1 Example #2 ``` Fixes: cucumber/cucumber-jvm-scala#102
Thanks for fixing the problem. Now final result shows failure when there is a failure in scenario outline. |
Hi @rhande-mdsol , |
@ejaoua you might want to take it to Slack to discuss these kind of things, or open a new issue/discussion at least. Short answer: I don't think that's possible this way. You have to run |
I have a cucumber test suite which has some tests
I run the tests using command
And one of the cucumber tests fail an assertion and console shows
Failed scenarios:
classpath:features/my_cucumber_scenario.feature:31# <my test description>
19 Scenarios (1 failed, 18 passed)
88 Steps (1 failed, 87 passed)sts 214s
3m18.224s
But in the end the console shows
Total 80, Failed 0, Errors 0, Passed 80
Since one of the tests failed, in the final output it should have shown
Failed 1
(Or something like that). But it is showing all passed instead due to which my build on travis is not failing.How to solve this problem ? Is there a solution in cucumber ?
My dependencies are
"io.cucumber" % "cucumber-core" % "5.7.0",
"io.cucumber" % "cucumber-junit" % "5.7.0"
"io.cucumber" %% "cucumber-scala" % "5.7.0"
The text was updated successfully, but these errors were encountered: