Commit 952b39c0 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Updating testSignInOpenSettings

Updating testSignInOpenSettings to make it more clear, and to simplify
the code.

Change-Id: I07420ced98606498b4e15722776b07e6f934b09e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015248
Auto-Submit: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734992}
parent 32131e10
......@@ -43,6 +43,7 @@ using chrome_test_util::SettingsDoneButton;
using chrome_test_util::SettingsImportDataContinueButton;
using chrome_test_util::SettingsImportDataImportButton;
using chrome_test_util::SettingsImportDataKeepSeparateButton;
using chrome_test_util::SettingsMenuBackButton;
using chrome_test_util::StaticTextWithAccessibilityLabelId;
using chrome_test_util::SyncSettingsConfirmButton;
using l10n_util::GetNSString;
......@@ -192,28 +193,24 @@ void ChooseImportOrKeepDataSepareteDialog(id<GREYMatcher> choiceButtonMatcher) {
}
// Tests that signing in, tapping the Settings link on the confirmation screen
// and closing the Settings correctly leaves the user signed in without any
// Settings shown.
// and closing the advanced sign-in settings correctly leaves the user signed
// in.
- (void)testSignInOpenSettings {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity];
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SecondarySignInButton()];
[SigninEarlGreyUI selectIdentityWithEmail:fakeIdentity.userEmail];
// Wait until the next screen appears.
[SigninEarlGreyUI tapSettingsLink];
[self openSigninFromView:OpenSigninMethodFromSettings tapSettingsLink:YES];
[[EarlGrey selectElementWithMatcher:SyncSettingsConfirmButton()]
performAction:grey_tap()];
// All Settings should be gone and user signed in.
// Test sync is on in the settings view.
id<GREYMatcher> settings_matcher =
chrome_test_util::StaticTextWithAccessibilityLabelId(
IDS_IOS_SETTINGS_TITLE);
IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SYNC_ON);
[[EarlGrey selectElementWithMatcher:settings_matcher]
assertWithMatcher:grey_notVisible()];
assertWithMatcher:grey_sufficientlyVisible()];
// Test the user is signed in.
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity];
}
......
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