Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: ios/showcase/payments/sc_payments_picker_egtest.mm

Issue 2827163002: [Payment Request] Improved matching for the UIAlertView in showcase egtests (Closed)
Patch Set: Initial Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/showcase/payments/sc_payments_picker_egtest.mm
diff --git a/ios/showcase/payments/sc_payments_picker_egtest.mm b/ios/showcase/payments/sc_payments_picker_egtest.mm
index fea155dc48df0257c83d61aef787d7cb3eff7f7e..210bf1b2c4409ffeaa1a022ebefd69f5db556f87 100644
--- a/ios/showcase/payments/sc_payments_picker_egtest.mm
+++ b/ios/showcase/payments/sc_payments_picker_egtest.mm
@@ -47,6 +47,20 @@ id<GREYMatcher> CancelButton() {
grey_sufficientlyVisible(), nil);
}
+// Returns the GREYMatcher for the UIAlertView's message displayed for a call
+// that notifies the delegate of a selection.
+id<GREYMatcher> UIAlertViewMessageForDelegateCallWithArgument(
+ NSString* argument) {
+ return grey_allOf(
+ grey_text(
+ [NSString stringWithFormat:
+ @"paymentRequestPickerViewController:"
+ @"kPaymentRequestPickerViewControllerAccessibilityID "
+ @"didSelectRow:%@",
+ argument]),
+ grey_sufficientlyVisible(), nil);
+}
+
} // namespace
// Tests for the payment request picker view controller.
@@ -292,6 +306,10 @@ id<GREYMatcher> CancelButton() {
performAction:grey_tap()];
// Confirm the delegate is informed.
+ [[EarlGrey
+ selectElementWithMatcher:UIAlertViewMessageForDelegateCallWithArgument(
+ @"Label: Canada, Value: CAN")]
+ assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(
@"protocol_alerter_done")]
performAction:grey_tap()];
@@ -305,6 +323,10 @@ id<GREYMatcher> CancelButton() {
performAction:grey_tap()];
// Confirm the delegate is informed.
+ [[EarlGrey
+ selectElementWithMatcher:UIAlertViewMessageForDelegateCallWithArgument(
+ @"Label: Canada, Value: CAN")]
+ assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(
@"protocol_alerter_done")]
performAction:grey_tap()];

Powered by Google App Engine
This is Rietveld 408576698