title: Espresso click menu item
body: <p>I have a menu in the actionbar which I create through:</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu) {
  
      menu.add(Menu.NONE, 98,Menu.NONE,R.string.filter).setIcon(R.drawable.ic_filter_list_white_48dp).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
      menu.add(Menu.NONE, 99,Menu.NONE,R.string.add).setIcon(R.drawable.ic_add_white_48dp).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
  
  
      getMenuInflater().inflate(R.menu.menu_main, menu);
  
      return true;
  }
  </code></pre>
  
  <p>and menu_main.xml looks like:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context=".MainActivity"&gt;
      &lt;item
          android:id="@+id/action_settings"
          android:title="@string/action_settings"
          android:orderInCategory="100"
          app:showAsAction="never"
          android:icon="@drawable/ic_settings_white_48dp"/&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>When testing in Espresso I would like to click on the "add" icon (menuId 99). I tried</p>
  
  <pre><code>@Test
  public void testAdd() {
  openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());
      onView(withText(R.string.add)).perform(click());
  }
  </code></pre>
  
  <p>but this fails with a NoMatchingViewException. ( The settings item, which is defined in the xml directly I can click with the same code. )</p>
  
  <p>That's for targetSdkVersion 23 and AppCompatActivity. The relevant lines for the tool bar are: </p>
  
  <pre><code>Toolbar toolbar = (Toolbar) findViewById(R.id.tool_bar);
  setSupportActionBar(toolbar);
  if( getSupportActionBar() != null ) {
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
  </code></pre>
  
  <p>and tool_bar.xml looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.Toolbar     xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/ThemeOverlay.AppCompat.Dark"
      android:background="@color/ColorPrimary"
      android:elevation="4dp"
      tools:ignore="UnusedAttribute"&gt;
  &lt;/android.support.v7.widget.Toolbar&gt;
  </code></pre>