Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
test: fix espresso tests for smaller screens
Browse files Browse the repository at this point in the history
  • Loading branch information
wswebcreation committed Nov 22, 2020
1 parent 69a23da commit 7e7db23
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SwagLabsFlow {
// Take a screenshot
takeActivityScreenshot("happy_flow_cart")
onView(withContentDescription("test-CHECKOUT"))
.perform(click())
.perform(scrollTo(), click())

// checkoutPageOne
// This is a bad practice but we just wait for the animation here
Expand All @@ -70,8 +70,10 @@ class SwagLabsFlow {
takeActivityScreenshot("happy_flow_submit_data")
onView(withContentDescription("test-First Name"))
.perform(typeText("Sauce"))
onView(ViewMatchers.isRoot()).perform(ViewActions.closeSoftKeyboard())
onView(withContentDescription("test-Last Name"))
.perform(typeText("Bot"))
onView(ViewMatchers.isRoot()).perform(ViewActions.closeSoftKeyboard())
onView(withContentDescription("test-Zip/Postal Code"))
.perform(typeText("1234 BB"))
onView(ViewMatchers.isRoot()).perform(ViewActions.closeSoftKeyboard())
Expand All @@ -94,9 +96,9 @@ class SwagLabsFlow {
// Take a screenshot
takeActivityScreenshot("happy_flow_complete")
onView(withContentDescription("test-BACK HOME"))
.perform(click())
.perform(scrollTo(), click())
waitForDisplayed(withContentDescription("test-PRODUCTS"))
// Take a screenshot
takeActivityScreenshot("happy_flow_done")
}
}
}

0 comments on commit 7e7db23

Please sign in to comment.