-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
'mvn test' doesn't run tests with maven-surefire-plugin version 3.0.0-M4 when having cucumber 4.8.0 version #2120
Comments
Could you maybe share your pom please?
How are you launching your Cucumber tests? Do you have a Java class with the Cucumber runner? (like the |
By using below command i was trying to execute my tests: mvn -f D:\NisumAutomationPlatform%Project_PATH%\pom.xml test -DargLine="-Ddc.platformName=Windows -Ddc.browserName=chrome -DtestType=PC -DElementWaitTimeoutInSeconds=30 -Dcucumber.options='--tags @regression'" And below are my pom dependencies: junit junit 4.12 io.cucumber cucumber-core 4.4.0 io.cucumber cucumber-testng 4.4.0 io.cucumber cucumber-java 4.4.0 io.cucumber cucumber-junit 4.4.0 io.cucumber cucumber-jvm 4.4.0 pom net.javacrumbs.json-unit json-unit-assertj 2.7.0 |
My TestRunner.Java import cucumber.api.CucumberOptions; //@RunWith(Cucumber.class) } |
issue is resolved after adding |
Once I'll update the cucumber version to 4.8.0 and provide a final update |
👍 Btw, just be aware that this repository (and therefore this issue tracker) is only dedicated to JUnit 5, I see that you are using JUnit 4 😉 |
Thank you all.. The issue is fixed after adding cucumber-testng in project pom. |
@juliette-derancourt I had exactly this issue and solved exactly as @ramareddy88. In case any of you you could explain what's wrong I would be glad. Why I need testing to run unit/cucumber tests via maven? |
I honnestly have no clue. @junit-team/junit-lambda Any ideas? |
@UrbanNomadIT I'm not sure what you're asking. It sounds like @ramareddy88 wasn't using JUnit but TestNG to run the Cucumber tests, or am I missing sth.? |
There are several inconsistencies in the information that has been provided that make the problem untraceable. I'd recommend that anybody facing the same problem first decides if they want to use Cucumber with TestNG, JUnit 4 or JUnit 5. If you are unsure which one to choose, pick the one you use for the other tests in your project. If you do not have other test, default to JUnit 4. After this, make sure the non-chosen integrations are not present. This means that a project should have either |
@mpkorstanje Thanks for the detailed explanation! 👍 |
I also resolved the same issue by removing testng from the pom.xml file. But if I have to use testNG to make the test parallel then how can we use that? |
the same |
When my project pom contains below build configuration and parent pom has cucumber-4.8.0 version:
org.apache.maven.plugins
maven-surefire-plugin
3.0.0-M4
When I execute mvn test command it is not able to read runner.java class and it is also not able to read .features.
Always it returns:
Running TestRunner Tests run: 0
The text was updated successfully, but these errors were encountered: