title: How to check visibility of View that is off the screen with Espresso?
body: <p>Based on what I see in Espresso cheat sheet, there are two methods that check visibility of a View, <code>isDisplayed()</code> and <code>isCompletelyDisplayed()</code>. </p>
  
  <p>I have sliding layout in my main screen and I have several views in it. I'm checking one of them by following command:</p>
  
  <pre><code>onView(withId(R.id.payment_btn)).check(matches(isDisplayed()));
  </code></pre>
  
  <p>However, test stops and displays following error:</p>
  
  <pre><code>android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'is displayed on the screen to the user' doesn't match the selected view.
  Expected: is displayed on the screen to the user
  </code></pre>
  
  <p>Then I thought that since the View is not visible I can test it by following test:</p>
  
  <pre><code>onView(withId(R.id.payment_btn)).check(doesNotExist());
  </code></pre>
  
  <p>However, test stopped and displayed following message:</p>
  
  <pre><code>android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: View is present in the hierarchy: 
  Expected: is &lt;false&gt;
  Got: &lt;true&gt; 
  </code></pre>
  
  <p>So, how can I check visibility of a View off the screen?</p>