How to run Test dependsOnGroups, with maven command

huangapple go评论97阅读模式
英文:

How to run Test dependsOnGroups, with maven command

问题

  1. 我想执行运行测试我的代码如下
  2. ```java
  3. public class TestClass{
  4. private static final Logger LOGGER = LoggerFactory.getLogger(TestClass.class);
  5. @Test (groups = "tOne", dependsOnGroups = "tTwo")
  6. public void testOne(){
  7. LOGGER.info("tOne执行");
  8. }
  9. @Test (groups = "tTwo")
  10. public void testTwo(){
  11. LOGGER.info("tTwo执行");
  12. }
  13. }

我的Maven命令行:mvn clean test -Dgroups=tOne -Denvironment=qa -Dbrowser=chrome

我的命令行可以吗?

执行Maven后会打印出:depends on nonexistent group "tTwo"

  1. <details>
  2. <summary>英文:</summary>
  3. I want to execute run test, my code looks like:
  4. ```java
  5. public class TestClass{
  6. private static final Logger LOGGER = LoggerFactory.getLogger(TestClass.class);
  7. @Test (groups = &quot;tOne&quot;, dependsOnGroups = &quot;tTwo&quot;)
  8. public void testOne(){
  9. LOGGER.info(&quot;tOne execute&quot;);
  10. }
  11. @Test (groups = &quot;tTwo&quot;)
  12. public void testTwo(){
  13. LOGGER.info(&quot;tTwo execute&quot;);
  14. }
  15. }

My command line in maven : mvn clean test -Dgroups=tOne -Denvironment=qa -Dbrowser=chrome

My command line it is ok?

After execute maven print this: depends on nonexistent group &quot;tTwo&quot;

(-environment and -browser not relevant)

答案1

得分: 0

我使用命令行解决了这个问题:
mvn clean test -Dgroups=tTwo,tOne -Denvironment=qa -Dbrowser=chrome

英文:

I solved this with command line :
mvn clean test -Dgroups=tTwo,tOne -Denvironment=qa -Dbrowser=chrome

huangapple
  • 本文由 发表于 2020年8月11日 01:49:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/63345445.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定