title: How to wait for another activity to start with Espresso?
body: <p>How can I make a test that waits for an Activity to start whenever a button is clicked?</p>
  
  <p>My test is really simple:</p>
  
  <pre><code>public void testStartsNewActivity() {
     onView(withId(R.id.button)).perform(click());
     // assert new Activity is launched
  }
  </code></pre>
  
  <p>thanks!</p>