From 89108ed2d9e3fb71092f77918495ffcb765b6729 Mon Sep 17 00:00:00 2001 From: Roman Zakharov Date: Wed, 13 Oct 2021 12:08:17 +0300 Subject: [PATCH] Make .tapUnhittable() to tap the center of the frame to match the regular .tap() --- .../ScreenObject/XCTestExtensions/XCUIElement+Extensions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ScreenObject/XCTestExtensions/XCUIElement+Extensions.swift b/Sources/ScreenObject/XCTestExtensions/XCUIElement+Extensions.swift index 8fe19b9..e751594 100644 --- a/Sources/ScreenObject/XCTestExtensions/XCUIElement+Extensions.swift +++ b/Sources/ScreenObject/XCTestExtensions/XCUIElement+Extensions.swift @@ -31,7 +31,7 @@ public extension XCUIElement { // Sends a tap event at the element's coordinate. Useful if the regular .tap() fails. func tapUnhittable() { XCTContext.runActivity(named: "Tap \(self) by coordinate") { _ in - coordinate(withNormalizedOffset: CGVector(dx: 0.0, dy: 0.0)).tap() + coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap() } } #endif