title: Espresso, scrolling not working when NestedScrollView or RecyclerView is in CoordinatorLayout
body: <p>It looks like <code>CoordinatorLayout</code> breaks the behaviour of Espresso actions such as <code>scrollTo()</code> or <code>RecyclerViewActions.scrollToPosition()</code>.</p>
  <h1>Issue with NestedScrollView</h1>
  <p>For a layout like this one:</p>
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          app:layout_behavior=&quot;@string/appbar_scrolling_view_behavior&quot;&gt;
  
          ...
  
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot; &gt;
  
          ...
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  <p>If I try to scroll to any view inside the <code>NestedScrollView</code> using <code>ViewActions.scrollTo()</code> the first problem I find is that I get a <code>PerformException</code>. This is because this action only supports <code>ScrollView</code> and <code>NestedScrollView</code> doesn't extend it. A workaround for this problem is explained <a href="https://stackoverflow.com/a/31629951/1847449">here</a>, basically we can copy the code in <code>scrollTo()</code> and change the constrains to support <code>NestedScrollView</code>. This seems to work if the <code>NestedScrollView</code> is not in a <code>CoordinatorLayout</code> but as soon as you put it inside a the <code>CoordinatorLayout</code> the scrolling action fails.</p>
  <h1>Issue with RecyclerView</h1>
  <p>For the same layout, if I replace the <code>NestedScrollView</code> with a <code>RecyclerView</code> there is also problems with the the scrolling.</p>
  <p>In this case I'm using <code>RecyclerViewAction.scrollToPosition(position)</code>. Unlike the <code>NestedScrollView</code>, here I can see some scrolling happening. However, it looks like it scrolls to the wrong position. For example, if I scroll to the last position, it makes visible the second to last but not the last one. When I move the <code>RecyclerView</code> out of the <code>CoordinatorLayout</code> the scrolling works as it should.</p>
  <p>At the moment we can't write any Espresso test for the screens that use <code>CoordinatorLayout</code> due to this issues. Anyone experiencing the same problems or knows a workaround?</p>