Closed
Bug 1020874
Opened 10 years ago
Closed 10 years ago
Add optional parameters x and y to Action.long_press()
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla33
People
(Reporter: TYLin, Assigned: TYLin)
Details
(Keywords: pi-marionette-userinput)
Attachments
(1 file, 1 obsolete file)
9.46 KB,
patch
|
mdas
:
review+
|
Details | Diff | Splinter Review |
We should allow long_press() to accept coordinate x, y as press() does.
Assignee | ||
Comment 1•10 years ago
|
||
Try result (opt): https://tbpl.mozilla.org/?tree=Try&rev=64481649449f Try result (debug): https://tbpl.mozilla.org/?tree=Try&rev=0fe64f66bcb6
Attachment #8434840 -
Flags: review?(mdas)
Comment 2•10 years ago
|
||
Comment on attachment 8434840 [details] [diff] [review] Add option parameters x and y to Action.long_press() Review of attachment 8434840 [details] [diff] [review]: ----------------------------------------------------------------- Cool! Will you please add a small test for this in testing/marionette/client/marionette/tests/unit/test_single_finger.py and testing/marionette/client/marionette/tests/unit/test_single_finger_desktop.py, please? Thanks!
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Malini Das [:mdas] from comment #2) > Cool! Will you please add a small test for this in > testing/marionette/client/marionette/tests/unit/test_single_finger.py and > testing/marionette/client/marionette/tests/unit/test_single_finger_desktop. > py, please? Thanks! The tests in test_single_finger.py and test_single_finger_desktop.py are all clicking on some buttons. Is it sufficient to test long_press() on a button at (x, y), say (1, 1), and see if the button is long pressed?
Comment 4•10 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] from comment #3) > The tests in test_single_finger.py and test_single_finger_desktop.py are all > clicking on some buttons. > Is it sufficient to test long_press() on a button at (x, y), say (1, 1), and > see if the button is long pressed? Not quite, we have no guarantee that (1,1) is being taken into account, since the default behaviour (touching the center of the element) and tapping at (1,1) is indistinguishable, so if we break coordinate-based longPress, we wouldn't know it. A good test for this is to tap an element which is at a particular point, and is not near the center of the element you are tapping. To do this, I would add a button on the test page which is at (0, 30) for example, and add a 'touchstart' and 'contextmenu' listener on it. To dispatch the long press, you would use the 'body' element as the target, with (0,30) as the offset. Since 'body' is the parent of this new element, the touch event will propagate to the button, so your listeners should be fired. These tests use testAction.html (https://mxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/www/testAction.html?raw=1) as their test page, so what you can do is something like: body = marionette.find_element("tag name", "body") button = marionette.find_element("id", "myNewButton") actions.long_press(body, 5, button.location['x'], button.location['y'])
Assignee | ||
Comment 5•10 years ago
|
||
Hi Malini, Thanks for the clear explanation. I'll see what I can do.
Comment 6•10 years ago
|
||
Comment on attachment 8434840 [details] [diff] [review] Add option parameters x and y to Action.long_press() Review of attachment 8434840 [details] [diff] [review]: ----------------------------------------------------------------- clearing flag
Attachment #8434840 -
Flags: review?(mdas)
Updated•10 years ago
|
Keywords: ateam-marionette-userinput
Assignee | ||
Comment 7•10 years ago
|
||
Add test cases in test_single_finger.py and test_single_finger_desktop.py. Try (Mnw, Gu): https://tbpl.mozilla.org/?tree=Try&rev=77a0f5cdb2d4 Try (Mn): https://tbpl.mozilla.org/?tree=Try&rev=8397ecb4e3dc
Attachment #8434840 -
Attachment is obsolete: true
Attachment #8436413 -
Flags: review?(mdas)
Comment 8•10 years ago
|
||
Comment on attachment 8436413 [details] [diff] [review] Add optional parameters x and y to Action.long_press() (v2) Review of attachment 8436413 [details] [diff] [review]: ----------------------------------------------------------------- this looks perfect, thanks for doing this!
Attachment #8436413 -
Flags: review?(mdas) → review+
Updated•10 years ago
|
Keywords: checkin-needed
Comment 9•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/ca3b94cfe665
Flags: in-testsuite+
Keywords: checkin-needed
Assignee | ||
Comment 10•10 years ago
|
||
It's good to see this reviewed and merged in the morning.
Comment 11•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ca3b94cfe665
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Updated•1 year ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•