Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions WebDriverAgentLib/Categories/XCUIElement+FBTap.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ - (BOOL)fb_tapWithError:(NSError **)error

- (BOOL)fb_tapCoordinate:(CGPoint)relativeCoordinate error:(NSError **)error
{
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0")) {
// // Coordinates calculation issues have been fixed
// // for different device orientations since Xcode 11
// XCUICoordinate *startCoordinate = [self coordinateWithNormalizedOffset:CGVectorMake(0, 0)];
// CGVector offset = CGVectorMake(relativeCoordinate.x, relativeCoordinate.y);
// XCUICoordinate *dstCoordinate = [startCoordinate coordinateWithOffset:offset];
// CGPoint p = [dstCoordinate screenPoint];
// NSLog(@"QQQQQ fb_tapCoordinate: point is x: %f, y: %f", p.x, p.y);
//
// [dstCoordinate tap];
// return YES;
// }
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0")) {
// Coordinates calculation issues have been fixed
// for different device orientations since Xcode 11
XCUICoordinate *startCoordinate = [self coordinateWithNormalizedOffset:CGVectorMake(0, 0)];
CGVector offset = CGVectorMake(relativeCoordinate.x, relativeCoordinate.y);
XCUICoordinate *dstCoordinate = [startCoordinate coordinateWithOffset:offset];
CGPoint p = [dstCoordinate screenPoint];
NSLog(@"QQQQQ fb_tapCoordinate: point is x: %f, y: %f", p.x, p.y);

[dstCoordinate tap];
return YES;
}

NSArray<NSDictionary<NSString *, id> *> *tapGesture =
@[
Expand Down