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

Unified Diff: ios/chrome/browser/ui/settings/settings_egtest.mm

Issue 2733973002: Create shared matcher for navigation bar done button. (Closed)
Patch Set: remove sufficientlyVisible from shared matcher Created 3 years, 9 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/chrome/browser/ui/settings/settings_egtest.mm
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm
index 35630838dbacae8924aaa4930f7f542401f5c8f8..2c18971ac806df1614f158ad74af625b82deeb4c 100644
--- a/ios/chrome/browser/ui/settings/settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/settings_egtest.mm
@@ -51,6 +51,7 @@
#include "url/gurl.h"
using chrome_test_util::ButtonWithAccessibilityLabelId;
+using chrome_test_util::NavigationBarDoneButton;
namespace {
@@ -99,10 +100,6 @@ id<GREYMatcher> ClearSavedPasswordsButton() {
id<GREYMatcher> ClearBrowsingDataButton() {
return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BUTTON);
}
-// Matcher for the done button in the navigation bar.
-id<GREYMatcher> NavigationDoneButton() {
- return ButtonWithAccessibilityLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
-}
// Matcher for the Settings button in the tools menu.
id<GREYMatcher> SettingsButton() {
return grey_accessibilityID(kToolsMenuSettingsId);
@@ -305,9 +302,7 @@ bool IsCertificateCleared() {
grey_accessibilityTrait(
UIAccessibilityTraitButton),
nil)] performAction:grey_tap()];
- [[EarlGrey
- selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
- IDS_IOS_NAVIGATION_BAR_DONE_BUTTON)]
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()];
}
@@ -331,7 +326,7 @@ bool IsCertificateCleared() {
// Exits Settings by clicking on the Done button.
- (void)dismissSettings {
// Dismiss the settings.
- [[EarlGrey selectElementWithMatcher:NavigationDoneButton()]
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()];
// Wait for UI components to finish loading.
@@ -812,7 +807,7 @@ bool IsCertificateCleared() {
selectElementWithMatcher:grey_accessibilityID(kSettingsCollectionViewId)]
assertWithMatcher:grey_notNil()];
- [[EarlGrey selectElementWithMatcher:NavigationDoneButton()]
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()];
chrome_test_util::CloseAllIncognitoTabs();
}
@@ -823,9 +818,7 @@ bool IsCertificateCleared() {
[[EarlGrey selectElementWithMatcher:SettingsButton()]
performAction:grey_tap()];
chrome_test_util::VerifyAccessibilityForCurrentScreen();
- [[EarlGrey
- selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
- IDS_IOS_NAVIGATION_BAR_DONE_BUTTON)]
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()];
}
@@ -1007,9 +1000,7 @@ bool IsCertificateCleared() {
UIAccessibilityTraitButton),
nil)] performAction:grey_tap()];
- [[EarlGrey
- selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
- IDS_IOS_NAVIGATION_BAR_DONE_BUTTON)]
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()];
}
« no previous file with comments | « ios/chrome/browser/ui/settings/clear_browsing_data_egtest.mm ('k') | ios/chrome/browser/ui/settings/translate_ui_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698