我不得不错误地运行maven-clean命令,并清理目标报告文件夹。现在,如果我构建并运行我的功能文件,就会出现以下错误。我如何解决这个问题?
顺便说一句,我使用的是空手道版本0.9.0(尽管它可能并不依赖于此)
此外,如果导致以下问题,我该如何清理报告文件夹?
19:07:59.921 [main] INFO com.intuit.karate.Runner - Karate version: 0.9.0
Karate version: 0.9.0
======================================================
elapsed: 0.01 | threads: 5 | thread time: 0.00
features: 0 | ignored: 0 | efficiency: 0.00
scenarios: 0 | passed: 0 | failed: 0
======================================================
Dec 13, 2018 7:08:00 PM net.masterthought.cucumber.ReportBuilder generateErrorPage
INFO: Unexpected error
net.masterthought.cucumber.ValidationException: No report file was added!
at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:58)
at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:88)
at PP1.RunnerClasses.Validationrunner.generateReport(Validationrunner.java:45)
at PP1.RunnerClasses.Validationrunner.testParallel(Validationrunner.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
19:08:00.696 [main] DEBUG org.apache.velocity - CommonsLogLogChute name is 'org.apache.velocity'
19:08:00.696 [main] DEBUG org.apache.velocity - Initializing Velocity, Calling init()...
19:08:00.697 [main] DEBUG org.apache.velocity - Starting Apache Velocity v1.7 (compiled: 2010-11-19 12:14:37)
19:08:00.697 [main] DEBUG org.apache.velocity - Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
19:08:00.697 [main] DEBUG org.apache.velocity - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
19:08:00.697 [main] DEBUG org.apache.velocity - Target log system for org.apache.velocity.runtime.log.AvalonLogChute is not available (java.lang.NoClassDefFoundError: org/apache/log/format/Formatter). Falling back to next log system...
19:08:00.697 [main] DEBUG org.apache.velocity - Trying to use logger class org.apache.velocity.runtime.log.Log4JLogChute
19:08:00.699 [main] DEBUG org.apache.velocity - Target log system for org.apache.velocity.runtime.log.Log4JLogChute is not available (java.lang.NoClassDefFoundError: org/apache/log4j/Layout). Falling back to next log system...
19:08:00.700 [main] DEBUG org.apache.velocity - Trying to use logger class org.apache.velocity.runtime.log.CommonsLogLogChute
19:08:00.700 [main] DEBUG org.apache.velocity - Using logger class org.apache.velocity.runtime.log.CommonsLogLogChute
19:08:00.709 [main] DEBUG org.apache.velocity - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:00.735 [main] DEBUG org.apache.velocity - ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl) with class java.util.Collections$SynchronizedMap cache map.
19:08:00.738 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Stop
19:08:00.740 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Define
19:08:00.742 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Break
19:08:00.744 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Evaluate
19:08:00.746 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Literal
19:08:00.749 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Macro
19:08:00.753 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Parse
19:08:00.757 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Include
19:08:00.761 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
19:08:00.874 [main] DEBUG org.apache.velocity - Created '20' parsers.
19:08:00.889 [main] DEBUG org.apache.velocity - Velocimacro : "velocimacro.library" is not set. Trying default library: VM_global_library.vm
19:08:00.890 [main] DEBUG org.apache.velocity - Could not load resource 'VM_global_library.vm' from ResourceLoader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader: ClasspathResourceLoader Error: cannot find resource VM_global_library.vm
19:08:00.890 [main] DEBUG org.apache.velocity - Velocimacro : Default library not found.
19:08:00.890 [main] DEBUG org.apache.velocity - Velocimacro : allowInline = true : VMs can be defined inline in templates
19:08:00.890 [main] DEBUG org.apache.velocity - Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
19:08:00.890 [main] DEBUG org.apache.velocity - Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
19:08:00.890 [main] DEBUG org.apache.velocity - Velocimacro : autoload off : VM system will not automatically reload global library macros
19:08:01.243 [main] DEBUG org.apache.velocity - ResourceManager : found templates/generators/errorpage.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.258 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/headers.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.259 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/head.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.265 [main] DEBUG org.apache.velocity - Velocimacro : added VM stringArray: source=/templates/macros/array.js.vm
19:08:01.265 [main] DEBUG org.apache.velocity - Velocimacro : added VM numberArray: source=/templates/macros/array.js.vm
19:08:01.265 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/array.js.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.269 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeBuildInfo: source=/templates/macros/page/buildinfo.vm
19:08:01.270 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/page/buildinfo.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.278 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeClassifications: source=/templates/macros/page/classifications.vm
19:08:01.278 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/page/classifications.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.280 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeLead: source=/templates/macros/page/lead.vm
19:08:01.280 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/page/lead.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.286 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeNavigation: source=/templates/macros/page/navigation.vm
19:08:01.286 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/page/navigation.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.291 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeReportInfo: source=/templates/macros/page/reportInfo.vm
19:08:01.292 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/page/reportInfo.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.295 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeTitle: source=/templates/macros/page/title.vm
19:08:01.295 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/page/title.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.304 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeExpandingButtons: source=/templates/macros/report/expandAllButtons.vm
19:08:01.304 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/report/expandAllButtons.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.312 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeReportTable: source=/templates/macros/report/reportTable.vm
19:08:01.313 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/report/reportTable.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.318 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeReportHeader: source=/templates/macros/report/reportHeader.vm
19:08:01.318 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/report/reportHeader.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.327 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeStatsTable: source=/templates/macros/report/statsTable.vm
19:08:01.327 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/report/statsTable.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.330 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeBrief: source=/templates/macros/json/brief.vm
19:08:01.330 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/brief.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.335 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeDocString: source=/templates/macros/json/docstring.vm
19:08:01.337 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/docstring.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.342 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeDuration: source=/templates/macros/json/duration.vm
19:08:01.342 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/duration.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.347 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeElement: source=/templates/macros/json/element.vm
19:08:01.347 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/element.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.385 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeEmbeddings: source=/templates/macros/json/embeddings.vm
19:08:01.386 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeHtmlEmbedding: source=/templates/macros/json/embeddings.vm
19:08:01.387 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeImageEmbedding: source=/templates/macros/json/embeddings.vm
19:08:01.388 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeImageReferenceEmbedding: source=/templates/macros/json/embeddings.vm
19:08:01.388 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeTextEmbedding: source=/templates/macros/json/embeddings.vm
19:08:01.389 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeUnknownEmbedding: source=/templates/macros/json/embeddings.vm
19:08:01.389 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/embeddings.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.392 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeHooks: source=/templates/macros/json/hooks.vm
19:08:01.392 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/hooks.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.397 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeOutput: source=/templates/macros/json/output.vm
19:08:01.397 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/output.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.401 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeMessage: source=/templates/macros/json/message.vm
19:08:01.401 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/message.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.406 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeSteps: source=/templates/macros/json/steps.vm
19:08:01.406 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/steps.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.409 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeStepName: source=/templates/macros/json/stepName.vm
19:08:01.409 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/stepName.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.412 [main] DEBUG org.apache.velocity - Velocimacro : added VM includeTags: source=/templates/macros/json/tags.vm
19:08:01.413 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/macros/json/tags.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
19:08:01.440 [main] DEBUG org.apache.velocity - VM #includeNavigation: too few arguments to macro. Wanted 1 got 0
19:08:01.442 [main] DEBUG org.apache.velocity - Left side ($active_tab) of '==' operation has null value. If it is a reference, it may not be in the context or its toString() returned null. /templates/macros/page/navigation.vm[line 14, column 51]
19:08:01.442 [main] DEBUG org.apache.velocity - Left side ($active_tab) of '==' operation has null value. If it is a reference, it may not be in the context or its toString() returned null. /templates/macros/page/navigation.vm[line 15, column 51]
19:08:01.442 [main] DEBUG org.apache.velocity - Left side ($active_tab) of '==' operation has null value. If it is a reference, it may not be in the context or its toString() returned null. /templates/macros/page/navigation.vm[line 16, column 51]
19:08:01.443 [main] DEBUG org.apache.velocity - Left side ($active_tab) of '==' operation has null value. If it is a reference, it may not be in the context or its toString() returned null. /templates/macros/page/navigation.vm[line 20, column 51]
19:08:01.465 [main] DEBUG org.apache.velocity - Null reference [template 'templates/generators/errorpage.vm', line 23, column 85] : $build_number cannot be resolved.
19:08:01.465 [main] DEBUG org.apache.velocity - Null reference [template 'templates/generators/errorpage.vm', line 23, column 85] : $build_number cannot be resolved.
19:08:01.480 [main] DEBUG org.apache.velocity - ResourceManager : found /templates/footer.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
我的跑步者文件
@Test
void testParallel() {
Results results = Runner.path("classpath:conduitApp")
.outputCucumberJson(true)
.tags("~@ignore").parallel(5);
generateReport(results.getReportDir());
assertEquals(0, results.getFailCount(), results.getErrorMessages());
}
请注意,在Runner“builder”上调用outputCucumberJson(true)使其工作。
解决了我自己;使用了karate-junit4而不是之前在.pom文件中使用的karate-junit5。
但是,我仍然不明白如果我使用junit5,为什么会导致此错误!
试试这个,对空手道1.0.1版本有效
/**
* Use this method if you want to execute entire feature files available in any folder.
*/
@Test
public void runMultipleFeatureFiles() {
System.setProperty("karate.env", "qa");
Results results = Runner.builder().outputCucumberJson(true)
.path("classpath:features/apitests/testFeatures").tags("~@Ignore").parallel(2);
Assertions.assertEquals(0, results.getFailCount());
generateReport(results.getReportDir());
}
/**
* Generate test case execution report post-execution.
*
* @param karateOutputPath - directory where you want to keep a report of test case executions.
*/
public static void generateReport(String karateOutputPath) {
Collection<File> jsonFiles =
FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
List<String> jsonPaths = new ArrayList<String>(jsonFiles.size());
jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
Configuration config = new Configuration(new File("target"), "ReqRes.in SampleAPI Testing");
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
在Pom.xml中添加以下maven依赖项:
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
问题内容: 我正在使用詹金斯(Jenkins)来进行将maven与黄瓜配合使用的工作。我的工作顺利进行。我还用jenkins管理了插件Cucumber报告。但是当我查看报告时,我收到如下图所示的消息。 我尝试安装各种插件,例如Jenkins插件,独立但没有任何乐趣。这些在选项的右下方显示为选项。 任何线索都是有帮助的。我也尝试过检查stackover流中的此错误。我没有任何线索 我可以看到由sur
我试图将空手道测试的json结果导入到AssertThat Jira插件中。 导入在cucumber js 5.1.0中运行良好,但在karate 0.9.2中失败 问题似乎在于断言在json中使用特性的“name”与其内部特性名称相关,以及karate和cucumber js使用“name”和“description”字段的方式不同。 Cucumber js使用特性文件本身的特性名称,例如,带有
但是,当看到html报告时,这一个显示5分钟的执行时间,在控制台里说是2.5分钟。 我们在sunfire报告中发现,特性son、调用web服务的步骤延迟了30 ms,但调用此特性son的步骤也有30 ms。60毫秒也是如此。 > 呼叫(feature Son.feature)30ms 对不起,我的英语不好。谢谢你的帮助
我的POM现在看起来像, 这将生成一个报告,但仅使用最后一个功能。我有多个跑步者,所以我试图找出: A.如何将多个JSON组合成一个报告或 B.当每个测试完成时,我如何附加到一个JSON文件上? 这两种方法似乎都是可行的解决方案,但我更喜欢一种,因为我在pom.xml中似乎只遗漏了一行,因为我目前已经生成了多个JSON文件
我正在从. jasper文件加载jasper报告文件以提高性能,如下所示。 但是我现在有一个要求,动态形成的查询必须设置为. jasper(编译)文件。有没有办法做同样的事情?
extentX看起来是完美的解决方案,是一组测试结果。 然而,我已经按照所有的说明进行了操作,并将所有内容都设置好并运行起来,但测试信息似乎没有到达扩展页。 它是空的。我可以从仪表板上看到测试已经运行,但项目是默认的,单击它们不会显示任何信息,但我可以看到它正在获取一些数据,因为它显示了已经运行了多少测试以及通过了多少信息。 有什么明显的我做错了吗? 我可以看到标准的数据块报告工作得很好,但它似乎