本文介绍了在Maven的集成测试阶段是否可以运行空手道测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Maven的集成测试阶段是否有运行空手道测试的方法?看来surefire插件已硬编码到Karate中.我尝试使用故障安全插件覆盖它,但是没有运气.我不希望测试与单元测试一起运行.

Is there a way to run Karate test during maven's integration test phase? It seems that surefire plugin is hardcoded into Karate. I have tried to override it using failsafe plugin but with no luck. I don't want test to run along with unit tests.

提前谢谢!

推荐答案

我不确定您从哪里得到的印象,但是不,surefire插件没有硬编码到空手道中.

I'm not sure where you got that impression, but no, the surefire plugin is not hardcoded into Karate.

请记住,通过surefire进行 not 运行JUnit测试的最简单方法是 not 使用*Test.java命名约定.

Keep in mind that the simplest way to not run a JUnit test via surefire is to not use the *Test.java naming convention.

我认为为您提供的解决方案很简单,无论JUnit测试是空手道测试的入口点"(建议使用并行流水)-只需使用故障安全命名约定.

I think the solution for you is simple, whichever JUnit test is the "entry-point" for your Karate tests (the parallel runner is recommended) - just use the failsafe naming conventions.

然后,按照示例包含故障安全插件,它应该可以工作.如果您无法正常进行操作,则应查看行家档案.

And then, just include the failsafe plugin as per the examples and it should work. If you have trouble getting that to work (unlikely), then you should look at maven profiles.

也请参见此评论:

这篇关于在Maven的集成测试阶段是否可以运行空手道测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 19:21