Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created June 9, 2019 13:20
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 frogermcs/32be3aeceecac070a56a0fdff411e472 to your computer and use it in GitHub Desktop.
Save frogermcs/32be3aeceecac070a56a0fdff411e472 to your computer and use it in GitHub Desktop.
@RunWith(AndroidJUnit4.class)
@LargeTest
public class MLModelTest {
@Rule
public ActivityTestRule<ModelTestActivity> mainActivityActivityRule = new ActivityTestRule<>(ModelTestActivity.class);
@Test
public void testClassificationUI() {
ModelTestActivity activity = mainActivityActivityRule.getActivity();
Bitmap bmp = TestUtils.getBitmapFromAsset(activity.getAssets(), "tulip.jpg");
activity.classifyImage(bmp);
onView(withId(com.frogermcs.imageclassificationtester.test.R.id.tvClassification))
.check(matches(withSubstring("Tulips")));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment