For example, I have a sketch pad app that I want to test by drawing on it. I'd like to specify an (x,y) coordinate and make it tap and drag to another (x,y) coordinate.
Is this possible in Xcode UI Tests?
Joe provided a solution to this issue: Using objective C, my code looked something like this:
XCUICoordinate *start = [element2 coordinateWithNormalizedOffset:CGVectorMake(0, 0)];
XCUICoordinate *finish = [element2 coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.5)];
[start pressForDuration:0 thenDragToCoordinate:finish];
where element2
was the XCUIElement I had to perform the drag on.