For example, I have a sketch application that I want to test based on it. I would like to indicate the coordinate (x, y) and make it pressed and drag to another coordinate (x, y).
Is this possible in Xcode user interface tests?
Joe provided a solution to this problem: Using lens 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 XCUIElement, I had to drag and drop.
source
share