Closed Bug 839940 Opened 12 years ago Closed 12 years ago

Need to implement move/move_by_offset calls in marionette

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 839943

People

(Reporter: mdas, Assigned: annyang121)

Details

As part of the touch action chains, we'll need to add a move call in marionette so we can do something like: action_chain.press(element1).move(element1, element2).release(element2) to synthesize a drag and drop action. The way envision it: * move should should take in either two elements or two sets of coordinates * move can take in a duration. If a duration is passed, it will move from point A to point B by incrementally sending touchmove events over that duration. If no duration is specified we can either use a default duration say of 200ms, and we can override that default duration by calling set_move_duration, or just send one touchmove event from A to B. I'm in favor of using a default duration. Thoughts?
Flags: needinfo?(dburns)
I think the best approach here is to have just have something like action_chain.press(element1).release(element2) since there is the implicit action of move there between the 2 elements. This is what we do within the Selenium code. There are actions like drag and drop that do 2 separate tasks from withing the action see https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/common/action_chains.py#98 I dont think that we should allow a duration for a task to happen as that complicates things in my opinion as people 99/100 times want things to run as fast as possible.
Flags: needinfo?(dburns)
(In reply to David Burns :automatedtester from comment #1) > I think the best approach here is to have just have something like > > action_chain.press(element1).release(element2) since there is the implicit > action of move there between the 2 elements. This is what we do within the > Selenium code. There are actions like drag and drop that do 2 separate tasks > from withing the action > > see > https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/ > common/action_chains.py#98 This is good for drag and drop, but what about automating a circular gesture where you start at point A and end at point A, and you don't have elements to refer to for the intermediate motions? Or for automating some sketchbook app or something, where you just draw on canvas? > > I dont think that we should allow a duration for a task to happen as that > complicates things in my opinion as people 99/100 times want things to run > as fast as possible. While this is true, it doesn't allow for apps, say a game, to move from point a to b at a particular pace.
(In reply to Malini Das [:mdas] from comment #2) > (In reply to David Burns :automatedtester from comment #1) > > This is good for drag and drop, but what about automating a circular gesture > where you start at point A and end at point A, and you don't have elements > to refer to for the intermediate motions? Or for automating some sketchbook > app or something, where you just draw on canvas? > In my mind this would be equivalent of using move_to(x, y) and wouldnt take an element. I still stick that if there is not intermediary step then its the e.g. action_chain.press(canvas).move_by_offset(1,2).move_by_offset(3,4).release() http://www.theautomatedtester.co.uk/blog/2011/selenium-advanced-user-interactions.html has an example of drawing on a canvas with Selenium > > > > I dont think that we should allow a duration for a task to happen as that > > complicates things in my opinion as people 99/100 times want things to run > > as fast as possible. > > While this is true, it doesn't allow for apps, say a game, to move from > point a to b at a particular pace. This has never been an issue for desktop so would favour doing this iff people ask for it. I can see the use case but, at least for now, I think we should just keep it to the side.
After speaking with AutomatedTester on IRC, we want: move(element) where we will move to the center of that element. move_by_offset(x,y) where we will move (x,y) coordinates relative to the target or previous calls. so press(canvas).move_by_offset(40, 20).release(canvas) will infer that we are moving (40,20) from the top-left of the canvas element.
Summary: Need to implement move call in marionette → Need to implement move/move_by_offset calls in marionette
Implemented in Bug 839943
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.