Commit 46cfa63a authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes test failures in ContentSuggestionsTestCase.

Multiple content suggestions tests load pages with the same title, and
tab grid cells appear to stick around from test to test. They are hidden
and in the tab grid behind the BVC, so they can't be seen by the user,
but they are visible to EG matchers. EG tests were failing because the
same page title was shared by multiple tests, and the second test was
seeing duplicate labels between the NTP entry it was trying to tap and a
hidden tab grid cell from the previous test. This was not turning the
bots red because the test passed on retry, when run in isolation.

This CL fixes the test failures by adding grey_sufficientlyVisible() to
the matcher, so that it no longer matches against hidden tab grid cells.

BUG=1148938

Change-Id: If0d8b958cace5aa34dfe5e2ed854620b5adc51ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2538116Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827764}
parent df9f847f
......@@ -436,9 +436,10 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) {
[[self class] closeAllTabs];
[ChromeEarlGrey openNewTab];
[[EarlGrey selectElementWithMatcher:
chrome_test_util::StaticTextWithAccessibilityLabel(pageTitle)]
performAction:grey_longPress()];
id<GREYMatcher> matcher =
grey_allOf(chrome_test_util::StaticTextWithAccessibilityLabel(pageTitle),
grey_sufficientlyVisible(), nil);
[[EarlGrey selectElementWithMatcher:matcher] performAction:grey_longPress()];
}
@end
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