Last active
December 30, 2016 01:10
-
-
Save prolificcoder/d536bd098ad7c7dde40d75af96cdaf0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void parallaxToolbarTest() { | |
//Go to the screen to perform the swipe action | |
//Verify that image is indeed collapsed | |
onView(withId(R.id.appbarLayout)).check(matches(withContentDescription(expandedImageContentDescription))); | |
//perform is sequential so click and swipeUp = drag up gesture | |
onView(withId(R.id.appbarLayout)).perform(click(), swipeUp()); | |
//We can't be really sure if the swiping has finished by the time we come to this point on all devices (slow) | |
//so either a collaped or collapsing state passes the test | |
onView(withId(R.id.appbarLayout).check(matches(anyOf( | |
withContentDescription(R.string.cd_image_collapsed), withContentDescription(R.string.cd_image_collapsing)))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment