测试NG出错
错误日志:
[Error] java.lang.NullPointerException
at cucumber.api.testng.AbstractTestNGCucumberTests.features(AbstractTestNGCucumberTests.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:55)
at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:45
我的测试跑步者设置:
@CucumberOptions(plugin = { "pretty", "html:target/cucumber", "json:target_json/cucumber.json",
"junit:taget_junit/cucumber.xml", "com.cucumber.listener.ExtentCucumberFormatter"
}
features = "C:\\AutomationNeon1\\atom\\src\\main\\features\\smascheduler\\new-schedule.feature", glue = {
"com.morrisons.automation.stepdefs.sma" })
问题是重复步骤定义方法,当我删除重复方法时它得到修复。我已经忽略了Junit日志,它也被打印出来了。