diff --git a/README.md b/README.md index 703cc24d6..357e570c8 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ clickDialogNegativeButton(); // Scroll on scrolls and pagers scrollTo(R.id.button); scrollTo("A widget with this text"); -swipePagerForward(R.id.pager); -swipePagerBack(R.id.pager); +swipeViewPagerForward(R.id.pager); +swipeViewPagerBack(R.id.pager); // Interact with the navigation drawer openDrawer(R.id.drawer); diff --git a/library/src/main/java/com/schibsted/spain/barista/BaristaSwipeActions.java b/library/src/main/java/com/schibsted/spain/barista/BaristaViewPagerActions.java similarity index 76% rename from library/src/main/java/com/schibsted/spain/barista/BaristaSwipeActions.java rename to library/src/main/java/com/schibsted/spain/barista/BaristaViewPagerActions.java index a3b1bf6da..27b9b9a06 100644 --- a/library/src/main/java/com/schibsted/spain/barista/BaristaSwipeActions.java +++ b/library/src/main/java/com/schibsted/spain/barista/BaristaViewPagerActions.java @@ -7,13 +7,13 @@ import static android.support.test.espresso.action.ViewActions.swipeRight; import static com.schibsted.spain.barista.custom.DisplayedMatchers.displayedWithId; -public class BaristaSwipeActions { +public class BaristaViewPagerActions { - public static void swipePagerForward(@IdRes int id) { + public static void swipeViewPagerForward(@IdRes int id) { onView(displayedWithId(id)).perform(swipeLeft()); } - public static void swipePagerBack(@IdRes int id) { + public static void swipeViewPagerBack(@IdRes int id) { onView(displayedWithId(id)).perform(swipeRight()); } } diff --git a/sample/src/androidTest/java/com/schibsted/spain/barista/sample/ViewPagerTest.java b/sample/src/androidTest/java/com/schibsted/spain/barista/sample/ViewPagerTest.java index daf9918f3..61a6e3690 100644 --- a/sample/src/androidTest/java/com/schibsted/spain/barista/sample/ViewPagerTest.java +++ b/sample/src/androidTest/java/com/schibsted/spain/barista/sample/ViewPagerTest.java @@ -7,8 +7,8 @@ import org.junit.runner.RunWith; import static com.schibsted.spain.barista.BaristaAssertions.assertDisplayed; -import static com.schibsted.spain.barista.BaristaSwipeActions.swipePagerBack; -import static com.schibsted.spain.barista.BaristaSwipeActions.swipePagerForward; +import static com.schibsted.spain.barista.BaristaViewPagerActions.swipeViewPagerBack; +import static com.schibsted.spain.barista.BaristaViewPagerActions.swipeViewPagerForward; @RunWith(AndroidJUnit4.class) public class ViewPagerTest { @@ -19,30 +19,30 @@ public class ViewPagerTest { @Test public void checkSwipeForward() { - swipePagerForward(R.id.pager); + swipeViewPagerForward(R.id.pager); assertDisplayed("2"); } @Test public void checkSwipeBack() { - swipePagerForward(R.id.pager); - swipePagerBack(R.id.pager); + swipeViewPagerForward(R.id.pager); + swipeViewPagerBack(R.id.pager); assertDisplayed("1"); } @Test public void swipingBackInTheFirstPageDoesntCrash() { - swipePagerBack(R.id.pager); + swipeViewPagerBack(R.id.pager); assertDisplayed("1"); } @Test public void swipingForwardInTheLastPageDoesntCrash() { - swipePagerForward(R.id.pager); - swipePagerForward(R.id.pager); + swipeViewPagerForward(R.id.pager); + swipeViewPagerForward(R.id.pager); assertDisplayed("2"); } diff --git a/sample/src/androidTest/java/com/schibsted/spain/barista/sample/introduction/IntroducingBaristaActions.java b/sample/src/androidTest/java/com/schibsted/spain/barista/sample/introduction/IntroducingBaristaActions.java index 22a0f5acf..43cbb4d60 100644 --- a/sample/src/androidTest/java/com/schibsted/spain/barista/sample/introduction/IntroducingBaristaActions.java +++ b/sample/src/androidTest/java/com/schibsted/spain/barista/sample/introduction/IntroducingBaristaActions.java @@ -26,8 +26,8 @@ import static com.schibsted.spain.barista.BaristaScrollActions.scrollTo; import static com.schibsted.spain.barista.BaristaSleepActions.sleep; import static com.schibsted.spain.barista.BaristaSpinnerActions.clickSpinnerItem; -import static com.schibsted.spain.barista.BaristaSwipeActions.swipePagerBack; -import static com.schibsted.spain.barista.BaristaSwipeActions.swipePagerForward; +import static com.schibsted.spain.barista.BaristaViewPagerActions.swipeViewPagerBack; +import static com.schibsted.spain.barista.BaristaViewPagerActions.swipeViewPagerForward; import static java.util.concurrent.TimeUnit.SECONDS; @RunWith(AndroidJUnit4.class) @@ -75,8 +75,8 @@ public void letsIntroduceBarista() { // Scroll on scrolls and pagers scrollTo(R.id.button); scrollTo("A widget with this text"); - swipePagerForward(R.id.pager); - swipePagerBack(R.id.pager); + swipeViewPagerForward(R.id.pager); + swipeViewPagerBack(R.id.pager); // Interact with the navigation drawer openDrawer(R.id.drawer);