title: How to test view pager swipe gesture in Android using Espresso 2.2
body: <p>I am writing automation test for View pager using Espresso 2.2 in which I need to test the swipe functionality.</p>
  
  <p>I have written the below code:</p>
  
  <pre><code> @LargeTest
   public class FirstActivityTest {
  
   @Rule
   public ActivityTestRule&lt;FirstActivity&gt; firstActivityTestRule =
          new ActivityTestRule&lt;&gt;( FirstActivity.class);
  
  @Test
  public void testViewPagerSwipeFunctionality() throws InterruptedException{
  
  
     onView(withId(R.id.tv_commu)).check(matches(withText(R.string.first_screen_text)));
  
     onView(withId(R.id.tv_skip)).check(matches(withText(R.string.skip))) ;
  
     onView(withId(R.id.radio_button_first)).check(matches(isChecked()));
     onView(withId(R.id.view_pager)).perform(swipLeft());
  
     onView(withId(R.id.radio_button_second))
              .check(matches(isChecked()));
     onView(withId(R.id.tv_comp)).check(matches(withText(R.string.second_screen_text)));
  
     onView(withId(R.id.tv_skip)).check(matches(withText(R.string.skip))) ;
  
     onView(withId(R.id.view_pager)).perform(swipeLeft());
  
     onView(withId(R.id.radio_button_third))
              .check(matches(isChecked()));
     onView(withId(R.id.tv_skip)).check(matches(withText(R.string.skip))) ;
      onView(withId(R.id.tv_person)).check(matches(withText(R.string.third_screen_text)));}}
  </code></pre>
  
  <p>However the method swipeLeft() is not getting resolved. Please let me know where I am doing wrong? Your help will be highly appreciated.</p>