I have multiple UI tests. When I run a single test, everything is OK. But if I run a batch of them (as a part of CI build) test fail, because tests that go first change the state of the application, and the next tests are affected by those changes. (Since the app is not getting killed).
I tried getActivity().finish()
in tearDown()
.
Tried solo.finalize()
which does the same actually.
Is there a way to have a fresh app at the beginning of each test run? (Using Robotium).
And is there a way to programmatically kill the app at the end of a test?
I'm using ActivityInstrumentationTestCase2
with Robotium
Robotium aims to make writing tests for simulating user actions such as touching, clicking, and typing simple. It can be used if you have the source code for the app or if you only have the apk files, and can run on either emulators or real devices.
Robotium is an open-source test framework for writing automatic gray-box testing cases for Android applications. With the support of Robotium, test case developers can write function, system and acceptance test scenarios, spanning multiple Android activities.
Robotium is an Android test automation framework that has full support for native and hybrid applications.
Or just add solo.finishOpenedActivities();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With