문제

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

도움이 되었습니까?

해결책

Use SingleLaunchActivityTestCase instead.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top