我的测试套件工作正常,直到它使用版本 0.9.2。
我有一个带有 KarateOptions 的测试运行程序来指定要执行的功能文件
@KarateOptions(tags = {"~@ignore"},
features = {
"src/test/java/com/pro/api/tests/features/beforesuitescenarios/feature1.feature",
"src/test/java/com/pro/api/tests/features/customerscenarios/feature2.feature",
"src/test/java/com/pro/api/tests/features/servicerequestscenarios/feature3.feature",
"src/test/java/com/pro/api/tests/features/invoicescenarios/feature4.feature",
})
测试运行程序使用的是黄瓜运行程序,
@Test
public void testAllFeatures() throws Exception {
String karateOutputPath = "target/surefire-reports";
KarateStats stats = CucumberRunner.parallel(getClass(), 1, karateOutputPath);
generateReport(karateOutputPath);
assertTrue("There are scenario failures", stats.getFailCount() == 0);
}
我尝试将框架升级到 0.9.5 并修改了运行程序,就像最新文档中提到的那样,
@Test
public void testAllFeatures() throws Exception {
String karateOutputPath = "target/surefire-reports";
Results stats = Runner.parallel(getClass(), 1, karateOutputPath);
generateReport(karateOutputPath);
assertTrue("There are scenario failures", stats.getFailCount() == 0);
}
现在,当我执行这个套件时,测试正在正确执行。但是在所有功能文件的测试执行完成后,它会抛出该行的错误
结果统计 = Runner.parallel(getClass(), 1, karateOutputPath);
对于以下 IllegalArgumentException,
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1,295.291 s <<<
FAILURE! - in com.pro.api.tests.features.TestRunner
[ERROR] testAllFeatures(com.pro.api.tests.features.TestRunner) Time elapsed: 1,295.22 s
<<< ERROR!
java.lang.IllegalArgumentException: Illegal group reference
at com.pro.api.tests.features.TestRunner.testAllFeatures(TestRunner.java:55)
我在给跑步者打电话时错过了什么?如何解决这个问题?
四季花海
相关分类