title: Espresso test for bottomsheet
body: <p>I am creating an espresso test for bottom sheet where the sheet has 5 linearly arranged textview and the first textview is visible and clicking the first textview will expand the entire bottom sheet revealing all the items, and then the third item is needed to be clicked for the test to pass. </p>
  
  <p>The problem is that espresso doesn't click the textview of the bottom sheet after expanding until I put a <code>Thread.sleep(1000)</code>.</p>
  
  <p>I even tried IdlingResource, I set it to false once the click is registered on the first item and after the onStateChanged is called on bottomSheetBehaviour I set it to true again but still no help.</p>
  
  <p>This doesn't work : </p>
  
  <pre><code>onView(withId(R.id.toolsItem1)).perform(click());
  onView(withId(R.id.toolsItem3)).check(matches(isDisplayed()));
  onView(withId(R.id.toolsItem3)).perform(click());
  </code></pre>
  
  <p>This does : </p>
  
  <pre><code>onView(withId(R.id.toolsItem1)).perform(click());
  Thread.sleep(1000);
  onView(withId(R.id.toolsItem3)).check(matches(isDisplayed()));
  onView(withId(R.id.toolsItem3)).perform(click());
  </code></pre>