~canonical-platform-qa/autopilot/auto-test-fixes

« back to all changes in this revision

Viewing changes to autopilot/input/__init__.py

Add the press duration argument to touch clicks.
. Fixes: https://bugs.launchpad.net/bugs/1268782.

Approved by Christopher Lee, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
440
440
        """
441
441
        raise NotImplementedError("You cannot use this class directly.")
442
442
 
443
 
    def tap(self, x, y):
 
443
    def tap(self, x, y, press_duration=0.1):
444
444
        """Click (or 'tap') at given x,y coordinates."""
445
445
        raise NotImplementedError("You cannot use this class directly.")
446
446
 
447
 
    def tap_object(self, object):
 
447
    def tap_object(self, object, press_duration=0.1):
448
448
        """Tap the center point of a given object.
449
449
 
450
450
        It does this by looking for several attributes, in order. The first
610
610
            if button != 1:
611
611
                raise ValueError(
612
612
                    "Touch devices do not have button %d" % (button))
613
 
            self._device.tap(self._x, self._y)
 
613
            self._device.tap(self._x, self._y, press_duration=press_duration)
614
614
 
615
615
    def move(self, x, y):
616
616
        """Moves the pointer to the specified coordinates.