Closed shashikumarraja closed 7 years ago
Rather than clearing user data during test, I recommend setting up dependency injection so you are modifying an in-memory SharedPreferences
instead, so it always starts off with nothing. See https://github.com/chiuki/friendspell for an example.
Just like the rotate-screen method you have created can you help me in creating a method to clear user data(Which should work same as going to app info>>storage>>clear data) I am trying to automate the Onboarding process and need to clear app data before each test run. So far I have found ways to run adb commands to clear data but using that closes the app thus failing the tests. I need to use the method in @Before of the test suite so that before each test execution the data is cleared.