Android Robotium - How to control the execution order of test patterns?

I am trying to use Robotium to automate application testing. Test cases have been documented and they must be tested in a specific order. But it seems that Junit is running the tests in alphabetical order .. how do I change 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();
    } 
}
+5
source share
1 answer

I'm not sure about Robotium, but the test order for the usual jUnit test cases can be controlled by creating a test suite. I think in this case it should also be the same (I have not tried it myself). Some info here .

+3

All Articles