Question

my test closes the app and any activities associated with it no matter if this is called or not. What is the point of it and is it safe to remove it from all of my test classes?

Was it helpful?

Solution

In my opinion, you shouldn't remove that method, especially, if you have more than one method in a test class. Every test method should be independent, only calling tearDown it can be achieved. According to documentation:

Make sure all resources are cleaned up and garbage collected before moving on to the next test. Subclasses that override this method should make sure they call super.tearDown() at the end of the overriding method.

Solo has method finishOpenedActivities, which should be called in tearDown. If you remove tearDown from your test classes only tearDown of parent class will be called and you may get unexpected issues related to unfinished activities in next test method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top