Commit af20891b authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix ReadingList test flakiness

The tests were probably flaky because of a delay between the tap in the
popup menu and the appearance of the Reading List.
This CL adds a delay and also add a more explicit error message in case
it reproduces.

Fixed: 1109202
Change-Id: I9678642e45722375409cc4cb7612434a324b70c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343032
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarDavid Jean <djean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795888}
parent 8bed3c10
...@@ -213,6 +213,19 @@ void OpenReadingList() { ...@@ -213,6 +213,19 @@ void OpenReadingList() {
[ChromeEarlGreyUI openToolsMenu]; [ChromeEarlGreyUI openToolsMenu];
[ChromeEarlGreyUI [ChromeEarlGreyUI
tapToolsMenuButton:chrome_test_util::ReadingListMenuButton()]; tapToolsMenuButton:chrome_test_util::ReadingListMenuButton()];
// It seems that sometimes there is a delay before the ReadingList is
// displayed. See https://crbug.com/1109202 .
GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(
kWaitForUIElementTimeout,
^BOOL {
NSError* error = nil;
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kReadingListViewID)]
assertWithMatcher:grey_sufficientlyVisible()
error:&error];
return error == nil;
}),
@"Reading List didn't appear.");
} }
// Adds 20 read and 20 unread entries to the model, opens the reading list menu // Adds 20 read and 20 unread entries to the model, opens the reading list menu
...@@ -444,14 +457,7 @@ void AssertIsShowingDistillablePage(bool online, const GURL& distillable_url) { ...@@ -444,14 +457,7 @@ void AssertIsShowingDistillablePage(bool online, const GURL& distillable_url) {
} }
// Tests that the Reading List view is accessible. // Tests that the Reading List view is accessible.
// - (void)testAccessibility {
// Disabled due to https://crbug.com/1109202.
#if TARGET_IPHONE_SIMULATOR
#define MAYBE_testAccessibility DISABLED_testAccessibility
#else
#define MAYBE_testAccessibility testAccessibility
#endif
- (void)MAYBE_testAccessibility {
AddEntriesAndEnterEdit(); AddEntriesAndEnterEdit();
// In edit mode. // In edit mode.
[ChromeEarlGrey verifyAccessibilityForCurrentScreen]; [ChromeEarlGrey verifyAccessibilityForCurrentScreen];
......
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