Commit 74b8ec6f authored by Sébastien Séguin-Gagnon's avatar Sébastien Séguin-Gagnon Committed by Commit Bot

[Empties] Enable the IllustratedEmptyStates field trial testing config.

Change-Id: I664fa63b5b69369cb69fb4b87463ba3bb4cfc94d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386295Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: sebsg <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805136}
parent 97ef1865
...@@ -152,11 +152,15 @@ using chrome_test_util::SignOutAccountsButton; ...@@ -152,11 +152,15 @@ using chrome_test_util::SignOutAccountsButton;
+ (void)verifySigninPromoVisibleWithMode:(SigninPromoViewMode)mode + (void)verifySigninPromoVisibleWithMode:(SigninPromoViewMode)mode
closeButton:(BOOL)closeButton { closeButton:(BOOL)closeButton {
[ChromeEarlGreyUI waitForAppToIdle]; [ChromeEarlGreyUI waitForAppToIdle];
[[EarlGrey
selectElementWithMatcher:grey_allOf( // The sign-in promo is not visible when showing illustrated empty states.
grey_accessibilityID(kSigninPromoViewId), if (![ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
grey_sufficientlyVisible(), nil)] [[EarlGrey
assertWithMatcher:grey_notNil()]; selectElementWithMatcher:grey_allOf(
grey_accessibilityID(kSigninPromoViewId),
grey_sufficientlyVisible(), nil)]
assertWithMatcher:grey_notNil()];
}
[[EarlGrey [[EarlGrey
selectElementWithMatcher:grey_allOf(PrimarySignInButton(), selectElementWithMatcher:grey_allOf(PrimarySignInButton(),
grey_sufficientlyVisible(), nil)] grey_sufficientlyVisible(), nil)]
...@@ -169,10 +173,13 @@ using chrome_test_util::SignOutAccountsButton; ...@@ -169,10 +173,13 @@ using chrome_test_util::SignOutAccountsButton;
assertWithMatcher:grey_nil()]; assertWithMatcher:grey_nil()];
break; break;
case SigninPromoViewModeWarmState: case SigninPromoViewModeWarmState:
[[EarlGrey if (![ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
selectElementWithMatcher:grey_allOf(SecondarySignInButton(), [[EarlGrey
grey_sufficientlyVisible(), nil)] selectElementWithMatcher:grey_allOf(SecondarySignInButton(),
assertWithMatcher:grey_notNil()]; grey_sufficientlyVisible(),
nil)]
assertWithMatcher:grey_notNil()];
}
break; break;
} }
if (closeButton) { if (closeButton) {
......
...@@ -361,12 +361,19 @@ id<GREYMatcher> SearchIconButton() { ...@@ -361,12 +361,19 @@ id<GREYMatcher> SearchIconButton() {
} }
- (void)verifyEmptyBackgroundAppears { - (void)verifyEmptyBackgroundAppears {
id<GREYMatcher> emptyBackground = if ([ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
grey_accessibilityID([ChromeEarlGrey isIllustratedEmptyStatesEnabled] [[EarlGrey selectElementWithMatcher:grey_accessibilityID(
? kTableViewIllustratedEmptyViewID kTableViewIllustratedEmptyViewID)]
: kBookmarkEmptyStateExplanatoryLabelIdentifier); assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:emptyBackground] [[EarlGrey selectElementWithMatcher:grey_text(l10n_util::GetNSString(
assertWithMatcher:grey_sufficientlyVisible()]; IDS_IOS_BOOKMARK_EMPTY_MESSAGE))]
assertWithMatcher:grey_sufficientlyVisible()];
} else {
[[EarlGrey
selectElementWithMatcher:
grey_accessibilityID(kBookmarkEmptyStateExplanatoryLabelIdentifier)]
assertWithMatcher:grey_sufficientlyVisible()];
}
} }
- (void)verifyEmptyState { - (void)verifyEmptyState {
......
...@@ -759,7 +759,7 @@ using chrome_test_util::TappableBookmarkNodeWithLabel; ...@@ -759,7 +759,7 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
// Reopen bookmarks. // Reopen bookmarks.
[BookmarkEarlGreyUI openBookmarks]; [BookmarkEarlGreyUI openBookmarks];
if (base::FeatureList::IsEnabled(kIllustratedEmptyStates)) { if ([ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
// Ensure the root node is opened, by verifying that there isn't a Back // Ensure the root node is opened, by verifying that there isn't a Back
// button in the navigation bar. // button in the navigation bar.
[[EarlGrey selectElementWithMatcher:chrome_test_util:: [[EarlGrey selectElementWithMatcher:chrome_test_util::
...@@ -866,7 +866,7 @@ using chrome_test_util::TappableBookmarkNodeWithLabel; ...@@ -866,7 +866,7 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
- (void)testRootEmptyState { - (void)testRootEmptyState {
[BookmarkEarlGreyUI openBookmarks]; [BookmarkEarlGreyUI openBookmarks];
if (base::FeatureList::IsEnabled(kIllustratedEmptyStates)) { if ([ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
// When the user has no bookmarks, the root view should be an empty state. // When the user has no bookmarks, the root view should be an empty state.
[BookmarkEarlGreyUI verifyEmptyState]; [BookmarkEarlGreyUI verifyEmptyState];
} else { } else {
...@@ -894,7 +894,7 @@ using chrome_test_util::TappableBookmarkNodeWithLabel; ...@@ -894,7 +894,7 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
BookmarksNavigationBarBackButton()] BookmarksNavigationBarBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
if (base::FeatureList::IsEnabled(kIllustratedEmptyStates)) { if ([ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
// When the user has no bookmarks, the root view should be an empty state. // When the user has no bookmarks, the root view should be an empty state.
[BookmarkEarlGreyUI verifyEmptyState]; [BookmarkEarlGreyUI verifyEmptyState];
} else { } else {
......
...@@ -226,11 +226,17 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -226,11 +226,17 @@ id<GREYMatcher> NoBookmarksLabel() {
// Open the Bookmarks screen on the Tools menu. // Open the Bookmarks screen on the Tools menu.
[BookmarkEarlGreyUI openBookmarks]; [BookmarkEarlGreyUI openBookmarks];
[BookmarkEarlGreyUI openMobileBookmarks];
// Assert that there are no bookmarks. // Assert that there are no bookmarks.
[[EarlGrey selectElementWithMatcher:NoBookmarksLabel()] if ([ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
assertWithMatcher:grey_notNil()]; // The empty background appears in the root directory if the leaf folders
// are empty.
[BookmarkEarlGreyUI verifyEmptyBackgroundAppears];
} else {
[BookmarkEarlGreyUI openMobileBookmarks];
[[EarlGrey selectElementWithMatcher:NoBookmarksLabel()]
assertWithMatcher:grey_notNil()];
}
} }
// Tests that signing out from a managed user account clears the user's data. // Tests that signing out from a managed user account clears the user's data.
...@@ -249,11 +255,17 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -249,11 +255,17 @@ id<GREYMatcher> NoBookmarksLabel() {
// Open the Bookmarks screen on the Tools menu. // Open the Bookmarks screen on the Tools menu.
[BookmarkEarlGreyUI openBookmarks]; [BookmarkEarlGreyUI openBookmarks];
[BookmarkEarlGreyUI openMobileBookmarks];
// Assert that there are no bookmarks. // Assert that there are no bookmarks.
[[EarlGrey selectElementWithMatcher:NoBookmarksLabel()] if ([ChromeEarlGrey isIllustratedEmptyStatesEnabled]) {
assertWithMatcher:grey_notNil()]; // The empty background appears in the root directory if the leaf folders
// are empty.
[BookmarkEarlGreyUI verifyEmptyBackgroundAppears];
} else {
[BookmarkEarlGreyUI openMobileBookmarks];
[[EarlGrey selectElementWithMatcher:NoBookmarksLabel()]
assertWithMatcher:grey_notNil()];
}
} }
// Tests that the user isn't signed out and the UI is correct when the // Tests that the user isn't signed out and the UI is correct when the
......
...@@ -3411,6 +3411,22 @@ ...@@ -3411,6 +3411,22 @@
] ]
} }
], ],
"IllustratedEmptyStates": [
{
"platforms": [
"ios"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"IllustratedEmptyStates"
],
"disable_features": []
}
]
}
],
"IncludeBetaForumMenuItem": [ "IncludeBetaForumMenuItem": [
{ {
"platforms": [ "platforms": [
......
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