3

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

That Activity class contains license checking for the application in android market and also displays the splash screen for 3 seconds. Here I would like to test that activity is displaying the splash screen and checking the license using Robotium instrumentation in Android.

So please tell me how to do this.

Volo
  • 28,673
  • 12
  • 97
  • 125
Ganesh
  • 924
  • 2
  • 12
  • 34

1 Answers1

0

To test that your splash screen is shown, you can try this, if you have set up robotium in your setup 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());
}
Eric Nordvik
  • 14,656
  • 8
  • 42
  • 50