swift - XCTest Fast Swipe -
i'd create custom swipes xctest faster shorten test duration:
public class func swipeleftfast(element:xcuielement) { customswipe(refelement: element, startcoord: cgvector(dx: 1, dy: 5), endcoord: cgvector(dx: -1, dy: 5)) } public class func customswipe(refelement:xcuielement, startcoord:cgvector, endcoord:cgvector) { let swipestartpoint = refelement.coordinate(withnormalizedoffset: startcoord) let swipeendpoint = refelement.coordinate(withnormalizedoffset: endcoord) swipestartpoint.press(forduration: 0.1, thendragto: swipeendpoint) }
however slower default xcuielement
swipe api. possible create faster swipes , how can understand vector values used in above code? suppose not concrete screen coordinates , if set them example x:10, x:-10
respectively, swipe slow, if set them x:0.1, x:-0.1
swipe short have effect.
Comments
Post a Comment