我正在尝试在黄瓜中使用 testNG 框架。但低于错误。
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD FAILURE
[INFO] Total time: 8.032 s
[INFO] Finished at: 2016-08-02T16:11:29+05:30
[INFO] Final Memory: 18M/220M
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project TestCaseAPI: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR]
[ERROR] Cannot instantiate class com.XXX.automation.feature.RunCuke1Test
[ERROR] at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:40)
我的跑步者课程如下:
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import cucumber.api.testng.AbstractTestNGCucumberTests;
@RunWith(Cucumber.class)
@CucumberOptions (features = "src/test/resources/feature"
,glue="com.XXX.automation.feature"
,monochrome=true
)
public class RunCuke1Test extends AbstractTestNGCucumberTests {
}
我的 testNG.xml 如下所示
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test diary">
<classes>
<class name="com.XXX.automation.feature.RunCuke1Test"/>
</classes>
</test>
</suite>
我正在通过 Maven 运行它
谁能告诉我我在这里做错了什么?