0
은 Maven 프로젝트가 Run As > Maven test
관련 테스트 TestNG를하고 받는다는 프로젝트에서 작동 다른 그룹
에 따라 시험 할 때 성공으로 표시 477 개 시험 시험이 모두 @Test(groups=unit)...
에 속해 있습니다를 포함하는 방법 우리의 경우 테스트 구성에 다른 그룹 @Test(groups=unit)
도 포함해야합니까 ??
은 Maven 프로젝트가 Run As > Maven test
관련 테스트 TestNG를하고 받는다는 프로젝트에서 작동 다른 그룹
에 따라 시험 할 때 성공으로 표시 477 개 시험 시험이 모두 @Test(groups=unit)...
에 속해 있습니다를 포함하는 방법 우리의 경우 테스트 구성에 다른 그룹 @Test(groups=unit)
도 포함해야합니까 ??
원하는만큼 그룹을 추가 할 수 있습니다. :
Before Group
first
second
four
설명 : 당신은 단지 테스트 케이스 네을 실행할 때
Before Group
first
second
third
four
five
Before Group
Six
출력 : 첫째 종속 테스트를 실행 당신이 스위트로 실행
package com.stack.JarCreation;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
public class TestNgGroups {
@BeforeGroups({"gp","group"})
public void beforeGroup(){
System.out.println("Before Group");
}
@Test(priority=1,groups="gp")
public void first(){
System.out.println("first");
}
@Test(priority=2,groups="gp")
public void second(){
System.out.println("second");
}
@Test(priority=3)
public void third(){
System.out.println("third");
}
@Test(priority=4,dependsOnGroups="gp")
public void four(){
System.out.println("four");
}
@Test(priority=5)
public void five(){
System.out.println("five");
}
@Test(priority=6,groups="group")
public void Six(){
System.out.println("Six");
}
}
출력 그런 다음이 테스트 사례를 마침내 실행합니다. 테스트 케이스 중 하나라도 실패하면이 테스트 케이스는 건너 뜁니다.
희망이 도움이 될 것입니다.