Merge lp:~chris.gagnon/autopilot/add_press_duration_to_touch_devices into lp:autopilot

Proposed by Chris Gagnon
Status: Rejected
Rejected by: Leo Arias
Proposed branch: lp:~chris.gagnon/autopilot/add_press_duration_to_touch_devices
Merge into: lp:autopilot
Diff against target: 214 lines (+133/-9)
3 files modified
autopilot/input/__init__.py (+4/-4)
autopilot/input/_uinput.py (+4/-4)
autopilot/tests/functional/test_input_stack.py (+125/-1)
To merge this branch: bzr merge lp:~chris.gagnon/autopilot/add_press_duration_to_touch_devices
Reviewer Review Type Date Requested Status
Leo Arias (community) Disapprove
PS Jenkins bot continuous-integration Needs Fixing
Christopher Lee (community) Needs Fixing
Review via email: mp+212265@code.launchpad.net

Commit message

add press_duration to touch devices

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Lee (veebers) wrote :

Failing tests here are Pinch Gesture which is a known issue.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:460
http://jenkins.qa.ubuntu.com/job/autopilot-ci/636/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/362
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/362/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/364
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/364/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/271
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/271/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-autopilot/88
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3883/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty-autopilot/79
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4383
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4383/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3885
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3885/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6162/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5269

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/636/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Lee (veebers) wrote :
review: Needs Fixing
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

It looks like my test are failing for the same reason the other tests are failing.

  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/__init__.py", line 173, in get_proxy_object_for_existing_process
    raise ProcessSearchError(message_string)
ProcessSearchError: Search criteria (pid = 3675, dbus bus = 'session', object path = '/com/canonical/Autopilot/Introspection', process object = '<subprocess.Popen object at 0xb448d150>') returned no results

Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

This works on my desktop and in my ubuntu-emulator.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:461
http://jenkins.qa.ubuntu.com/job/autopilot-ci/642/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/368
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/368/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/370
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/370/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/277
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/277/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-autopilot/94
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3889/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty-autopilot/84
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4389
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4389/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3891
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3891/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6171/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5284

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/642/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:461
http://jenkins.qa.ubuntu.com/job/autopilot-ci/649/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/375
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/375/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/377
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/377/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/284
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/284/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-autopilot/101
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4000/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty-autopilot/89
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4506
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4506/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4021
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4021/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6266/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5462

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/649/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:462
http://jenkins.qa.ubuntu.com/job/autopilot-ci/650/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/376
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/376/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/378
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/378/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/285
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/285/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-autopilot/102/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4039/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty-autopilot/90/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4545
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4545/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4068
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4068/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6297/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5522

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/650/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

My tests are passing here on mako

http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-runner-mako/6297/testReport/autopilot.tests.functional.test_input_stack/PointerClickTests/

The failure was due to other tests outside the inputstack that failed

the otto tests failed because of otto

/var/log/upstart/otto-setup.log: The following packages have unmet dependencies:
/var/log/upstart/otto-setup.log: libcheese-gtk23 : Depends: libclutter-1.0-0 (>= 1.13.2) but it is not going to be installed
/var/log/upstart/otto-setup.log: Depends: libclutter-gtk-1.0-0 (>= 0.91.8) but it is not going to be installed
/var/log/upstart/otto-setup.log: Depends: libcogl15 (>= 1.15.8) but it is not going to be installed
/var/log/upstart/otto-setup.log: libcheese7 : Depends: libclutter-gst-2.0-0 (>= 0.10.0) but it is not going to be installed
/var/log/upstart/otto-setup.log: Depends: gstreamer1.0-clutter but it is not going to be installed
/var/log/upstart/otto-setup.log: libgoa-1.0-0b : Depends: libgoa-1.0-common (= 3.10.2-1) but 3.10.3-0ubuntu1 is to be installed
/var/log/upstart/otto-setup.log: ubuntu-system-settings : Depends: indicator-bluetooth (> 0.0.6+13.10.20131010) but it is not going to be installed
/var/log/upstart/otto-setup.log: E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:462
http://jenkins.qa.ubuntu.com/job/autopilot-ci/702/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/428
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/428/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/430
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/430/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/337
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/337/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-autopilot/157
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4205/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty-autopilot/138
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5106
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5106/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4537
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4537/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6431/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6190

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/702/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

My new test cases for press duration passed, however these unrelated tests failed

