Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear storage between tests function #453

Open
pochikaevams opened this issue Dec 9, 2022 · 2 comments
Open

Add clear storage between tests function #453

pochikaevams opened this issue Dec 9, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@pochikaevams
Copy link

1 The issue is there is no good solution to clear storage data while running tests
2 Would be great to have box based function to call before any tests (or all of them), to remove all data after previous tests
3 Alternatives:

  • Marathon
  • fun clearStorage() {
    InstrumentationRegistry.getInstrumentation().uiAutomation.executeShellCommand("pm clear PACKAGE NAME")
    .close()
    }
@pochikaevams pochikaevams added the enhancement New feature or request label Dec 9, 2022
@Shabinder
Copy link

Seconded 👍 ,
An inbuilt helper for this would be great.

@vrnvorona
Copy link
Contributor

pm clear is awful solution. Clear shared, internal and such in before hook, if needed use hilt injection to clear other stuff. pm clear breaks instrumented tests instantly when run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants