英文:
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 = "tOne", dependsOnGroups = "tTwo")
public void testOne(){
LOGGER.info("tOne execute");
}
@Test (groups = "tTwo")
public void testTwo(){
LOGGER.info("tTwo execute");
}
}
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 "tTwo"
(-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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论