autopilot.tests.functional.test_process_emulator.BAMFResizeWindowTestCase.test_resize_window_must_update_width_and_height_geometry(increase size)
    autopilot.tests.functional.test_process_emulator.BAMFResizeWindowTestCase.test_resize_window_must_update_width_and_height_geometry(decrease size)

463. By Chris Gagnon

resync with trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:463
http://jenkins.qa.ubuntu.com/job/autopilot-ci/716/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/442
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-amd64-ci/442/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/444
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-armhf-ci/444/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/351
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-trusty-i386-ci/351/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-autopilot/171
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4222/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty-autopilot/149
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5137
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5137/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4565
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4565/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6445/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6243

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/716/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

My new test cases for press duration passed

3 tests that are unrelated to my changes failed:

autopilot.tests.functional.test_ap_apps.QtTests.test_can_handle_non_unicode_stdout_and_stderr
    autopilot.tests.functional.test_process_emulator.BAMFResizeWindowTestCase.test_resize_window_must_update_width_and_height_geometry(increase size)
    autopilot.tests.functional.test_process_emulator.BAMFResizeWindowTestCase.test_resize_window_must_update_width_and_height_geometry(decrease size)

Revision history for this message
Leo Arias (elopio) wrote :

I copied this branch and finished with tests a little different. It's already merged in trunk.
Thanks Chris.

review: Disapprove

Unmerged revisions

463. By Chris Gagnon

resync with trunk

462. By Chris Gagnon

resync with trunk

461. By Chris Gagnon

fix extra_arg in desktop hint file

460. By Chris Gagnon

non-pep8 style changes for project, better names for tests

459. By Chris Gagnon

add press_duration to tap_object

458. By Chris Gagnon

