2017-11-30 5 views
4

을 사용하여 이미지의 히트 포인트를 찾을 수 없습니다. iOS 11 XCUITest가 더 이상 UIImages의 히트 포인트를 찾을 수 없어서 press(forDuration:thenDragTo:)을 사용하여 이미지를 탭하거나 터치를 드래그 할 수 없게되었습니다.XCUITest - iOS 11

coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0))tap을 사용하여 작동하는 이미지를 두드리는 방법이 있습니다. 동일한 방법은 thenDragTo 메서드에서 작동하지 않습니다. XCUIElement가 필요하기 때문입니다.

누구나 (어떻게 생산 코드를 편집하지 않고도) thenDragTo 메서드를 작동시키는 방법을 알고 있습니까? 그것은 엑스 코드 9.2

extension XCUICoordinate { 
    open func press(forDuration duration: TimeInterval, thenDragTo otherCoordinate: XCUICoordinate) 
} 

내 테스트에서 XCUICoordinate을 받아 사전

답변

1

덕분에 나는이 같이 사용할 수 있어요 :

let fromCoordinate = contentElement.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)) 
let toCoordinate = fromCoordinate.withOffset(CGVector(dx: 0, dy: 260)) 
fromCoordinate.press(forDuration: 0.01, thenDragTo: toCoordinate) 
+0

을 확인 오. XCUIElement 타입의 객체에 대해'press (_ : thenDragTo :)'메소드를 사용했습니다.이 메소드는 다른 XCUIElement로 끌기만을 제공합니다. XCUICoordinate에서'press (_ : thenDragTo) '를 호출하면 다른 좌표로 드래그 할 수 있습니다 ... 감사합니다. – Sascha