I am running cucumber with testNG. CucumberRunner class extends AbstractTestNGCucumberTests and CucumberRunner class is specified in testNG.xml file.
If I run a simple TestNG class with testNG.xml then output for testNG results gets displayed in console i.e Total tests run, Failures, Skips as shown below:-
Test.java
package com.cucumber.test;
import org.testng.Assert;
public class Test {
@org.testng.annotations.Test
public void test() {
Assert.assertEquals(true, true);
}
}
testNG.xml:-
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TestNG" verbose="1">
<test name="TestCuke">
<classes>
<class name="com.cucumber.test.Test">
</class>
</classes>
</test>
</suite>
But when I run testNG.xml with CucumberRunner then the output for testNG results are not getting displayed in console.
testNG.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TestNG" verbose="1">
<test name="TestCuke">
<classes>
<class name="com.cucumber.test.CucumberRunner">
</class>
</classes>
</test>
</suite>
CucumberRunner.java
package com.cucumber.test;
import cucumber.api.CucumberOptions;
simport cucumber.api.testng.AbstractTestNGCucumberTests;
@CucumberOptions(tags= "@smokeTest",features="src\\newTestFile.feature")
public class CucumberRunner extends AbstractTestNGCucumberTests{
}
How to display testNG results output in console with cucumber?