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

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

Issue 2907103002: [Payment Request] Updates PaymentRequestEditViewController in showcase (Closed)
Patch Set: Addressed comments + fixed broken build Created 3 years, 7 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
« no previous file with comments | « ios/showcase/payments/sc_payments_editor_coordinator.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/showcase/payments/sc_payments_editor_egtest.mm
diff --git a/ios/showcase/payments/sc_payments_editor_egtest.mm b/ios/showcase/payments/sc_payments_editor_egtest.mm
index cabca8d981073f943ae887e5342e5ddfb1b9986f..757415af62d28cab75c285e27e232764b6fd6b11 100644
--- a/ios/showcase/payments/sc_payments_editor_egtest.mm
+++ b/ios/showcase/payments/sc_payments_editor_egtest.mm
@@ -9,6 +9,7 @@
#import "ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.h"
#import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller.h"
#include "ios/chrome/browser/ui/ui_util.h"
+#include "ios/chrome/grit/ios_strings.h"
#import "ios/showcase/test/showcase_eg_utils.h"
#import "ios/showcase/test/showcase_test_case.h"
#include "ui/base/l10n/l10n_util.h"
@@ -108,6 +109,12 @@ id<GREYMatcher> UIAlertViewMessageForDelegateCallWithArgument(
nil)]
assertWithMatcher:grey_notNil()];
+ [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Province*")]
+ assertWithMatcher:grey_notNil()];
+ [[EarlGrey
+ selectElementWithMatcher:grey_accessibilityID(@"Province_textField")]
+ assertWithMatcher:grey_text(@"Quebec")];
+
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Address*")]
assertWithMatcher:grey_notNil()];
[[EarlGrey
@@ -119,6 +126,28 @@ id<GREYMatcher> UIAlertViewMessageForDelegateCallWithArgument(
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"Postal Code_textField")]
assertWithMatcher:grey_text(@"")];
+
+ [[EarlGrey
+ selectElementWithMatcher:grey_allOf(grey_accessibilityLabel(@"Save"),
+ grey_accessibilityValue(
+ l10n_util::GetNSString(
+ IDS_IOS_SETTING_ON)),
+ nil)]
+ assertWithMatcher:grey_notNil()];
+}
+
+// Tests if the expected input view for the province field is displaying, when
+// the field is focused, and that the expected row is selected.
+- (void)testVerifyProvinceFieldInputView {
+ // Tap the province textfield.
+ [[EarlGrey
+ selectElementWithMatcher:grey_accessibilityID(@"Province_textField")]
+ performAction:grey_tap()];
+
+ // Assert that a UIPicker view is displaying and the expected row is selected.
+ [[EarlGrey
+ selectElementWithMatcher:grey_accessibilityID(@"Province_pickerView")]
+ assertWithMatcher:grey_pickerColumnSetToValue(0, @"Quebec")];
}
// Tests if tapping the selector field notifies the delegate.
@@ -193,6 +222,16 @@ id<GREYMatcher> UIAlertViewMessageForDelegateCallWithArgument(
[[[EarlGrey selectElementWithMatcher:InputAccessoryViewNextButton()]
assertWithMatcher:grey_enabled()] performAction:grey_tap()];
+ // Assert the province textfield is focused.
+ AssertTextFieldWithAccessibilityIDIsFirstResponder(@"Province_textField");
+
+ // Assert the input accessory view's previous button is enabled.
+ [[EarlGrey selectElementWithMatcher:InputAccessoryViewPreviousButton()]
+ assertWithMatcher:grey_enabled()];
+ // Assert the input accessory view's next button is enabled and tap it.
+ [[[EarlGrey selectElementWithMatcher:InputAccessoryViewNextButton()]
+ assertWithMatcher:grey_enabled()] performAction:grey_tap()];
+
// Assert the address textfield is focused.
AssertTextFieldWithAccessibilityIDIsFirstResponder(@"Address_textField");
@@ -239,12 +278,12 @@ id<GREYMatcher> UIAlertViewMessageForDelegateCallWithArgument(
kWarningMessageAccessibilityID)]
assertWithMatcher:grey_notVisible()];
- // Assert the name textfield is focused.
- AssertTextFieldWithAccessibilityIDIsFirstResponder(@"Name_textField");
+ // Assert the province textfield is focused.
+ AssertTextFieldWithAccessibilityIDIsFirstResponder(@"Province_textField");
- // Assert the input accessory view's previous button is disabled.
+ // Assert the input accessory view's previous button is enabled.
[[EarlGrey selectElementWithMatcher:InputAccessoryViewPreviousButton()]
- assertWithMatcher:grey_not(grey_enabled())];
+ assertWithMatcher:grey_enabled()];
// Assert the input accessory view's next button is enabled.
[[EarlGrey selectElementWithMatcher:InputAccessoryViewNextButton()]
assertWithMatcher:grey_enabled()];
@@ -265,6 +304,15 @@ id<GREYMatcher> UIAlertViewMessageForDelegateCallWithArgument(
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Name_textField")]
performAction:grey_typeText(@"\n")];
+ // Assert the province textfield is focused.
+ AssertTextFieldWithAccessibilityIDIsFirstResponder(@"Province_textField");
+
+ // The standard keyboard does not display for the province field. Instead, tap
+ // the address textfield.
+ [[EarlGrey
+ selectElementWithMatcher:grey_accessibilityID(@"Address_textField")]
+ performAction:grey_tap()];
+
// Assert the address textfield is focused.
AssertTextFieldWithAccessibilityIDIsFirstResponder(@"Address_textField");
« no previous file with comments | « ios/showcase/payments/sc_payments_editor_coordinator.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698