How to write a test case method using Robotium in Android

I am writing a test case class for one of the actions in my application.

This Activity class contains a license check for an application on the Android market, and also displays a splash screen for 3 seconds. Here, I would like to check that the activity displays a splash screen and a license check using the Robotium toolkit in Android.

So please tell me how to do this.

+3
source share
1 answer

To verify that your splash screen is shown, you can try this if you configured roboticism in your installation method and named it solo:

public void testSplash() {
  assertNotNull(solo.getCurrentActivity().findViewById( "the id of the splash" ));
}

public void testLicense() {
  String licence = "my licence";
  assertEquals(licence, (MyActivity) solo.getCurrentActivity().getLicence());
}
0
source

All Articles