add press_duration to touch devices

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/input/__init__.py'
2--- autopilot/input/__init__.py 2014-03-25 14:42:25 +0000
3+++ autopilot/input/__init__.py 2014-04-22 13:34:51 +0000
4@@ -440,11 +440,11 @@
5 """
6 raise NotImplementedError("You cannot use this class directly.")
7
8- def tap(self, x, y):
9+ def tap(self, x, y, press_duration=0.10):
10 """Click (or 'tap') at given x,y coordinates."""
11 raise NotImplementedError("You cannot use this class directly.")
12
13- def tap_object(self, object):
14+ def tap_object(self, object, press_duration=0.10):
15 """Tap the center point of a given object.
16
17 It does this by looking for several attributes, in order. The first
18@@ -610,7 +610,7 @@
19 if button != 1:
20 raise ValueError(
21 "Touch devices do not have button %d" % (button))
22- self._device.tap(self._x, self._y)
23+ self._device.tap(self._x, self._y, press_duration=press_duration)
24
25 def move(self, x, y):
26 """Moves the pointer to the specified coordinates.
27@@ -646,7 +646,7 @@
28 """
29
30 self.move_to_object(object_proxy)
31- self.click(button, press_duration)
32+ self.click(button, press_duration=press_duration)
33
34 def move_to_object(self, object_proxy):
35 """Attempts to move the pointer to 'object_proxy's centre point.
36
37=== modified file 'autopilot/input/_uinput.py'
38--- autopilot/input/_uinput.py 2014-03-25 14:42:25 +0000
39+++ autopilot/input/_uinput.py 2014-04-22 13:34:51 +0000
40@@ -465,7 +465,7 @@
41 def pressed(self):
42 return self._device.pressed
43
44- def tap(self, x, y):
45+ def tap(self, x, y, press_duration=0.10):
46 """Click (or 'tap') at given x and y coordinates.
47
48 :raises RuntimeError: if the finger is already pressed.
49@@ -474,10 +474,10 @@
50 """
51 _logger.debug("Tapping at: %d,%d", x, y)
52 self._device.finger_down(x, y)
53- sleep(0.1)
54+ sleep(press_duration)
55 self._device.finger_up()
56
57- def tap_object(self, object_):
58+ def tap_object(self, object_, press_duration=0.10):
59 """Click (or 'tap') a given object.
60
61 :raises RuntimeError: if the finger is already pressed.
62@@ -488,7 +488,7 @@
63 """
64 _logger.debug("Tapping object: %r", object)
65 x, y = get_center_point(object_)
66- self.tap(x, y)
67+ self.tap(x, y, press_duration=press_duration)
68
69 def press(self, x, y):
70 """Press and hold a given object or at the given coordinates.
71
72=== modified file 'autopilot/tests/functional/test_input_stack.py'
73--- autopilot/tests/functional/test_input_stack.py 2014-04-08 00:04:17 +0000
74+++ autopilot/tests/functional/test_input_stack.py 2014-04-22 13:34:51 +0000
75@@ -22,7 +22,13 @@
76 import os
77 from tempfile import mktemp
78 from testtools import TestCase, skipIf
79-from testtools.matchers import IsInstance, Equals, raises
80+from testtools.matchers import (
81+ IsInstance,
82+ Equals,
83+ GreaterThan,
84+ LessThan,
85+ raises,
86+)
87 from textwrap import dedent
88 from time import sleep
89 from unittest import SkipTest
90@@ -506,6 +512,124 @@
91 self.assertThat(p.y, Equals(123))
92
93
94+class PointerClickTests(AutopilotTestCase):
95+
96+ if platform.model() == 'Desktop':
97+ scenarios = [('with mouse', dict(input_device_class=Mouse))]
98+ else:
99+ scenarios = [('with touch', dict(input_device_class=Touch))]
100+
101+ test_qml = dedent("""\
102+ import QtQuick 2.0
103+ import Ubuntu.Components 0.1
104+
105+ Rectangle {
106+ id: rectangle
107+ width: 250
108+ height: 250
109+
110+ property int milliseconds: 0
111+ Column {
112+ spacing: 2
113+ Rectangle {
114+ width: 50
115+ height: 50
116+ Timer {
117+ id: timer
118+ //interval seems to be about 10 msec
119+ interval: 1
120+ running: false
121+ repeat: true
122+ onTriggered: timer.runtime()
123+
124+ function runtime() {
125+ milliseconds = milliseconds+1
126+ time.text = milliseconds
127+ }
128+ }
129+
130+ Text {
131+ id: time
132+ objectName: "time"
133+ }
134+
135+ }
136+ Rectangle {
137+ width: 50
138+ height: 50
139+ Button {
140+ id: clickMeButton
141+ objectName: "clickMeButton"
142+ text: "Click Me"
143+
144+ onPressedChanged: {
145+ if (clickMeButton.pressed == true) {
146+ milliseconds = 0
147+ timer.start()
148+ }
149+ if (clickMeButton.pressed == false) {
150+ timer.stop()
151+ }
152+ }
153+ }
154+ }
155+ }
156+ }
157+ """)
158+
159+ def _start_qml_script(self, script_contents):
160+ """Launch a qml script."""
161+ qml_path = mktemp(suffix='.qml')
162+ open(qml_path, 'w').write(script_contents)
163+ self.addCleanup(os.remove, qml_path)
164+
165+ extra_args = ''
166+
167+ if platform.model() != 'Desktop':
168+ # We need to add the desktop-file-hint
169+ desktop_file = self.useFixture(
170+ TempDesktopFile()
171+ ).get_desktop_file_path()
172+ extra_args = '--desktop_file_hint={}'.format(desktop_file)
173+
174+ return self.launch_test_application(
175+ "qmlscene",
176+ "-qt=qt5",
177+ qml_path,
178+ extra_args,
179+ app_type='qt',
180+ )
181+
182+ def setUp(self):
183+ self.app = self._start_qml_script(self.test_qml)
184+ self.button = self.app.select_single(
185+ 'Button',
186+ objectName='clickMeButton',
187+ )
188+ self.timer_text = self.app.wait_select_single(
189+ '*',
190+ objectName='time',
191+ )
192+
193+ super(PointerClickTests, self).setUp()
194+
195+ @property
196+ def pointer(self):
197+ """ Return pointer """
198+ return Pointer(self.input_device_class.create())
199+
200+ def test_press_duration_1_second(self):
201+ self.pointer.click_object(self.button, press_duration=1)
202+ # give a couple second for slow emulators to respond
203+ self.assertThat(int(self.timer_text.text), LessThan(400))
204+ # verify it's much higher than the default time
205+ self.assertThat(int(self.timer_text.text), GreaterThan(98))
206+
207+ def test_press_duration_default_10_ms(self):
208+ self.pointer.click_object(self.button)
209+ self.assertThat(int(self.timer_text.text), LessThan(11))
210+
211+
212 class InputStackCleanupTests(TestCase):
213
214 def test_cleanup_called(self):

Subscribers

People subscribed via source and target branches