Android Robotium - How to manage the execution order of testcases?

0
0

I am trying to use Robotium to automate the testing of an application.
The test cases were documented and they are supposed to be test in specific order. But it seems that
Junit run the tests in alphabetic order.. how do I rearrange the order of execution? Here is the basic structure of my test class:

public class ETTerminalTest extends ActivityInstrumentationTestCase2<IdleActivity> {
private Solo solo;
private static final Logger LOGGER = LoggerFactory.getLogger(ETTerminalTest.class);
public ETTerminalTest() {
super("com.employtouch.etterminal.ui.activity", IdleActivity.class);
}
protected void setUp() throws Exception {
solo
= new Solo(getInstrumentation(), getActivity());
}
@Smoke
public void testEnterPin() throws Exception {
...
}
@Smoke
public void testWhatEver() throws Exception {
...
}
@Smoke
public void testSomethingElse() throws Exception {
...
}
@Override
public void tearDown() throws Exception {
try {
//Robotium will finish all the activities that have been opened
solo
.finalize();
} catch (Throwable e) {
e
.printStackTrace();
}
getActivity
().finish();
super.tearDown();
}
}
  • You must to post comments
0
0

I am not sure for Robotium, but the test order for normal jUnit test cases can be managed by creating a test suite. I guess it should be same in this case as well.(I haven’t tried it myself). Some info here.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website