Merge lp:~elopio/unity8/open_scope into lp:unity8

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/unity8/open_scope
Merge into: lp:unity8
Diff against target: 363 lines (+242/-23)
6 files modified
debian/control (+1/-0)
tests/autopilot/unity8/shell/emulators/__init__.py (+13/-6)
tests/autopilot/unity8/shell/emulators/dash.py (+106/-12)
tests/autopilot/unity8/shell/emulators/greeter.py (+2/-5)
tests/autopilot/unity8/shell/tests/__init__.py (+1/-0)
tests/autopilot/unity8/shell/tests/test_emulators.py (+119/-0)
To merge this branch: bzr merge lp:~elopio/unity8/open_scope
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Richard Huddie (community) Approve
Unity Team Pending
Review via email: mp+200426@code.launchpad.net

This proposal has been superseded by a proposal from 2014-01-09.

Commit message

Added methods to scroll to other scopes on autopilot tests.

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
Richard Huddie (rhuddie) wrote :

Regarding the last 2 tests, test_open_generic_scope and test_open_applications_scope should there also be some assertion/action to make sure that the target scope is not already opened? Otherwise if the tests are run out of sequence or if the device is left with that scope already open, the test may not actually do anything other than check it is already opened.

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

What I wanted to test in those two is just that the returned scope is of the right type. If it's open or not didn't seem relevant for me, as the opening is tested in the other tests.

Revision history for this message
Richard Huddie (rhuddie) wrote :

Agreed, just wanted to clarify the scope of the test.

review: Approve
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:617
http://jenkins.qa.ubuntu.com/job/unity8-ci/1992/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2009
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1922/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/811
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/514
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/516
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/516/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/514
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1764
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2009
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2009/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1922
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1922/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4397/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2734

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

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

FAILED: Continuous integration, rev:618
http://jenkins.qa.ubuntu.com/job/unity8-ci/2001/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2076
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1977/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/827
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/523
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/525
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/525/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/523
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1823
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2076
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2076/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1977
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1977/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4451/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2805

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

back to work in progress because now there is no bottom bar, and the header has the toolkit tabs.

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

FAILED: Continuous integration, rev:619
http://jenkins.qa.ubuntu.com/job/unity8-ci/2003/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2082
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1981/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/829/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/525
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/527
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/527/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/525
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1828
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2082
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2082/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1981
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1981/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4455/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2814

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

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

FAILED: Continuous integration, rev:619
http://jenkins.qa.ubuntu.com/job/unity8-ci/2008/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2097
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1996/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/838
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/530
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/532
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/532/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/530
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1841
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2097
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2097/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1996
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1996/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4468/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2832

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Back to work in progress. Now I won't use indexes.

lp:~elopio/unity8/open_scope updated
621. By Leo Arias

Typo.

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 :

FAILED: Continuous integration, rev:620
http://jenkins.qa.ubuntu.com/job/unity8-ci/2013/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2124
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2022/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/844
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/535
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/537
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/537/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/535
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1857
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2126
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2126/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2022
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2022/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4492/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2864

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

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

FAILED: Continuous integration, rev:621
http://jenkins.qa.ubuntu.com/job/unity8-ci/2016/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2129
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2027/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/847
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/538
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/540
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/540/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/538
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1862
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2131
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2131/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2027
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2027/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4496/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2868

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

review: Needs Fixing (continuous-integration)
lp:~elopio/unity8/open_scope updated
622. By Leo Arias

added the missing x.

623. By Leo Arias

Merged with trunk.

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

FAILED: Continuous integration, rev:623
http://jenkins.qa.ubuntu.com/job/unity8-ci/2017/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2140
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2033/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/848
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/539
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/541
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/541/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/539
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1869
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2142
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2142/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2033
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2033/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4503/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2882

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

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

FAILED: Continuous integration, rev:623
http://jenkins.qa.ubuntu.com/job/unity8-ci/2020/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2143
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2036/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/851
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/542
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/544
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/544/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/542
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1871
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2145
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2145/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2036
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2036/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4505/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2885

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good to me, tests pass in my machine, wonder why not in CI :_/

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

FAILED: Continuous integration, rev:623
http://jenkins.qa.ubuntu.com/job/unity8-ci/2028/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2162
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2055/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/859
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/550
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/552
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/552/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/550
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1886
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2164
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2164/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2055
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2055/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4521/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2904

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

review: Needs Fixing (continuous-integration)
lp:~elopio/unity8/open_scope updated
624. By Leo Arias

Use the emulator pointing device on the Greeter.

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

FAILED: Continuous integration, rev:624
http://jenkins.qa.ubuntu.com/job/unity8-ci/2029/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2171
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2064/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/860
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/551
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/553
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/553/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/551
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1895
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2173
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2173/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2064
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2064/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4530/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2914

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

