Code Monkey home page Code Monkey logo

Comments (12)

gaeljw avatar gaeljw commented on June 17, 2024 1

@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 testOnly SomeClass where SomeClass targets only some features file.

from cucumber-jvm-scala.

gaeljw avatar gaeljw commented on June 17, 2024

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:
sbt/junit-interface#84. See also #22

from cucumber-jvm-scala.

mpkorstanje avatar mpkorstanje commented on June 17, 2024

Might be worth adding a work around to detect if sbt-junit is used and act accordingly. The project seems dead.

from cucumber-jvm-scala.

mpkorstanje avatar mpkorstanje commented on June 17, 2024

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 #n suffix only shows up when necessary.

from cucumber-jvm-scala.

mpkorstanje avatar mpkorstanje commented on June 17, 2024

Would either of you mind checking if cucumber/cucumber-jvm#2045 solves the problem.

from cucumber-jvm-scala.

rhande-mdsol avatar rhande-mdsol commented on June 17, 2024

Sorry Closed by mistake.

from cucumber-jvm-scala.

rhande-mdsol avatar rhande-mdsol commented on June 17, 2024

@mpkorstanje I am using

"io.cucumber" % "cucumber-core" % "5.7.0",
"io.cucumber" % "cucumber-junit" % "5.7.0"
"io.cucumber" %% "cucumber-scala" % "5.7.0"

So it is cucumber scala. Your code in cucumber/cucumber-jvm#2045
seems to be Java code. Can I use it ?

I will try publishing your code and let you know

from cucumber-jvm-scala.

gaeljw avatar gaeljw commented on June 17, 2024

@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 cucumber-junit that you could try to build on your own with the PR mentioned by @mpkorstanje and use in your 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 ?

from cucumber-jvm-scala.

rhande-mdsol avatar rhande-mdsol commented on June 17, 2024

@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 cucumber-junit that you could try to build on your own with the PR mentioned by @mpkorstanje and use in your 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 Scenario Outline: and then have a table like structure in Examples: section. For me 3rd example actually failed, but final result showed all tests passed.
Also this happens when you have a Step with parameterized value and reuse the step in the same Feature file at multiple places.

For example :

Scenario 1 =>

Scenario:
Given I know "Java"
Then I teach "Java"

Scenario 2 =>

Scenario:
Given I know "Scala"
Then I teach "Scala"

If Scenario 2 fails here, the final result still shows all have passed.

I also tried failing a scenario without an outline (i.e. Scenario:) in this case final result shows failures properly.

Thanks

from cucumber-jvm-scala.

gaeljw avatar gaeljw commented on June 17, 2024

Thanks for confirming.

cucumber/cucumber-jvm#2045 should fix the issue then.
You just have to wait a bit for the next cucumber-junit release (you'll have to update to 6.x but the upgrade from 5.x to 6.x is pretty easy).

from cucumber-jvm-scala.

rhande-mdsol avatar rhande-mdsol commented on June 17, 2024

Thanks for fixing the problem. Now final result shows failure when there is a failure in scenario outline.

from cucumber-jvm-scala.

ejaoua avatar ejaoua commented on June 17, 2024

Hi @rhande-mdsol ,
can you please share what was the plugin and/or correct syntax that you used to run one test of Cucumber :
sbt "testOnly <cucumber_class_name>".
I tried the following but it didn't work out sbt "testOnly *classpath:features/folder1/endpoint.feature
Thanks.

from cucumber-jvm-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.