프로그래밍 방식으로 모든 테스트 케이스를 영원히 실행하는 방법은 무엇입니까? 아래는 내가 가진 설정입니다 ... 이제이 코드를 무한히 실행해야합니다 ... 또 다른 요구 사항은 @ aftersuite 이후에 앱을 다시 시작해야한다는 것입니다 ... 각 후속 작업 후에 보고서를 생성해야하기 때문에 테스트 케이스를 분해해야합니다 ...프로그래밍 방식으로 모든 테스트 케이스를 영원히 실행하는 방법은 무엇입니까?
예를 들어:
public class SimpleTest extends TestBase
{
AppiumDriver driver;
@BeforeSuite
public void setUp() throws MalformedURLException {
// DesiredCapabilities and all setup
}
@Test(priority = 1)
public void testcase1()throws InterruptedException {
login();
}
@Test(priority = 2)
public void testcase2() throws InterruptedException {
//something
}
@Test(priority = 3)
public void testcase3() throws InterruptedException {
//something
}
@Test(priority = 4)
public void testcase4 throws InterruptedException {
//something
}
@Test(priority = 5)
public void testcase() throws InterruptedException{
//something
}
@Test(priority = 6)
public void testcase6() throws InterruptedException{
//something
}
@Test(priority = 7)
public void testcase_logout() throws InterruptedException {
logout();
}
@AfterSuite
public void testCaseTearDown()
{
driver.quit();
}
}
... 무한 루프를 사용 하시겠습니까? – Dabiuteef
코드로 제안 해 주실 수 있습니까? 위의 설정은 내 설정입니다. –
무한 루프에서 testng 클래스의 run() 메서드를 호출합니다. doc의 예제를 참조하십시오. - http://testng.org/doc/documentation-main.html#running-testng-programmatically – Grasshopper