Last active
January 3, 2018 16:02
-
-
Save joecks/bd7954637a290b651bed12de3d3838a9 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
class RideDetails : ScopedActions(idMatcher(R.id.ride_details_container)) { | |
fun inRideEditButton(action: UiActions.() -> Actions) = | |
UiActions(idMatcher(R.id.rideBookedDetailEdit)).action() | |
fun inRideMapButton(action: UiActions.() -> Actions) = | |
UiActions(idMatcher(R.id.map_item)).action() | |
fun inRideStopList(action: List.() -> Actions) = | |
List(R.id.ridesStopsRecycler).action() | |
fun inSuccessDialog(action: Dialog.() -> Actions) = | |
Dialog(ResString(R.string.message_ride_book_success_title)).action() | |
} | |
class Robot { | |
fun inLanding(action: Landing.() -> Actions) = Landing().action() | |
fun inRideDetails(action: RideDetails.() -> Actions) = RideDetails().action() | |
fun pressBack(): Actions { | |
Espresso.pressBack() | |
return NoActions | |
} | |
fun inRideMap(action: RideMapView.() -> Actions) = RideMapView().action() | |
} | |
fun robot(action: Robot.() -> Actions) { | |
Robot().action() | |
} | |
internal fun idMatcher(@IdRes resId: Int) = { | |
ViewMatchers.withId(resId) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment