コード例 #1
0
ファイル: ShareUITest.java プロジェクト: hash13/qabel-android
  @Test
  public void testTellAFriend() {
    openDrawer(R.id.drawer_layout);
    Intents.intending(
            AllOf.allOf(
                hasAction(Intent.ACTION_CHOOSER),
                hasExtra(Intent.EXTRA_TITLE, mActivity.getString(R.string.share_via))))
        .respondWith(new Instrumentation.ActivityResult(Activity.RESULT_OK, null));

    onView(
            allOf(
                is(instanceOf(NavigationMenuItemView.class)),
                withText(R.string.action_tellafriend)))
        .perform(click());
    intended(
        allOf(
            hasAction(Intent.ACTION_CHOOSER),
            hasExtra(Intent.EXTRA_TITLE, mActivity.getString(R.string.share_via))));
  }
コード例 #2
0
 /**
  * Given a user that has logged in, when the StartGameButton is pressed the next activity,
  * JoinGameActivity, is started.
  */
 @Test
 public void testJoinGameButton() {
   onView(withId(R.id.button2)).check(matches(isClickable()));
   onView(withId(R.id.button2)).perform(click());
   intended(hasComponent(JoinGameActivity.class.getName()));
 }