diff --git a/TestLib/EarlGreyImpl/GREYElementInteractionProxy.m b/TestLib/EarlGreyImpl/GREYElementInteractionProxy.m index f1b7d9e4e..5dc66d742 100644 --- a/TestLib/EarlGreyImpl/GREYElementInteractionProxy.m +++ b/TestLib/EarlGreyImpl/GREYElementInteractionProxy.m @@ -115,9 +115,11 @@ - (void)assertWithMatcher:(id)matcher - (id)inRoot:(id)rootMatcher { GREYThrowOnNilParameterWithMessage(rootMatcher, @"Root Matcher can't be nil."); - GREYExecuteSyncBlockInBackgroundQueue(^{ - [self->_remoteElementInteraction inRoot:rootMatcher]; - }); + // The remote interaction completes the whole execution within the target thread. If this is + // changed at remote, the method call below should be wrapped with + // `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be + // provided for Swift async test. + [self->_remoteElementInteraction inRoot:rootMatcher]; return self; } @@ -134,16 +136,20 @@ - (void)assertWithMatcher:(id)matcher } - (id)atIndex:(NSUInteger)index { - GREYExecuteSyncBlockInBackgroundQueue(^{ - [self->_remoteElementInteraction atIndex:index]; - }); + // The remote interaction completes the whole execution within the target thread. If this is + // changed at remote, the method call below should be wrapped with + // `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be + // provided for Swift async test. + [self->_remoteElementInteraction atIndex:index]; return self; } - (id)includeStatusBar { - GREYExecuteSyncBlockInBackgroundQueue(^{ - [self->_remoteElementInteraction includeStatusBar]; - }); + // The remote interaction completes the whole execution within the target thread. If this is + // changed at remote, the method call below should be wrapped with + // `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be + // provided for Swift async test. + [self->_remoteElementInteraction includeStatusBar]; return self; }