try tap app before apping the element (#90149)

This commit is contained in:
Chris Yang 2021-09-16 20:02:02 -07:00 committed by GitHub
parent 00fe6a3918
commit ec3bd9edc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,9 @@
NSPredicate *hittable = [NSPredicate predicateWithFormat:@"exists == YES AND hittable == YES"];
[self expectationForPredicate:hittable evaluatedWithObject:element handler:nil];
[self waitForExpectationsWithTimeout:30.0 handler:nil];
// Sometimes, the element doesn't respond to the tap, it seems an XCUITest bug. Trying tap
// the app first to fix it.
[self.app tap];
[element tap];
}