Closed Bug 858563 Opened 8 years ago Closed 8 years ago

Add 'long_press' to Action chains

Categories

(Testing :: Marionette, defect)

x86
All
defect
Not set
normal

Tracking

(firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)

RESOLVED FIXED
mozilla23
Tracking Status
firefox21 --- wontfix
firefox22 --- wontfix
firefox23 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: mdas, Assigned: annyang121)

References

Details

Attachments

(1 file, 1 obsolete file)

Add a long_press function to our Action chains. I'm proposing this as its signature:

long_press(element, time_in_seconds)

Note, long_press cannot follow an active touch, like a press commande (it doesn't make sense for one finger to do that), so we have to make sure that we throw an error if someone does something like: action.press(el).long_press(el2, 5).release()
We should also remove the 'long_press' function from MarionetteTouchMixin in this bug.
Attached patch longPressAction (obsolete) — Splinter Review
long_press cannot follow press, move, move_by_offset, cancel. 
This bug has to wait until Bug 850819 lands.
Attachment #736890 - Flags: review?(mdas)
Comment on attachment 736890 [details] [diff] [review]
longPressAction

Review of attachment 736890 [details] [diff] [review]:
-----------------------------------------------------------------

Cool, just one quick change is needed before I can push it

::: testing/marionette/client/marionette/tests/unit/test_single_finger.py
@@ +136,5 @@
> +        self.marionette.navigate(testTouch)
> +        button = self.marionette.find_element("id", "mozLinkCopy")
> +        action = Actions(self.marionette)
> +        action.press(button).long_press(button, 5)
> +        self.assertRaises(NoSuchElementException, action.perform)

We want don't want to fire "NoSuchElementException", since that's not the right exception for this error. It's unclear and any test writer who sees this would get confused. We should throw something like "Invalid Command: long_press cannot follow an active touch event"

::: testing/marionette/marionette-listener.js
@@ +1098,5 @@
> +      if (lastTouch != null) {
> +        touch = lastTouch;
> +        emitTouchEvent('touchcancel', touch);
> +        lastTouch = null;
> +        sendError("There already has an active touch", 7, null, command_id);

7 should be 500, for a marionette specific error for now (we'll set it to a webdriver appropriate code when they're decided upon)
Attachment #736890 - Flags: review?(mdas) → review-
Attached patch errorMessageFixSplinter Review
Attachment #736890 - Attachment is obsolete: true
Attachment #737640 - Flags: review?(mdas)
Attachment #737640 - Flags: review?(mdas) → review+
Will land when Bug 850819 is resolved
https://hg.mozilla.org/mozilla-central/rev/b41dd203b511
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.