Long touch & drag

90 views
Skip to first unread message

James Thomason

unread,
May 14, 2013, 1:00:48 PM5/14/13
to frank-...@googlegroups.com
I've gotten to what I expect to be the most difficult part of my app to test.  I need to adjust handles on a graph control, adjusting some values.  The handles are activated by a long touch, then dragging vertically up or down to a desired position.  I've been able to write a test for the long touch (tap_and_hold(selector)), and when I run the test I see the handle activate as expected.  Now I need to drag up or down, and not sure how to move forward. Any suggestions would be appreciated.  

Jamie

James Thomason

unread,
May 17, 2013, 6:11:31 PM5/17/13
to frank-...@googlegroups.com
I was able to figure this out. That is to say, I was able to make it work. I figured I'd post my solution in case others have similar challenges.  If anyone has refactoring tips, I'd love to see them.

  firstHandle = "view:'DFSAdjustableTransactionLineView' marked:'Position Leg Handle' index:0"
  tap_and_hold(firstHandle)
  dest_frame = accessibility_frame(firstHandle)
  frankly_map( firstHandle, 'FEX_dragWithInitialDelayToX:y:', dest_frame.center.x-50, dest_frame.center.y )
Reply all
Reply to author
Forward
0 new messages