Slide 45
Slide 45 text
$0
1 2 3
4 5 6
7 8 9
0 <
.
Recipient
Send
class PaymentRobot {
PaymentRobot amount(long amount) {
long dollars = amount / 100;
String dollarString = String.valueOf(dollars);
for (int i = 0; i < dollarString.length(); i++) {
onView(withText(dollarString.substring(i, i + 1))).perform(click());
}
long cents = amount - (dollars * 100);
if (cents != 0) {
onView(withText(".")).perform(click());
String centsString = String.valueOf(cents);
for (int i = 0; i < centsString.length(); i++) {
onView(withText(centsString.substring(i, i + 1))).perform(click());
}
}
return this;
}B
PaymentRobot recipient(String recipient) {
onView(withHint("Recipient")).perform(typeType("foo@bar.com"));
return this;
}C
ResultRobot send() {
onView(withText("Send")).perform(click());
return new ResultRobot();
}D
}A
class ResultRobot {
ResultRobot isSuccess() {
onView(withText("Success!")).verify(visible());
return this;
}F
}E