Discussion:
[Cucumber] Re: [Cucumber-jvm][TestNG] How to get scenario info in testng runner
Add Reply
Chetan Dewangan
2017-11-13 19:32:16 UTC
Reply
Permalink
Raw Message
Yes I gone through those approach but I am using all different annotation
from testng like BeforeTest and BeforeSuite. I am not sure if I will be
able to combine these fixtures and what will be final affect.
I am running my cucumber test using testng runner in RunCukesByCompositionTest
style with testng hooks.
I was trying to get all the tags defined in the current scenario in
Can someone please help me, I wanted to perfom some precondition steps
for scenario which has specific tags.
@Before method, the former can be parameterized with specific
tag-expressions
<https://github.com/cucumber/cucumber/tree/master/tag-expressions> for
which it should be executed (see for instance the java-calculator-testng
example project
<https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RpnCalculatorStepdefs.java#L39>
).
Cheers
Björn
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chetan Dewangan
2017-11-27 20:04:40 UTC
Reply
Permalink
Raw Message
Is there other way (may be listener) where I can get test feature/scenario
meta data?

If I am not able to use testNG annotation with full feature then what's the
point using TestNG with cucumber JVM.
Post by Chetan Dewangan
Yes I gone through those approach but I am using all different annotation
from testng like BeforeTest and BeforeSuite. I am not sure if I will be
able to combine these fixtures and what will be final affect.
I am running my cucumber test using testng runner in RunCukesByCompositionTest
style with testng hooks.
I was trying to get all the tags defined in the current scenario in
Can someone please help me, I wanted to perfom some precondition steps
for scenario which has specific tags.
@Before method, the former can be parameterized with specific
tag-expressions
<https://github.com/cucumber/cucumber/tree/master/tag-expressions> for
which it should be executed (see for instance the java-calculator-testng
example project
<https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RpnCalculatorStepdefs.java#L39>
).
Cheers
Björn
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Björn Rasmusson
2017-12-01 20:15:43 UTC
Reply
Permalink
Raw Message
Post by Chetan Dewangan
Is there other way (may be listener) where I can get test feature/scenario
meta data?
If I am not able to use testNG annotation with full feature then what's
the point using TestNG with cucumber JVM.
It has never been the intention of the TestNG runner (or JUnit runner) of
Cucumber-JVM to transform Cucumber scenarios into TestNG test (or JUnit
test). They can be used to trigger the execution of Cucumber-JVM, and
provide notifications back to the TestNG (or JUnit) domain about the
results of the execution of the Cucumber-JVM scenarios (test cases). Still
Cucumber-JVM and TestNG (or JUnit) belong to different domains.
Cucumber-JVM does not know about the TestNG (or JUnit) domain. TestNG (or
JUnit) does not know about the Cucumber-JVM domain.

Cucumber-JVM has annotations to define hook method in the glue classes (
@cucumber.api.java.Before/After) which can and should be used for set up
and tear down. Technically it might be possible to also use TestNG (or
JUnit) mechanisms like @org.testng.annotations.BeforeMethod or (
@org.junit.BeforeClass) but, since they live in the TestNG (or JUnit) they
does not know about the Cucumber-JVM domain. Also by relying on TestNG (or
JUnit) mechanism you are blocking yourself from the opportunity to run
individual features from the Eclipse or IntelliJ IDE's, both have plugins
to edit and run Cucumber-JVM feature files, and both rely on the command
line runner of Cucumber-JVM for executing individual feature files.

Having said that, Cucumber-JVM is a community maintained open-source
software, you are welcome to provide a pull-request with improvements to
the TestNG runner of Cucumber-JVM.

Cheers
Björn
Post by Chetan Dewangan
Post by Chetan Dewangan
Yes I gone through those approach but I am using all different annotation
from testng like BeforeTest and BeforeSuite. I am not sure if I will be
able to combine these fixtures and what will be final affect.
I am running my cucumber test using testng runner in RunCukesByCompositionTest
style with testng hooks.
I was trying to get all the tags defined in the current scenario in
Can someone please help me, I wanted to perfom some precondition steps
for scenario which has specific tags.
@Before method, the former can be parameterized with specific
tag-expressions
<https://github.com/cucumber/cucumber/tree/master/tag-expressions> for
which it should be executed (see for instance the java-calculator-testng
example project
<https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RpnCalculatorStepdefs.java#L39>
).
Cheers
Björn
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chetan Dewangan
2017-12-07 21:37:53 UTC
Reply
Permalink
Raw Message
Thanks for the explanation Bjorn.

I was using testNG because I have various setup and teardown to be done at
different level of test (@Method, @Class, @Suite and @Test).

But finally I got it, its not possible, I will look for another approach.
Thanks again.
Post by Björn Rasmusson
Post by Chetan Dewangan
Is there other way (may be listener) where I can get test
feature/scenario meta data?
If I am not able to use testNG annotation with full feature then what's
the point using TestNG with cucumber JVM.
It has never been the intention of the TestNG runner (or JUnit runner) of
Cucumber-JVM to transform Cucumber scenarios into TestNG test (or JUnit
test). They can be used to trigger the execution of Cucumber-JVM, and
provide notifications back to the TestNG (or JUnit) domain about the
results of the execution of the Cucumber-JVM scenarios (test cases). Still
Cucumber-JVM and TestNG (or JUnit) belong to different domains.
Cucumber-JVM does not know about the TestNG (or JUnit) domain. TestNG (or
JUnit) does not know about the Cucumber-JVM domain.
Cucumber-JVM has annotations to define hook method in the glue classes (
@cucumber.api.java.Before/After) which can and should be used for set up
and tear down. Technically it might be possible to also use TestNG (or
@org.junit.BeforeClass) but, since they live in the TestNG (or JUnit)
they does not know about the Cucumber-JVM domain. Also by relying on TestNG
(or JUnit) mechanism you are blocking yourself from the opportunity to run
individual features from the Eclipse or IntelliJ IDE's, both have plugins
to edit and run Cucumber-JVM feature files, and both rely on the command
line runner of Cucumber-JVM for executing individual feature files.
Having said that, Cucumber-JVM is a community maintained open-source
software, you are welcome to provide a pull-request with improvements to
the TestNG runner of Cucumber-JVM.
Cheers
Björn
Post by Chetan Dewangan
Post by Chetan Dewangan
Yes I gone through those approach but I am using all different
annotation from testng like BeforeTest and BeforeSuite. I am not sure if I
will be able to combine these fixtures and what will be final affect.
I am running my cucumber test using testng runner in RunCukesByCompositionTest
style with testng hooks.
I was trying to get all the tags defined in the current scenario in
Can someone please help me, I wanted to perfom some precondition steps
for scenario which has specific tags.
@Before method, the former can be parameterized with specific
tag-expressions
<https://github.com/cucumber/cucumber/tree/master/tag-expressions> for
which it should be executed (see for instance the java-calculator-testng
example project
<https://github.com/cucumber/cucumber-jvm/blob/master/examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RpnCalculatorStepdefs.java#L39>
).
Cheers
Björn
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'sridevi ennam' via Cukes
2017-12-06 08:57:36 UTC
Reply
Permalink
Raw Message
I am running my cucumber test using testng runner in RunCukesByCompositionTest
style with testng hooks.
I was trying to get all the tags defined in the current scenario in testNG
@Before method.
Can someone please help me, I wanted to perfom some precondition steps
for scenario which has specific tags.
--
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
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 the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...