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

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

Issue 2860453004: Fix PasswordsSettingsTestCase.testCopyPasswordToast (Closed)
Patch Set: Always close the snackbars 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/settings/passwords_settings_egtest.mm
diff --git a/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm b/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm
index d3ec529a471b19997416d43f6bbb14c64a625438..d165812fd2281c2ddc60b4ed79e5b471e12bd7c6 100644
--- a/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/passwords_settings_egtest.mm
@@ -339,8 +339,7 @@ id<GREYMatcher> CopyPasswordButton() {
// Checks that attempts to copy a password provide appropriate feedback,
// both when reauthentication succeeds and when it fails.
-// TODO(crbug.com/718043): Re-enable test.
-- (void)DISABLED_testCopyPasswordToast {
+- (void)testCopyPasswordToast {
[self scopedEnablePasswordManagementAndViewingUI];
// Saving a form is needed for using the "password details" view.
@@ -373,8 +372,13 @@ id<GREYMatcher> CopyPasswordButton() {
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
NSString* snackbarLabel =
l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_WAS_COPIED_MESSAGE);
+ // Tap the snackbar instead of just asserting that it is there, and wait
+ // until the tap causes it to close. Otherwise it will block the copy button
+ // for the rest of the test on small devices, and scrolling to reach the
+ // button won't work when the snackbar is up.
lpromero 2017/05/04 09:21:08 Is this an action item we could solve? Scrolling o
vabr (Chromium) 2017/05/04 11:00:04 When I tried manually with Chrome, I was able to s
lpromero 2017/05/04 11:24:54 To be clear, I am fine as is, I was just wondering
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
- assertWithMatcher:grey_notNil()];
+ performAction:grey_tap()];
+ [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
// Check the snackbar in case of failed reauthentication.
mock_reauthentication_module.shouldSucceed = NO;
@@ -383,8 +387,11 @@ id<GREYMatcher> CopyPasswordButton() {
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
snackbarLabel =
l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_WAS_NOT_COPIED_MESSAGE);
+ // The tap checks the existence of the snackbar and also closes it.
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
- assertWithMatcher:grey_notNil()];
+ performAction:grey_tap()];
+ // Wait until the fade-out animation completes.
+ [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
[self tapBackArrow];
[self tapBackArrow];
@@ -410,8 +417,11 @@ id<GREYMatcher> CopyPasswordButton() {
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
NSString* snackbarLabel =
l10n_util::GetNSString(IDS_IOS_SETTINGS_USERNAME_WAS_COPIED_MESSAGE);
+ // The tap checks the existence of the snackbar and also closes it.
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
- assertWithMatcher:grey_notNil()];
+ performAction:grey_tap()];
+ // Wait until the fade-out animation completes.
+ [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
[self tapBackArrow];
[self tapBackArrow];
@@ -437,8 +447,11 @@ id<GREYMatcher> CopyPasswordButton() {
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
NSString* snackbarLabel =
l10n_util::GetNSString(IDS_IOS_SETTINGS_SITE_WAS_COPIED_MESSAGE);
+ // The tap checks the existence of the snackbar and also closes it.
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
- assertWithMatcher:grey_notNil()];
+ performAction:grey_tap()];
+ // Wait until the fade-out animation completes.
+ [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
[self tapBackArrow];
[self tapBackArrow];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698