Take testLaunchAndTappingCell test for example: (code is attached below)
This test fails when trying to tap "Tab 0_button" because it is still not accessible, and the reason is that showcase_utils::Open(@"TabGridViewController") introduces animations and apparently EarlGrey has some synchronization issues.
// Tests launching TabGridViewController and tapping a cell.
- (void)testLaunchAndTappingCell {
showcase_utils::Open(@"TabGridViewController");
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Tab 0_button")]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:grey_text(@"TabGridCommands")]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(
@"protocol_alerter_done")]
performAction:grey_tap()];
showcase_utils::Close();
}
Ed and I tried to add a wait condition after showcase_utils::Open(@"TabGridViewController"); to wait for the target view (tab grid view) to become accessible, however, this still doesn't work because TabGridView becomes accessible doesn't necessarily mean that "Tab 0_button" is also accessible.
This flake applies to almost all showcase egtests, so we need a reliable solution to this issue so that future written tests can be flake-free.
Comment 1 by lpromero@chromium.org
, Apr 28 2017