示例#1
0
  @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))));
  }
  public ScreenNavigator open() {
    openDrawer(R.id.drawer_layout);

    return this;
  }