Skip to content

Instantly share code, notes, and snippets.

@corsc
Last active December 28, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corsc/7547846 to your computer and use it in GitHub Desktop.
Save corsc/7547846 to your computer and use it in GitHub Desktop.
Simple Robotium Sanity Test
/**
* Verify that clicking the button shows a toast with "Ouch"
*/
public void testOnClickMe()
{
final Solo solo = this.getSolo();
// click the button
solo.clickOnButton(this.getContext().getString(R.string.main_click_me));
// verify the toast shows
solo.searchText(this.getContext().getString(R.string.main_ouch), true);
}
/**
* Simple sanity test to check that content is displayed
*/
public void testSanity()
{
final Solo solo = this.getSolo();
// check for "Hello world"
assertTrue(solo.searchText(this.getContext().getString(R.string.main_hello_world), true));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment