title: Testing AutoCompleteTextView with Espresso
body: <p>I am using Espresso to test an app with several AutoCompleteTextViews. For one particular test, the autocomplete popup appears, but I want to just ignore it and move to the next <code>TextView</code>. How can I do this? My ideas are to either simulate a "Back" press or simulate a tap in the popup.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I am attempting the following to click on the autocomplete popup:</p>
  
  <pre><code>onView(withId(R.id.brand_text))
          .perform(scrollTo(), typeText(card.getBrand()));
  onData(allOf(is(instanceOf(String.class)), is(card.getBrand())))
          .inRoot(isPlatformPopup())
          .perform(click());
  onView(withId(R.id.brand_text))
          .check(matches(withText(card.getBrand())));
  </code></pre>
  
  <p>Now the problem is that in some cases, the text entered doesn't have any autocomplete matches so no popup appears. How do I conditionally perform the click depending on whether or not a view is matched?</p>