review: Needs Fixing (continuous-integration)
lp:~elopio/unity8/open_scope updated
625. By Leo Arias

Merged with prerequisite.

626. By Leo Arias

Unlock using the process helper, to get retries.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-12-20 15:37:27 +0000
3+++ debian/control 2014-01-09 21:28:09 +0000
4@@ -104,6 +104,7 @@
5 libqt5widgets5,
6 python-evdev,
7 python-gi,
8+ python-mock,
9 unity8 (>= ${source:Version}),
10 unity8-fake-env (>= ${source:Version}),
11 ${misc:Depends},
12
13=== modified file 'tests/autopilot/unity8/shell/emulators/__init__.py'
14--- tests/autopilot/unity8/shell/emulators/__init__.py 2013-10-02 09:01:12 +0000
15+++ tests/autopilot/unity8/shell/emulators/__init__.py 2014-01-09 21:28:09 +0000
16@@ -1,7 +1,7 @@
17 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
18 #
19 # Unity Autopilot Test Suite
20-# Copyright (C) 2012-2013 Canonical
21+# Copyright (C) 2012, 2013, 2014 Canonical
22 #
23 # This program is free software: you can redistribute it and/or modify
24 # it under the terms of the GNU General Public License as published by
25@@ -17,9 +17,16 @@
26 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #
28
29-
30-from autopilot.introspection import CustomEmulatorBase
31-
32-
33-class UnityEmulatorBase(CustomEmulatorBase):
34+from autopilot import input, introspection
35+
36+
37+class UnityEmulatorBase(introspection.CustomEmulatorBase):
38 """A base class for all unity emulators."""
39+
40+ def __init__(self, *args):
41+ super(UnityEmulatorBase, self).__init__(*args)
42+ self.pointing_device = input.Touch.create()
43+
44+
45+class UnityEmulatorException(Exception):
46+ """Exception raised when there is an error with the Unity emulators."""
47
48=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
49--- tests/autopilot/unity8/shell/emulators/dash.py 2013-11-01 13:59:50 +0000
50+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-01-09 21:28:09 +0000
51@@ -1,7 +1,7 @@
52 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
53 #
54 # Unity Autopilot Test Suite
55-# Copyright (C) 2012-2013 Canonical
56+# Copyright (C) 2012, 2013, 2014 Canonical
57 #
58 # This program is free software: you can redistribute it and/or modify
59 # it under the terms of the GNU General Public License as published by
60@@ -17,13 +17,25 @@
61 # along with this program. If not, see <http://www.gnu.org/licenses/>.
62 #
63
64-from unity8.shell.emulators import UnityEmulatorBase
65-
66-
67-class Dash(UnityEmulatorBase):
68-
69+import logging
70+
71+from unity8.shell import emulators
72+
73+from autopilot import logging as autopilot_logging
74+from autopilot.introspection import dbus
75+
76+
77+logger = logging.getLogger(__name__)
78+
79+
80+class Dash(emulators.UnityEmulatorBase):
81 """An emulator that understands the Dash."""
82
83+ def __init__(self, *args):
84+ super(Dash, self).__init__(*args)
85+ self.dash_content_list = self.wait_select_single(
86+ 'QQuickListView', objectName='dashContentList')
87+
88 def get_home_applications_grid(self):
89 get_grid = self.get_scope('home').wait_select_single(
90 "GenericFilterGrid",
91@@ -43,9 +55,91 @@
92 return resp_grid.select_single('Tile', text=text)
93
94 def get_scope(self, scope_name='home'):
95- dash_content = self.wait_select_single(
96- 'QQuickListView',
97- objectName='dashContentList'
98- )
99- scope_id = "%s.scope" % scope_name
100- return dash_content.select_single('QQuickLoader', scopeId=scope_id)
101+ scope_id = "%s.scope" % scope_name
102+ return self.dash_content_list.select_single(
103+ 'QQuickLoader', scopeId=scope_id)
104+
105+ @autopilot_logging.log_action(logger.info)
106+ def open_scope(self, scope_name):
107+ """Open a dash scope.
108+
109+ :parameter scope_name: The name of the scope.
110+ :return: The scope.
111+
112+ """
113+ scope_id = "%s.scope" % scope_name
114+ scope_loader = self._get_scope_loader(scope_id)
115+ if scope_loader.isCurrent:
116+ logger.info('The scope is already open.')
117+ return self._get_scope_from_loader(scope_loader)
118+ else:
119+ return self._open_scope_scrolling(scope_loader)
120+
121+ def _get_scope_loader(self, scope_id):
122+ try:
123+ return self.dash_content_list.select_single(
124+ 'QQuickLoader', scopeId=scope_id)
125+ except dbus.StateNotFoundError:
126+ raise emulators.UnityEmulatorException(
127+ 'No scope found with id {0}'.format(scope_id))
128+
129+ def _get_scope_from_loader(self, loader):
130+ if loader.scopeId == 'applications.scope':
131+ return loader.select_single(DashApps)
132+ else:
133+ return loader.select_single(GenericScopeView)
134+
135+ def _open_scope_scrolling(self, scope_loader):
136+ scroll = self._get_scroll_direction(scope_loader)
137+
138+ while not scope_loader.isCurrent:
139+ scroll()
140+
141+ scope = self._get_scope_from_loader(scope_loader)
142+ scope.moving.wait_for(False)
143+ scope.isCurrent.wait_for(True)
144+ return scope
145+
146+ def _get_scroll_direction(self, scope_loader):
147+ current_scope_loader = self.dash_content_list.select_single(
148+ 'QQuickLoader', isCurrent=True)
149+ if scope_loader.globalRect.x < current_scope_loader.globalRect.x:
150+ return self._scroll_to_left_scope
151+ elif scope_loader.globalRect.x > current_scope_loader.globalRect.x:
152+ return self._scroll_to_right_scope
153+ else:
154+ raise emulators.UnityEmulatorException('The scope is already open')
155+
156+ @autopilot_logging.log_action(logger.info)
157+ def _scroll_to_left_scope(self):
158+ original_index = self.dash_content_list.currentIndex
159+ # Scroll on the border of the page header, because some scopes have
160+ # contents that can be scrolled horizontally.
161+ page_header = self.select_single('PageHeader')
162+ border = page_header.select_single('QQuickBorderImage')
163+ start_x = border.width / 3
164+ stop_x = border.width / 3 * 2
165+ start_y = stop_y = border.globalRect.y + border.height / 2
166+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
167+ self.dash_content_list.currentIndex.wait_for(original_index - 1)
168+
169+ @autopilot_logging.log_action(logger.info)
170+ def _scroll_to_right_scope(self):
171+ original_index = self.dash_content_list.currentIndex
172+ # Scroll on the border of the page header, because some scopes have
173+ # contents that can be scrolled horizontally.
174+ page_header = self.select_single('PageHeader')
175+ border = page_header.select_single('QQuickBorderImage')
176+ start_x = border.width / 3 * 2
177+ stop_x = border.width / 3
178+ start_y = stop_y = border.globalRect.y + border.height / 2
179+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
180+ self.dash_content_list.currentIndex.wait_for(original_index + 1)
181+
182+
183+class GenericScopeView(emulators.UnityEmulatorBase):
184+ """Autopilot emulators for generic scopes."""
185+
186+
187+class DashApps(emulators.UnityEmulatorBase):
188+ """Autopilot emulators for the applications scope."""
189
190=== modified file 'tests/autopilot/unity8/shell/emulators/greeter.py'
191--- tests/autopilot/unity8/shell/emulators/greeter.py 2013-11-01 13:59:50 +0000
192+++ tests/autopilot/unity8/shell/emulators/greeter.py 2014-01-09 21:28:09 +0000
193@@ -1,7 +1,7 @@
194 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
195 #
196 # Unity Autopilot Test Suite
197-# Copyright (C) 2012-2013 Canonical
198+# Copyright (C) 2012, 2013, 2014 Canonical
199 #
200 # This program is free software: you can redistribute it and/or modify
201 # it under the terms of the GNU General Public License as published by
202@@ -18,24 +18,21 @@
203 #
204
205 from unity8.shell.emulators import UnityEmulatorBase
206-from autopilot.input import Touch
207
208
209 class Greeter(UnityEmulatorBase):
210-
211 """An emulator that understands the greeter screen."""
212
213 def swipe(self):
214 """Swipe the greeter screen away."""
215 self.created.wait_for(True)
216- touch = Touch.create()
217
218 rect = self.globalRect
219 start_x = rect[0] + rect[2] - 3
220 start_y = int(rect[1] + rect[3] / 2)
221 stop_x = int(rect[0] + rect[2] * 0.2)
222 stop_y = start_y
223- touch.drag(start_x, start_y, stop_x, stop_y)
224+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
225
226 self.created.wait_for(False)
227
228
229=== modified file 'tests/autopilot/unity8/shell/tests/__init__.py'
230--- tests/autopilot/unity8/shell/tests/__init__.py 2013-11-14 03:36:01 +0000
231+++ tests/autopilot/unity8/shell/tests/__init__.py 2014-01-09 21:28:09 +0000
232@@ -147,6 +147,7 @@
233 if model() != "Desktop":
234 from autopilot.input import _uinput
235 _uinput._touch_device = _uinput.create_touch_device()
236+ self.addCleanup(_uinput._touch_device.close)
237 ####
238
239 self.touch = Touch.create()
240
241=== added file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
242--- tests/autopilot/unity8/shell/tests/test_emulators.py 1970-01-01 00:00:00 +0000
243+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-01-09 21:28:09 +0000
244@@ -0,0 +1,119 @@
245+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
246+#
247+# Unity Autopilot Test Suite
248+# Copyright (C) 2014 Canonical
249+#
250+# This program is free software: you can redistribute it and/or modify
251+# it under the terms of the GNU General Public License as published by
252+# the Free Software Foundation, either version 3 of the License, or
253+# (at your option) any later version.
254+#
255+# This program is distributed in the hope that it will be useful,
256+# but WITHOUT ANY WARRANTY; without even the implied warranty of
257+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
258+# GNU General Public License for more details.
259+#
260+# You should have received a copy of the GNU General Public License
261+# along with this program. If not, see <http://www.gnu.org/licenses/>.
262+#
263+
264+import mock
265+
266+from unity8.shell import emulators, tests
267+from unity8.shell.emulators import dash as dash_emulators
268+
269+
270+class DashEmulatorTestCase(tests.UnityTestCase):
271+
272+ scenarios = tests._get_device_emulation_scenarios()
273+
274+ def setUp(self):
275+ super(DashEmulatorTestCase, self).setUp()
276+ self.launch_unity()
277+ self.main_window.get_greeter().swipe()
278+ self.dash = self.main_window.get_dash()
279+
280+ def test_open_unexisting_scope(self):
281+ scope_name = 'unexisting'
282+ with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
283+ exception = self.assertRaises(
284+ emulators.UnityEmulatorException,
285+ self.dash.open_scope, scope_name)
286+
287+ self.assertEqual(
288+ 'No scope found with id unexisting.scope', str(exception))
289+ self.assertFalse(mock_pointer.called)
290+
291+ def test_open_already_opened_scope(self):
292+ scope_id = self._get_current_scope_id()
293+ with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
294+ scope = self.dash.open_scope(self._get_scope_name_from_id(
295+ scope_id))
296+
297+ self.assertFalse(mock_pointer.called)
298+ self._assert_scope_is_opened(scope, scope_id)
299+
300+ def _assert_scope_is_opened(self, scope, scope_id):
301+ self.assertTrue(scope.isCurrent)
302+ scope_loader = scope.get_parent()
303+ self.assertEqual(scope_loader.scopeId, scope_id)
304+
305+ def _get_current_scope_id(self):
306+ scope = self.dash.dash_content_list.select_single(
307+ 'QQuickLoader', isCurrent=True)
308+ return scope.scopeId
309+
310+ def test_open_scope_to_the_right(self):
311+ leftmost_scope = self._get_scope_name_from_id(
312+ self._get_leftmost_scope_id())
313+ self.dash.open_scope(leftmost_scope)
314+
315+ scope_id = self._get_rightmost_scope_id()
316+ scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
317+ self._assert_scope_is_opened(scope, scope_id)
318+
319+ def _get_leftmost_scope_id(self):
320+ scope_loaders = self._get_scope_loaders()
321+ leftmost_scope_loader = scope_loaders[0]
322+ for loader in scope_loaders[1:]:
323+ if loader.globalRect.x < leftmost_scope_loader.globalRect.x:
324+ leftmost_scope_loader = loader
325+ return leftmost_scope_loader.scopeId
326+
327+ def _get_scope_loaders(self):
328+ item = self.dash.dash_content_list.get_children_by_type(
329+ 'QQuickItem')[0]
330+ return item.get_children_by_type('QQuickLoader')
331+
332+ def _get_scope_name_from_id(self, scope_id):
333+ if scope_id.endswith('.scope'):
334+ return scope_id[:-6]
335+
336+ def _get_rightmost_scope_id(self):
337+ scope_loaders = self._get_scope_loaders()
338+ rightmost_scope_loader = scope_loaders[0]
339+ for loader in scope_loaders[1:]:
340+ if loader.globalRect.x > rightmost_scope_loader.globalRect.x:
341+ rightmost_scope_loader = loader
342+ return rightmost_scope_loader.scopeId
343+
344+ def test_open_scope_to_the_left(self):
345+ rightmost_scope = self._get_scope_name_from_id(
346+ self._get_rightmost_scope_id())
347+ self.dash.open_scope(rightmost_scope)
348+
349+ scope_id = self._get_leftmost_scope_id()
350+ scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
351+ self._assert_scope_is_opened(scope, scope_id)
352+
353+ def test_open_generic_scope(self):
354+ scope_id = 'home.scope'
355+ scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
356+ self._assert_scope_is_opened(scope, scope_id)
357+ self.assertIsInstance(scope, dash_emulators.GenericScopeView)
358+
359+ def test_open_applications_scope(self):
360+ scope_id = 'applications.scope'
361+ scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
362+ self._assert_scope_is_opened(scope, scope_id)
363+ self.assertIsInstance(scope, dash_emulators.DashApps)

Subscribers

People subscribed via source and target branches