Question

So I am trying to write automation test using Robotium for Android I have a test suite related to my LoginPage, the problem is that setUp and tearDown get called beforfe and after every test, so it closes and opens the app on every single test case.

Is it possible to somehow avoid this, so that setup and tear down get called once for every test suit?

EDIT:

I am using ActivityInstrumentationTestCase2

Was it helpful?

Solution

Use SingleLaunchActivityTestCase instead.

OTHER TIPS

I'm not sure about Robotium, but junit has @BeforeClass and @AfterClass annotations you can apply to a method such that it gets called only once before or after instantiation of the test suite. See more info here:

http://junit.sourceforge.net/doc/faq/faq.htm#organize_3

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