0
webdriver.driver = appium
appium.hub = http://0.0.0.0:4723/wd/hub
appium.platformName = iOS
appium.platformVersion = 9.3
appium.deviceName = iPhone 6 Plus
appium.app = "appPath"
appium.noReset = true

I have these serenity properties for appium in maven, I want to do a full reset only for one test and I dont have idea how to do, can someone help?

I tried with before to make some properties changes but no success :(

4

1 回答 1

0

我找到了一个在测试前执行完全重置命令的解决方案:

@Before
public void fullResetSimulator() {
    StringBuffer output = new StringBuffer();

    Process p;
    try {
        p = Runtime.getRuntime().exec("xcrun simctl erase all");
        p.waitFor();
        BufferedReader reader = 
                        new BufferedReader(new InputStreamReader(p.getInputStream()));
                    String line = "";           
        while ((line = reader.readLine())!= null) {
            output.append(line + "\n");
        }
    } catch (Exception e) {
        Assert.assertTrue("Simulator reset error: "+e.getMessage(),false);
    }
}
于 2016-04-11T12:38:51.133 回答