Commit 85445c99 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Creates A11y ID’s for main Settings menu cells.

Bug: 1040844
Change-Id: Id780551c330924f783bad502cad8bfc6195d63b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2018328
Auto-Submit: Sergio Collazos <sczs@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735357}
parent 51b0a814
...@@ -253,6 +253,7 @@ source_set("eg2_tests") { ...@@ -253,6 +253,7 @@ source_set("eg2_tests") {
"//base/test:test_support", "//base/test:test_support",
"//components/strings", "//components/strings",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
"//ios/chrome/browser/ui/settings:constants",
"//ios/chrome/browser/ui/toolbar/public:constants", "//ios/chrome/browser/ui/toolbar/public:constants",
"//ios/chrome/test:eg_test_support+eg2", "//ios/chrome/test:eg_test_support+eg2",
"//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/chrome/test/earl_grey:eg_test_support+eg2",
...@@ -295,6 +296,7 @@ source_set("eg_tests") { ...@@ -295,6 +296,7 @@ source_set("eg_tests") {
"//ios/chrome/browser/ui/content_suggestions/cells:cells_ui", "//ios/chrome/browser/ui/content_suggestions/cells:cells_ui",
"//ios/chrome/browser/ui/location_bar:location_bar", "//ios/chrome/browser/ui/location_bar:location_bar",
"//ios/chrome/browser/ui/settings", "//ios/chrome/browser/ui/settings",
"//ios/chrome/browser/ui/settings:constants",
"//ios/chrome/browser/ui/toolbar/buttons", "//ios/chrome/browser/ui/toolbar/buttons",
"//ios/chrome/browser/ui/toolbar/public", "//ios/chrome/browser/ui/toolbar/public",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_app_interface.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_app_interface.h"
#import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h" #import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h"
#import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h"
#import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
...@@ -641,7 +642,7 @@ id<GREYMatcher> OmniboxWidthBetween(CGFloat width, CGFloat margin) { ...@@ -641,7 +642,7 @@ id<GREYMatcher> OmniboxWidthBetween(CGFloat width, CGFloat margin) {
// Change the Search Engine to Yahoo!. // Change the Search Engine to Yahoo!.
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI [ChromeEarlGreyUI
tapSettingsMenuButton:grey_accessibilityID(@"Search Engine")]; tapSettingsMenuButton:grey_accessibilityID(kSettingsSearchEngineCellId)];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Yahoo!")] [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Yahoo!")]
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey [[EarlGrey
...@@ -664,7 +665,7 @@ id<GREYMatcher> OmniboxWidthBetween(CGFloat width, CGFloat margin) { ...@@ -664,7 +665,7 @@ id<GREYMatcher> OmniboxWidthBetween(CGFloat width, CGFloat margin) {
// Change the Search Engine to Google. // Change the Search Engine to Google.
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI [ChromeEarlGreyUI
tapSettingsMenuButton:grey_accessibilityID(@"Search Engine")]; tapSettingsMenuButton:grey_accessibilityID(kSettingsSearchEngineCellId)];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Google")] [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Google")]
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey [[EarlGrey
......
...@@ -22,4 +22,34 @@ extern NSString* const kSettingsSearchEngineCellId; ...@@ -22,4 +22,34 @@ extern NSString* const kSettingsSearchEngineCellId;
// The accessibility identifier of the Voice Search cell. // The accessibility identifier of the Voice Search cell.
extern NSString* const kSettingsVoiceSearchCellId; extern NSString* const kSettingsVoiceSearchCellId;
// The accessibility identifier of the Sync and Google services cell.
extern NSString* const kSettingsGoogleSyncAndServicesCellId;
// The accessibility identifier of the Passwords cell.
extern NSString* const kSettingsPasswordsCellId;
// The accessibility identifier of the Payment Methods cell.
extern NSString* const kSettingsPaymentMethodsCellId;
// The accessibility identifier of the Addresses and More cell.
extern NSString* const kSettingsAddressesAndMoreCellId;
// The accessibility identifier of the Privacy cell.
extern NSString* const kSettingsPrivacyCellId;
// The accessibility identifier of the Article Suggestions cell.
extern NSString* const kSettingsArticleSuggestionsCellId;
// The accessibility identifier of the Languages cell.
extern NSString* const kSettingsLanguagesCellId;
// The accessibility identifier of the Content Settings cell.
extern NSString* const kSettingsContentSettingsCellId;
// The accessibility identifier of the Bandwidth cell.
extern NSString* const kSettingsBandwidthCellId;
// The accessibility identifier of the Aboud cell.
extern NSString* const kSettingsAboutCellId;
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_SETTINGS_TABLE_VIEW_CONTROLLER_CONSTANTS_H_ #endif // IOS_CHROME_BROWSER_UI_SETTINGS_SETTINGS_TABLE_VIEW_CONTROLLER_CONSTANTS_H_
...@@ -11,5 +11,20 @@ ...@@ -11,5 +11,20 @@
NSString* const kSettingsTableViewId = @"kSettingsTableViewId"; NSString* const kSettingsTableViewId = @"kSettingsTableViewId";
NSString* const kSettingsSignInCellId = @"kSettingsSignInCellId"; NSString* const kSettingsSignInCellId = @"kSettingsSignInCellId";
NSString* const kSettingsAccountCellId = @"kSettingsAccountCellId"; NSString* const kSettingsAccountCellId = @"kSettingsAccountCellId";
NSString* const kSettingsSearchEngineCellId = @"Search Engine"; NSString* const kSettingsSearchEngineCellId = @"kSettingsSearchEngineCellId";
NSString* const kSettingsVoiceSearchCellId = @"Voice Search Settings"; NSString* const kSettingsVoiceSearchCellId = @"kSettingsVoiceSearchCellId";
NSString* const kSettingsGoogleSyncAndServicesCellId =
@"kSettingsGoogleSyncAndServicesCellId";
NSString* const kSettingsPasswordsCellId = @"kSettingsPasswordsCellId";
NSString* const kSettingsPaymentMethodsCellId =
@"kSettingsPaymentMethodsCellId";
NSString* const kSettingsAddressesAndMoreCellId =
@"kSettingsAddressesAndMoreCellId";
NSString* const kSettingsPrivacyCellId = @"kSettingsPrivacyCellId";
NSString* const kSettingsArticleSuggestionsCellId =
@"kSettingsArticleSuggestionsCellId";
NSString* const kSettingsLanguagesCellId = @"kSettingsLanguagesCellId";
NSString* const kSettingsContentSettingsCellId =
@"kSettingsContentSettingsCellId";
NSString* const kSettingsBandwidthCellId = @"kSettingsBandwidthCellId";
NSString* const kSettingsAboutCellId = @"kSettingsAboutCellId";
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