0 | I am Unsure how to launch the runner class within Eclipse using AbstractTestNGCucumberTests I have a project set up, intended to use TestNG to run a Cucumber test suite. I have followed all the steps in all the docs I can find, but I am unable to launch the runner in a manner which recognizes the testNG annotations in the class, such as @BeforeMethod The project runs fine as a Junit test if I uncomment the @RunWith line in the runner class, but when I comment the @RunWith, then it does not launch as a TestNG project, and still behaves as a junit project. If I select the CukesRunner an click "Run-As" there is no run type displayed, and I can only select to run it as Junit from the history record. I can find no way of launching the Cukesrunner such that it invokes the TestNG behavior of the AbstractTestNGCucumberTests class. The TestNG plugin is working fine on this system, testNG enable projects run fine when they do not include the cucumber nor AbstractTestNGCucumberTests class. Here are the key components of the project: testng.xml
pom.xml
CukesRunner.java
GameSteps.java
Game.feature
Attached is a screenshot of the project structure: |
http://sahajamit.github.io/Cucumber-JVM-with-TestNG/
Hope this might help you..
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/90uy0n5FVgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+unsubscribe@googlegroups.com.
Hi Krishna,I have already read that article, but it is rather confusing and conflicts with other articles I have seen on the internet.For example, it shows an @RunWith annotation in the runner class, and I believe that is not correct, based on other posts i have seen, since it is a Junit annotation.Also, the article does not explain how to launch nor invoke the runner from within Eclipse [or any other IDE]....So no, I am afraid that article does not help at all....Any other pointers ?from Charles F Radley
Associate Fellow AIAA
Yahoo = CFRJLR
Skype = CFRJLR
Landline - voip - ooma - phone = +1-503-922-1012
Mobile cell: +1-360-773-2595 BoostOn Sat, Aug 20, 2016 at 11:05 PM, Krishna Gundala <gmk....@gmail.com> wrote:http://sahajamit.github.io/Cucumber-JVM-with-TestNG/
Hope this might help you..
On Sat, Aug 20, 2016, 6:26 PM Charles Radley <cfr...@gmail.com> wrote:
Greetings,I have posted this question on Stackoverflow site:
0I am Unsure how to launch the runner class within Eclipse using AbstractTestNGCucumberTests
I have a project set up, intended to use TestNG to run a Cucumber test suite.
I have followed all the steps in all the docs I can find, but I am unable to launch the runner in a manner which recognizes the testNG annotations in the class, such as @BeforeMethod
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/90uy0n5FVgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
Hi Björn, Thanks for your reply it is very helpful.
0I am Unsure how to launch the runner class within Eclipse using AbstractTestNGCucumberTests
I have no idea what Eclipse use to determine that a class should have a "run as" option for TestNG.
I have a project set up, intended to use TestNG to run a Cucumber test suite.
I have followed all the steps in all the docs I can find, but I am unable to launch the runner in a manner which recognizes the testNG annotations in the class, such as @BeforeMethod
The TestNG module of Cucumber-JVM is intended to make it possible to just to start Cucumber features from a TestNG runner, you should never use the TestNG annotations like @BeforeMethod in step definition classes (like the GameSteps class below), but Cucumber-JVM annotations like @cucumber.api.java.Before instead.
This email has been checked for viruses by Avast antivirus software.
|
Hi Krishna,I have already read that article, but it is rather confusing and conflicts with other articles I have seen on the internet.
For example, it shows an @RunWith annotation in the runner class, and I believe that is not correct, based on other posts i have seen, since it is a Junit annotation.
Also, the article does not explain how to launch nor invoke the runner from within Eclipse [or any other IDE]....
Thanks Paolo.
You might want to take a look at the official example that is much simpler: https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator-testng
For example, it shows an @RunWith annotation in the runner class, and I believe that is not correct, based on other posts i have seen, since it is a Junit annotation.
Yes, it shows the @RunWith annotation but that code is introduced by this sentence: "With JUnit, the integration is quite straight forward, we simply need to create a test runner class like this".
Also, the article does not explain how to launch nor invoke the runner from within Eclipse [or any other IDE]....
Hope you have a build system (Maven, Gradle, ...) to verify that the code you wrote runs correctly before trying the IDE integration. Or you can try and run an existing working example in the IDE, like the Java Calculator TestNG above.
If you do both at the same time you won't know which part you are getting wrong :-)
Hi Paolo,
You might want to take a look at the official example that is much simpler: https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator-testng
Hope you have a build system (Maven, Gradle, ...) to verify that the code you wrote runs correctly before trying the IDE integration. Or you can try and run an existing working example in the IDE, like the Java Calculator TestNG above.
This email has been checked for viruses by Avast antivirus software.
|
Hi Paolo,
On 8/22/2016 2:58 AM, Paolo Ambrosio wrote:
From Paolo:
You might want to take a look at the official example that is much simpler: https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator-testng
Hope you have a build system (Maven, Gradle, ...) to verify that the code you wrote runs correctly before trying the IDE integration. Or you can try and run an existing working example in the IDE, like the Java Calculator TestNG above.
I use Maven.
I can run the example successfully at the command line, see transcript below.
How do I now run this in the Eclispe IDE ?
Hi Paolo and co,
On 8/22/2016 2:58 AM, Paolo Ambrosio wrote:
From Paolo:
> > You might want to take a look at the official example that is much > simpler: > https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator-testng > > >
The example project above does not include any testng.xml file.....
Does that mean I do not need a testng.xml file in my cucumber testng projects ?
Is the testng.xml required ? Is it optional? Has it been recently deprecated ?
Should I ignore the various blog posts which talk about using a testng.xml file with cucumber ?
Charles Radley wrote:
Hi Paolo,
On 8/22/2016 2:58 AM, Paolo Ambrosio wrote:
From Paolo:
You might want to take a look at the official example that is much simpler: https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator-testng
I use Maven.
I can run the example successfully at the command line, see transcript below.
How do I now run this in the Eclispe IDE ?
The java-calculator-testng exemplifies several variants for runner classes to start Cucumber-JVM from TestNG, so right-clicking on:
https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RunCukesTest.java
https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RunCukesByCompositionTest.java
https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RunCukesByFeatureAndCompositionTest.java
and selecting the appropriate "run-as" option I guess.
Björn