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 :(

Mihai R
  • 1
  • 2

1 Answers1

0

I found a solution to execute a command with full reset before test:

@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);
    }
}
Mihai R
  • 1
  • 2