How to run Test dependsOnGroups, with maven command

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

How to run Test dependsOnGroups, with maven command

问题

我想执行运行测试我的代码如下

```java
public class TestClass{

 private static final Logger LOGGER = LoggerFactory.getLogger(TestClass.class);

 @Test (groups = "tOne", dependsOnGroups = "tTwo")
 public void testOne(){
  LOGGER.info("tOne执行");
 }


 @Test (groups = "tTwo")
 public void testTwo(){
  LOGGER.info("tTwo执行");
 }

}

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

我的命令行可以吗?

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


<details>
<summary>英文:</summary>

I want to execute run test, my code looks like:

```java
public class TestClass{

 private static final Logger LOGGER = LoggerFactory.getLogger(TestClass.class);

 @Test (groups = &quot;tOne&quot;, dependsOnGroups = &quot;tTwo&quot;)
 public void testOne(){
  LOGGER.info(&quot;tOne execute&quot;);
 }


 @Test (groups = &quot;tTwo&quot;)
 public void testTwo(){
  LOGGER.info(&quot;tTwo execute&quot;);
 }

}

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:

确定