Commit 6141983f authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF][EG2] Move Profile Matchers

Move profile matchers so they can be used from the app interface.

Bug: 1016809
Change-Id: I6179a151c5c82d5f94edb144e2d1241fc11745d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873888
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708936}
parent 369a7170
...@@ -16,9 +16,6 @@ ...@@ -16,9 +16,6 @@
#include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/core/service_access_type.h"
#import "ios/chrome/browser/autofill/form_suggestion_constants.h" #import "ios/chrome/browser/autofill/form_suggestion_constants.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h" #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_mediator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.h"
#import "ios/chrome/browser/ui/util/ui_util.h" #import "ios/chrome/browser/ui/util/ui_util.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
...@@ -37,11 +34,15 @@ ...@@ -37,11 +34,15 @@
using chrome_test_util::CancelButton; using chrome_test_util::CancelButton;
using chrome_test_util::GetOriginalBrowserState; using chrome_test_util::GetOriginalBrowserState;
using chrome_test_util::ManualFallbackFormSuggestionViewMatcher;
using chrome_test_util::ManualFallbackKeyboardIconMatcher;
using chrome_test_util::ManualFallbackManageProfilesMatcher;
using chrome_test_util::ManualFallbackProfilesIconMatcher;
using chrome_test_util::ManualFallbackProfilesTableViewMatcher;
using chrome_test_util::ManualFallbackProfileTableViewWindowMatcher;
using chrome_test_util::NavigationBarCancelButton;
using chrome_test_util::SettingsProfileMatcher;
using ios::ChromeBrowserState; using ios::ChromeBrowserState;
using manual_fill::AccessoryAddressAccessibilityIdentifier;
using manual_fill::AccessoryKeyboardAccessibilityIdentifier;
using manual_fill::AddressTableViewAccessibilityIdentifier;
using manual_fill::ManageAddressAccessibilityIdentifier;
namespace { namespace {
...@@ -50,51 +51,6 @@ constexpr char kFormElementCity[] = "city"; ...@@ -50,51 +51,6 @@ constexpr char kFormElementCity[] = "city";
constexpr char kFormHTMLFile[] = "/profile_form.html"; constexpr char kFormHTMLFile[] = "/profile_form.html";
// Returns a matcher for the scroll view in keyboard accessory bar.
id<GREYMatcher> FormSuggestionViewMatcher() {
return grey_accessibilityID(kFormSuggestionsViewAccessibilityIdentifier);
}
// Returns a matcher for the profiles icon in the keyboard accessory bar.
id<GREYMatcher> ProfilesIconMatcher() {
return grey_accessibilityID(AccessoryAddressAccessibilityIdentifier);
}
// Matcher for the Keyboard icon in the accessory bar.
id<GREYMatcher> KeyboardIconMatcher() {
return grey_accessibilityID(AccessoryKeyboardAccessibilityIdentifier);
}
// Returns a matcher for the profiles table view in manual fallback.
id<GREYMatcher> ProfilesTableViewMatcher() {
return grey_accessibilityID(AddressTableViewAccessibilityIdentifier);
}
// Returns a matcher for the button to open profile settings in manual
// fallback.
id<GREYMatcher> ManageProfilesMatcher() {
return grey_accessibilityID(ManageAddressAccessibilityIdentifier);
}
// Returns the matcher for an enabled cancel button in a navigation bar.
id<GREYMatcher> NavigationBarCancelMatcher() {
return grey_allOf(
grey_ancestor(grey_kindOfClass([UINavigationBar class])), CancelButton(),
grey_not(grey_accessibilityTrait(UIAccessibilityTraitNotEnabled)), nil);
}
// Returns a matcher for the profiles settings collection view.
id<GREYMatcher> ProfileSettingsMatcher() {
return grey_accessibilityID(kAutofillProfileTableViewID);
}
// Returns a matcher for the ProfileTableView window.
id<GREYMatcher> ProfileTableViewWindowMatcher() {
id<GREYMatcher> classMatcher = grey_kindOfClass([UIWindow class]);
id<GREYMatcher> parentMatcher = grey_descendant(ProfilesTableViewMatcher());
return grey_allOf(classMatcher, parentMatcher, nil);
}
// Saves an example profile in the store. // Saves an example profile in the store.
void AddAutofillProfile(autofill::PersonalDataManager* personalDataManager) { void AddAutofillProfile(autofill::PersonalDataManager* personalDataManager) {
using base::test::ios::WaitUntilConditionOrTimeout; using base::test::ios::WaitUntilConditionOrTimeout;
...@@ -174,13 +130,13 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -174,13 +130,13 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementName)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementName)];
// Tap on the addresses icon. // Tap on the addresses icon.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address controller table view is visible. // Verify the address controller table view is visible.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
} }
...@@ -192,15 +148,15 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -192,15 +148,15 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementName)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementName)];
// Tap on the addresses icon. // Tap on the addresses icon.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address controller contains the "Manage Addresses..." action. // Verify the address controller contains the "Manage Addresses..." action.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
[[EarlGrey selectElementWithMatcher:ManageProfilesMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackManageProfilesMatcher()]
assertWithMatcher:grey_interactable()]; assertWithMatcher:grey_interactable()];
} }
...@@ -211,19 +167,19 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -211,19 +167,19 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementName)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementName)];
// Tap on the addresses icon. // Tap on the addresses icon.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Tap the "Manage Addresses..." action. // Tap the "Manage Addresses..." action.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
[[EarlGrey selectElementWithMatcher:ManageProfilesMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackManageProfilesMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address settings opened. // Verify the address settings opened.
[[EarlGrey selectElementWithMatcher:ProfileSettingsMatcher()] [[EarlGrey selectElementWithMatcher:SettingsProfileMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
} }
...@@ -235,43 +191,43 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -235,43 +191,43 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementName)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementName)];
// Tap on the addresses icon. // Tap on the addresses icon.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the status of the icon. // Verify the status of the icon.
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
assertWithMatcher:grey_not(grey_userInteractionEnabled())]; assertWithMatcher:grey_not(grey_userInteractionEnabled())];
// Tap the "Manage Addresses..." action. // Tap the "Manage Addresses..." action.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
[[EarlGrey selectElementWithMatcher:ManageProfilesMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackManageProfilesMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address settings opened. // Verify the address settings opened.
[[EarlGrey selectElementWithMatcher:ProfileSettingsMatcher()] [[EarlGrey selectElementWithMatcher:SettingsProfileMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
// Tap Cancel Button. // Tap Cancel Button.
[[EarlGrey selectElementWithMatcher:NavigationBarCancelMatcher()] [[EarlGrey selectElementWithMatcher:NavigationBarCancelButton()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address settings closed. // Verify the address settings closed.
[[EarlGrey selectElementWithMatcher:ProfileSettingsMatcher()] [[EarlGrey selectElementWithMatcher:SettingsProfileMatcher()]
assertWithMatcher:grey_not(grey_sufficientlyVisible())]; assertWithMatcher:grey_not(grey_sufficientlyVisible())];
// Verify the status of the icons. // Verify the status of the icons.
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
assertWithMatcher:grey_userInteractionEnabled()]; assertWithMatcher:grey_userInteractionEnabled()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_not(grey_sufficientlyVisible())]; assertWithMatcher:grey_not(grey_sufficientlyVisible())];
// Verify the keyboard is not cover by the profiles view. // Verify the keyboard is not cover by the profiles view.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
} }
...@@ -288,24 +244,24 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -288,24 +244,24 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementName)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementName)];
// Tap on the addresses icon. // Tap on the addresses icon.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address controller table view is visible. // Verify the address controller table view is visible.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
// Tap on the keyboard icon. // Tap on the keyboard icon.
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address controller table view and the address icon is NOT // Verify the address controller table view and the address icon is NOT
// visible. // visible.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
} }
...@@ -320,26 +276,27 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -320,26 +276,27 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementName)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementName)];
// Tap on the addresses icon. // Tap on the addresses icon.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
performAction:grey_tap()]; performAction:grey_tap()];
// Verify the address controller table view is visible. // Verify the address controller table view is visible.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
// Tap on a point outside of the popover. // Tap on a point outside of the popover.
// The way EarlGrey taps doesn't go through the window hierarchy. Because of // The way EarlGrey taps doesn't go through the window hierarchy. Because of
// this, the tap needs to be done in the same window as the popover. // this, the tap needs to be done in the same window as the popover.
[[EarlGrey selectElementWithMatcher:ProfileTableViewWindowMatcher()] [[EarlGrey
selectElementWithMatcher:ManualFallbackProfileTableViewWindowMatcher()]
performAction:grey_tapAtPoint(CGPointMake(0, 0))]; performAction:grey_tapAtPoint(CGPointMake(0, 0))];
// Verify the address controller table view and the address icon is NOT // Verify the address controller table view and the address icon is NOT
// visible. // visible.
[[EarlGrey selectElementWithMatcher:ProfilesTableViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesTableViewMatcher()]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
} }
...@@ -356,7 +313,7 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -356,7 +313,7 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
[GREYKeyboard waitForKeyboardToAppear]; [GREYKeyboard waitForKeyboardToAppear];
// Assert the address icon is not visible. // Assert the address icon is not visible.
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
// Store one address. // Store one address.
...@@ -367,14 +324,14 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) { ...@@ -367,14 +324,14 @@ void ClearProfiles(autofill::PersonalDataManager* personalDataManager) {
performAction:chrome_test_util::TapWebElementWithId(kFormElementCity)]; performAction:chrome_test_util::TapWebElementWithId(kFormElementCity)];
// Assert the address icon is visible now. // Assert the address icon is visible now.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)]; performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
// Verify the status of the icons. // Verify the status of the icons.
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
[[EarlGrey selectElementWithMatcher:ProfilesIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackProfilesIconMatcher()]
assertWithMatcher:grey_userInteractionEnabled()]; assertWithMatcher:grey_userInteractionEnabled()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()] [[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_not(grey_sufficientlyVisible())]; assertWithMatcher:grey_not(grey_sufficientlyVisible())];
} }
......
...@@ -374,8 +374,14 @@ id<GREYMatcher> SettingsPasswordMatcher(); ...@@ -374,8 +374,14 @@ id<GREYMatcher> SettingsPasswordMatcher();
// Returns a matcher for the search bar in password settings. // Returns a matcher for the search bar in password settings.
id<GREYMatcher> SettingsPasswordSearchMatcher(); id<GREYMatcher> SettingsPasswordSearchMatcher();
// Returns a matcher for the profiles settings collection view.
id<GREYMatcher> SettingsProfileMatcher();
#pragma mark - Manual Fallback #pragma mark - Manual Fallback
// Returns a matcher for the scroll view in keyboard accessory bar.
id<GREYMatcher> ManualFallbackFormSuggestionViewMatcher();
// Returns a matcher for the keyboard icon in the keyboard accessory bar. // Returns a matcher for the keyboard icon in the keyboard accessory bar.
id<GREYMatcher> ManualFallbackKeyboardIconMatcher(); id<GREYMatcher> ManualFallbackKeyboardIconMatcher();
...@@ -404,6 +410,21 @@ id<GREYMatcher> ManualFallbackPasswordButtonMatcher(); ...@@ -404,6 +410,21 @@ id<GREYMatcher> ManualFallbackPasswordButtonMatcher();
// Returns a matcher for the PasswordTableView window. // Returns a matcher for the PasswordTableView window.
id<GREYMatcher> ManualFallbackPasswordTableViewWindowMatcher(); id<GREYMatcher> ManualFallbackPasswordTableViewWindowMatcher();
// Returns a matcher for the profiles icon in the keyboard accessory bar.
id<GREYMatcher> ManualFallbackProfilesIconMatcher();
// Returns a matcher for the profiles table view in manual fallback.
id<GREYMatcher> ManualFallbackProfilesTableViewMatcher();
// Returns a matcher for the button to open profile settings in manual
// fallback.
id<GREYMatcher> ManualFallbackManageProfilesMatcher();
// Returns a matcher for the profiles settings collection view.
id<GREYMatcher> SettingsProfileMatcher();
// Returns a matcher for the ProfileTableView window.
id<GREYMatcher> ManualFallbackProfileTableViewWindowMatcher();
} // namespace chrome_test_util } // namespace chrome_test_util
#endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_H_ #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_H_
...@@ -467,8 +467,16 @@ id<GREYMatcher> SettingsPasswordSearchMatcher() { ...@@ -467,8 +467,16 @@ id<GREYMatcher> SettingsPasswordSearchMatcher() {
return [ChromeMatchersAppInterface settingsPasswordSearchMatcher]; return [ChromeMatchersAppInterface settingsPasswordSearchMatcher];
} }
id<GREYMatcher> SettingsProfileMatcher() {
return [ChromeMatchersAppInterface settingsProfileMatcher];
}
#pragma mark - Manual Fallback #pragma mark - Manual Fallback
id<GREYMatcher> ManualFallbackFormSuggestionViewMatcher() {
return [ChromeMatchersAppInterface manualFallbackFormSuggestionViewMatcher];
}
id<GREYMatcher> ManualFallbackKeyboardIconMatcher() { id<GREYMatcher> ManualFallbackKeyboardIconMatcher() {
return [ChromeMatchersAppInterface manualFallbackKeyboardIconMatcher]; return [ChromeMatchersAppInterface manualFallbackKeyboardIconMatcher];
} }
...@@ -507,4 +515,21 @@ id<GREYMatcher> ManualFallbackPasswordTableViewWindowMatcher() { ...@@ -507,4 +515,21 @@ id<GREYMatcher> ManualFallbackPasswordTableViewWindowMatcher() {
[ChromeMatchersAppInterface manualFallbackPasswordTableViewWindowMatcher]; [ChromeMatchersAppInterface manualFallbackPasswordTableViewWindowMatcher];
} }
id<GREYMatcher> ManualFallbackProfilesIconMatcher() {
return [ChromeMatchersAppInterface manualFallbackProfilesIconMatcher];
}
id<GREYMatcher> ManualFallbackProfilesTableViewMatcher() {
return [ChromeMatchersAppInterface manualFallbackProfilesTableViewMatcher];
}
id<GREYMatcher> ManualFallbackManageProfilesMatcher() {
return [ChromeMatchersAppInterface manualFallbackManageProfilesMatcher];
}
id<GREYMatcher> ManualFallbackProfileTableViewWindowMatcher() {
return
[ChromeMatchersAppInterface manualFallbackProfileTableViewWindowMatcher];
}
} // namespace chrome_test_util } // namespace chrome_test_util
...@@ -379,8 +379,14 @@ ...@@ -379,8 +379,14 @@
// Returns a matcher for the search bar in password settings. // Returns a matcher for the search bar in password settings.
+ (id<GREYMatcher>)settingsPasswordSearchMatcher; + (id<GREYMatcher>)settingsPasswordSearchMatcher;
// Returns a matcher for the profiles settings collection view.
+ (id<GREYMatcher>)settingsProfileMatcher;
#pragma mark - Manual Fallback #pragma mark - Manual Fallback
// Returns a matcher for the scroll view in keyboard accessory bar.
+ (id<GREYMatcher>)manualFallbackFormSuggestionViewMatcher;
// Returns a matcher for the keyboard icon in the keyboard accessory bar. // Returns a matcher for the keyboard icon in the keyboard accessory bar.
+ (id<GREYMatcher>)manualFallbackKeyboardIconMatcher; + (id<GREYMatcher>)manualFallbackKeyboardIconMatcher;
...@@ -409,6 +415,18 @@ ...@@ -409,6 +415,18 @@
// Returns a matcher for the PasswordTableView window. // Returns a matcher for the PasswordTableView window.
+ (id<GREYMatcher>)manualFallbackPasswordTableViewWindowMatcher; + (id<GREYMatcher>)manualFallbackPasswordTableViewWindowMatcher;
// Returns a matcher for the profiles icon in the keyboard accessory bar.
+ (id<GREYMatcher>)manualFallbackProfilesIconMatcher;
// Returns a matcher for the profiles table view in manual fallback.
+ (id<GREYMatcher>)manualFallbackProfilesTableViewMatcher;
// Returns a matcher for the button to open profile settings in manual
// fallback.
+ (id<GREYMatcher>)manualFallbackManageProfilesMatcher;
// Returns a matcher for the ProfileTableView window.
+ (id<GREYMatcher>)manualFallbackProfileTableViewWindowMatcher;
@end @end
#endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_APP_INTERFACE_H_ #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_APP_INTERFACE_H_
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/unified_consent/feature.h" #include "components/unified_consent/feature.h"
#import "ios/chrome/browser/autofill/form_suggestion_constants.h"
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view.h" #import "ios/chrome/browser/ui/authentication/cells/signin_promo_view.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_mediator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.h"
...@@ -27,6 +30,7 @@ ...@@ -27,6 +30,7 @@
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_constants.h" #import "ios/chrome/browser/ui/recent_tabs/recent_tabs_constants.h"
#import "ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_constants.h" #import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_constants.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
...@@ -741,8 +745,16 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id, ...@@ -741,8 +745,16 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
return grey_accessibilityID(kPasswordsSearchBarId); return grey_accessibilityID(kPasswordsSearchBarId);
} }
+ (id<GREYMatcher>)settingsProfileMatcher {
return grey_accessibilityID(kAutofillProfileTableViewID);
}
#pragma mark - Manual Fallback #pragma mark - Manual Fallback
+ (id<GREYMatcher>)manualFallbackFormSuggestionViewMatcher {
return grey_accessibilityID(kFormSuggestionsViewAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackPasswordIconMatcher { + (id<GREYMatcher>)manualFallbackPasswordIconMatcher {
return grey_accessibilityID( return grey_accessibilityID(
manual_fill::AccessoryPasswordAccessibilityIdentifier); manual_fill::AccessoryPasswordAccessibilityIdentifier);
...@@ -789,4 +801,25 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id, ...@@ -789,4 +801,25 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
return grey_allOf(classMatcher, parentMatcher, nil); return grey_allOf(classMatcher, parentMatcher, nil);
} }
+ (id<GREYMatcher>)manualFallbackProfilesIconMatcher {
return grey_accessibilityID(
manual_fill::AccessoryAddressAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackProfilesTableViewMatcher {
return grey_accessibilityID(
manual_fill::AddressTableViewAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackManageProfilesMatcher {
return grey_accessibilityID(
manual_fill::ManageAddressAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackProfileTableViewWindowMatcher {
id<GREYMatcher> classMatcher = grey_kindOfClass([UIWindow class]);
id<GREYMatcher> parentMatcher =
grey_descendant([self manualFallbackProfilesTableViewMatcher]);
return grey_allOf(classMatcher, parentMatcher, nil);
}
@end @end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment