I have a button and like whatsapp mic button you can long press and move it left and right.
Now I need to write a test case for this button. What I have done so far is, I can drag to a particular location. Now i need to drag left and right but i cannot find any method to do it.
let app = XCUIApplication()
app.buttons["Launch Chat"].tap()
app.tables.staticTexts["shivam"].tap()
let chatbarElement = app.otherElements["chatBar"]
let button = chatbarElement.children(matching: .button).element(boundBy: 0)
let startPoint = button.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0)) // center of element
var finishPoint = chatbarElement.coordinate(withNormalizedOffset: CGVector(dx: 0.7, dy: 0))
startPoint.press(forDuration: 3, thenDragTo: finishPoint)
As you can see this method only drags to a specific location. But what i need is to drag it left and right continuously for that specific duration and i cannot find any method to achieve this.
PS: This is not swipeLeft and swipeRight, drag means after long press you can drag the button to left and right not just an ordinary tap.