简体   繁体   中英

How to wipe data between tests on App Center (iOS with Appium)

I'm writing UITests with Appium and Java. Running them locally works fine. In AppCenter however, only the first test runs ok. The cause is that my tests need a clean install.

When running the tests on Android (within AppCenter) the the data seems to be wiped between tests.

On iOS (within AppCenter) the data seems to be retained between tests methods. The app is not re-installed between the test methods. I tried calling driver.resetApp between tests, but that doesn't seem to work either. My test suite is based on this example .

Question: How to get my data wiped between tests?

You can use fullReset=true capabilities ..

cap.setCapability(MobileCapabilityType.FULL_RESET,"True");

You can use noReset capabilities in your desired capabilities.

capabilities.setCapability("noReset", false);

For more info check Reset Strategy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM