다른 시나리오의 TestMethod가 다른 설정을 가지고 있고 하나의 설정이 TestMethod에 의존하기 때문에 @BeforeMethod @ TestMethod에 종속성을 부여 할 방법이 있습니까? 더 나은 이해를 위해 여기 때문에@BeforeMethod에 그룹화 및 종속성을 추가하는 방법
@BeforeMethod(groups = {"gp2"})
public void setUp1() {
System.out.println("SetUp 1 is done");
}
@BeforeMethod(groups = {"gp1"}, dependsOnGroups = {"tgp1"})
public void setUp2() {
System.out.println("SetUp 2 is done");
}
@Test(timeOut = 1, groups = {"tgp1"})
public void testMethod() throws InterruptedException {
Thread.sleep(2000);
System.out.println("TestMethod() From Group1");
}
@Test(dependsOnMethods = {"testMethod"}, groups = {"tgp2"})
public void anotherTestMethod() {
System.out.println("AnotherTestMethod()From Group1 and Group2");
}
설정 1 설정 2
을 수행하지만 카메라 설정을 (필요 수행
출력) 실행해야하지 카메라 설정()을 몇 가지 코드를 추가 tgp1 그룹에 따라 다릅니다.
나는이 실행이에 있어야합니다 필요 내가
setUp2() is depending on method public void testMethod() throws java.lang.InterruptedException, which is not annotated with @Test or not included.
같은 예외를 가지고
@BeforeMethod(groups = {"gp1"}, dependsOnGroups = {"tgp1"})
다음
@BeforeMethod(groups = {"gp1"}, dependsOnMethods = {"testMethod"})
에에서 종속성을 변경하는 경우 나, 관찰 또 다른 것은 단계
SetUp1 ----> testMethod1() -------> SetUp2 ---------> testMethod2()
다른 TestMethod의 작업이 다르며 다른 SetUp().
이 종속성으로 달성하려는 것을 설명해 주시겠습니까? 또한 테스트를 시작하는 방법에 대한 구성이나 설명을 추가 할 수 있다면 도움이 될 것입니다. – artdanil