@BeforeMethod
public void startUp() throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
System.out.println("start appium service");
capabilities.setCapability("appium-version", "1.0");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "8.0");
capabilities.setCapability("deviceName", "iPhone 6");
capabilities.setCapability("udid", "xxxxxxxxxxxxxxx");
capabilities.setCapability("app", xxxxx/xxx.app");
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@Test
public void test1()
{
System.out.println("test1");
}
@Test(dependsOnMethods={"test1"})
public void test2()
{
System.out.println("test2");
}
@Test
public void test3()
{
System.out.println("test3");
}
@AfterMethod
public void tearDown() throws Exception
{
driver.quit();
}
预期结果:
我只想启动appium service并连续执行test1和test2。然后重启appium服务,单独执行test3。
答案 0 :(得分:0)
在Test3之前使用resetApp()
方法。 driver.resetApp()