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
=== modified file 'debian/control'
--- debian/control 2013-12-20 15:37:27 +0000
+++ debian/control 2014-01-09 21:28:09 +0000
@@ -104,6 +104,7 @@
104 libqt5widgets5,104 libqt5widgets5,
105 python-evdev,105 python-evdev,
106 python-gi,106 python-gi,
107 python-mock,
107 unity8 (>= ${source:Version}),108 unity8 (>= ${source:Version}),
108 unity8-fake-env (>= ${source:Version}),109 unity8-fake-env (>= ${source:Version}),
109 ${misc:Depends},110 ${misc:Depends},
110111
=== modified file 'tests/autopilot/unity8/shell/emulators/__init__.py'
--- tests/autopilot/unity8/shell/emulators/__init__.py 2013-10-02 09:01:12 +0000
+++ tests/autopilot/unity8/shell/emulators/__init__.py 2014-01-09 21:28:09 +0000
@@ -1,7 +1,7 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Unity Autopilot Test Suite3# Unity Autopilot Test Suite
4# Copyright (C) 2012-2013 Canonical4# Copyright (C) 2012, 2013, 2014 Canonical
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by7# it under the terms of the GNU General Public License as published by
@@ -17,9 +17,16 @@
17# along with this program. If not, see <http://www.gnu.org/licenses/>.17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#18#
1919
2020from autopilot import input, introspection
21from autopilot.introspection import CustomEmulatorBase21
2222
2323class UnityEmulatorBase(introspection.CustomEmulatorBase):
24class UnityEmulatorBase(CustomEmulatorBase):
25 """A base class for all unity emulators."""24 """A base class for all unity emulators."""
25
26 def __init__(self, *args):
27 super(UnityEmulatorBase, self).__init__(*args)
28 self.pointing_device = input.Touch.create()
29
30
31class UnityEmulatorException(Exception):
32 """Exception raised when there is an error with the Unity emulators."""
2633
=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
--- tests/autopilot/unity8/shell/emulators/dash.py 2013-11-01 13:59:50 +0000
+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-01-09 21:28:09 +0000
@@ -1,7 +1,7 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Unity Autopilot Test Suite3# Unity Autopilot Test Suite
4# Copyright (C) 2012-2013 Canonical4# Copyright (C) 2012, 2013, 2014 Canonical
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by7# it under the terms of the GNU General Public License as published by
@@ -17,13 +17,25 @@
17# along with this program. If not, see <http://www.gnu.org/licenses/>.17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#18#
1919
20from unity8.shell.emulators import UnityEmulatorBase20import logging
2121
2222from unity8.shell import emulators
23class Dash(UnityEmulatorBase):23
2424from autopilot import logging as autopilot_logging
25from autopilot.introspection import dbus
26
27
28logger = logging.getLogger(__name__)
29
30
31class Dash(emulators.UnityEmulatorBase):
25 """An emulator that understands the Dash."""32 """An emulator that understands the Dash."""
2633
34 def __init__(self, *args):
35 super(Dash, self).__init__(*args)
36 self.dash_content_list = self.wait_select_single(
37 'QQuickListView', objectName='dashContentList')
38
27 def get_home_applications_grid(self):39 def get_home_applications_grid(self):
28 get_grid = self.get_scope('home').wait_select_single(40 get_grid = self.get_scope('home').wait_select_single(
29 "GenericFilterGrid",41 "GenericFilterGrid",
@@ -43,9 +55,91 @@
43 return resp_grid.select_single('Tile', text=text)55 return resp_grid.select_single('Tile', text=text)
4456
45 def get_scope(self, scope_name='home'):57 def get_scope(self, scope_name='home'):
46 dash_content = self.wait_select_single(58 scope_id = "%s.scope" % scope_name
47 'QQuickListView',59 return self.dash_content_list.select_single(
48 objectName='dashContentList'60 'QQuickLoader', scopeId=scope_id)
49 )61
50 scope_id = "%s.scope" % scope_name62 @autopilot_logging.log_action(logger.info)
51 return dash_content.select_single('QQuickLoader', scopeId=scope_id)63 def open_scope(self, scope_name):
64 """Open a dash scope.
65
66 :parameter scope_name: The name of the scope.
67 :return: The scope.
68
69 """
70 scope_id = "%s.scope" % scope_name
71 scope_loader = self._get_scope_loader(scope_id)
72 if scope_loader.isCurrent:
73 logger.info('The scope is already open.')
74 return self._get_scope_from_loader(scope_loader)
75 else:
76 return self._open_scope_scrolling(scope_loader)
77
78 def _get_scope_loader(self, scope_id):
79 try:
80 return self.dash_content_list.select_single(
81 'QQuickLoader', scopeId=scope_id)
82 except dbus.StateNotFoundError:
83 raise emulators.UnityEmulatorException(
84 'No scope found with id {0}'.format(scope_id))
85
86 def _get_scope_from_loader(self, loader):
87 if loader.scopeId == 'applications.scope':
88 return loader.select_single(DashApps)
89 else:
90 return loader.select_single(GenericScopeView)
91
92 def _open_scope_scrolling(self, scope_loader):
93 scroll = self._get_scroll_direction(scope_loader)
94
95 while not scope_loader.isCurrent:
96 scroll()
97
98 scope = self._get_scope_from_loader(scope_loader)
99 scope.moving.wait_for(False)
100 scope.isCurrent.wait_for(True)
101 return scope
102
103 def _get_scroll_direction(self, scope_loader):
104 current_scope_loader = self.dash_content_list.select_single(
105 'QQuickLoader', isCurrent=True)
106 if scope_loader.globalRect.x < current_scope_loader.globalRect.x:
107 return self._scroll_to_left_scope
108 elif scope_loader.globalRect.x > current_scope_loader.globalRect.x:
109 return self._scroll_to_right_scope
110 else:
111 raise emulators.UnityEmulatorException('The scope is already open')
112
113 @autopilot_logging.log_action(logger.info)
114 def _scroll_to_left_scope(self):
115 original_index = self.dash_content_list.currentIndex
116 # Scroll on the border of the page header, because some scopes have
117 # contents that can be scrolled horizontally.
118 page_header = self.select_single('PageHeader')
119 border = page_header.select_single('QQuickBorderImage')
120 start_x = border.width / 3
121 stop_x = border.width / 3 * 2
122 start_y = stop_y = border.globalRect.y + border.height / 2
123 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
124 self.dash_content_list.currentIndex.wait_for(original_index - 1)
125
126 @autopilot_logging.log_action(logger.info)
127 def _scroll_to_right_scope(self):
128 original_index = self.dash_content_list.currentIndex
129 # Scroll on the border of the page header, because some scopes have
130 # contents that can be scrolled horizontally.
131 page_header = self.select_single('PageHeader')
132 border = page_header.select_single('QQuickBorderImage')
133 start_x = border.width / 3 * 2
134 stop_x = border.width / 3
135 start_y = stop_y = border.globalRect.y + border.height / 2
136 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
137 self.dash_content_list.currentIndex.wait_for(original_index + 1)
138
139
140class GenericScopeView(emulators.UnityEmulatorBase):
141 """Autopilot emulators for generic scopes."""
142
143
144class DashApps(emulators.UnityEmulatorBase):
145 """Autopilot emulators for the applications scope."""
52146
=== modified file 'tests/autopilot/unity8/shell/emulators/greeter.py'
--- tests/autopilot/unity8/shell/emulators/greeter.py 2013-11-01 13:59:50 +0000
+++ tests/autopilot/unity8/shell/emulators/greeter.py 2014-01-09 21:28:09 +0000
@@ -1,7 +1,7 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Unity Autopilot Test Suite3# Unity Autopilot Test Suite
4# Copyright (C) 2012-2013 Canonical4# Copyright (C) 2012, 2013, 2014 Canonical
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by7# it under the terms of the GNU General Public License as published by
@@ -18,24 +18,21 @@
18#18#
1919
20from unity8.shell.emulators import UnityEmulatorBase20from unity8.shell.emulators import UnityEmulatorBase
21from autopilot.input import Touch
2221
2322
24class Greeter(UnityEmulatorBase):23class Greeter(UnityEmulatorBase):
25
26 """An emulator that understands the greeter screen."""24 """An emulator that understands the greeter screen."""
2725
28 def swipe(self):26 def swipe(self):
29 """Swipe the greeter screen away."""27 """Swipe the greeter screen away."""
30 self.created.wait_for(True)28 self.created.wait_for(True)
31 touch = Touch.create()
3229
33 rect = self.globalRect30 rect = self.globalRect
34 start_x = rect[0] + rect[2] - 331 start_x = rect[0] + rect[2] - 3
35 start_y = int(rect[1] + rect[3] / 2)32 start_y = int(rect[1] + rect[3] / 2)
36 stop_x = int(rect[0] + rect[2] * 0.2)33 stop_x = int(rect[0] + rect[2] * 0.2)
37 stop_y = start_y34 stop_y = start_y
38 touch.drag(start_x, start_y, stop_x, stop_y)35 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
3936
40 self.created.wait_for(False)37 self.created.wait_for(False)
4138
4239
=== modified file 'tests/autopilot/unity8/shell/tests/__init__.py'
--- tests/autopilot/unity8/shell/tests/__init__.py 2013-11-14 03:36:01 +0000
+++ tests/autopilot/unity8/shell/tests/__init__.py 2014-01-09 21:28:09 +0000
@@ -147,6 +147,7 @@
147 if model() != "Desktop":147 if model() != "Desktop":
148 from autopilot.input import _uinput148 from autopilot.input import _uinput
149 _uinput._touch_device = _uinput.create_touch_device()149 _uinput._touch_device = _uinput.create_touch_device()
150 self.addCleanup(_uinput._touch_device.close)
150 ####151 ####
151152
152 self.touch = Touch.create()153 self.touch = Touch.create()
153154
=== added file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
--- tests/autopilot/unity8/shell/tests/test_emulators.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-01-09 21:28:09 +0000
@@ -0,0 +1,119 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Unity Autopilot Test Suite
4# Copyright (C) 2014 Canonical
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19
20import mock
21
22from unity8.shell import emulators, tests
23from unity8.shell.emulators import dash as dash_emulators
24
25
26class DashEmulatorTestCase(tests.UnityTestCase):
27
28 scenarios = tests._get_device_emulation_scenarios()
29
30 def setUp(self):
31 super(DashEmulatorTestCase, self).setUp()
32 self.launch_unity()
33 self.main_window.get_greeter().swipe()
34 self.dash = self.main_window.get_dash()
35
36 def test_open_unexisting_scope(self):
37 scope_name = 'unexisting'
38 with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
39 exception = self.assertRaises(
40 emulators.UnityEmulatorException,
41 self.dash.open_scope, scope_name)
42
43 self.assertEqual(
44 'No scope found with id unexisting.scope', str(exception))
45 self.assertFalse(mock_pointer.called)
46
47 def test_open_already_opened_scope(self):
48 scope_id = self._get_current_scope_id()
49 with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
50 scope = self.dash.open_scope(self._get_scope_name_from_id(
51 scope_id))
52
53 self.assertFalse(mock_pointer.called)
54 self._assert_scope_is_opened(scope, scope_id)
55
56 def _assert_scope_is_opened(self, scope, scope_id):
57 self.assertTrue(scope.isCurrent)
58 scope_loader = scope.get_parent()
59 self.assertEqual(scope_loader.scopeId, scope_id)
60
61 def _get_current_scope_id(self):
62 scope = self.dash.dash_content_list.select_single(
63 'QQuickLoader', isCurrent=True)
64 return scope.scopeId
65
66 def test_open_scope_to_the_right(self):
67 leftmost_scope = self._get_scope_name_from_id(
68 self._get_leftmost_scope_id())
69 self.dash.open_scope(leftmost_scope)
70
71 scope_id = self._get_rightmost_scope_id()
72 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
73 self._assert_scope_is_opened(scope, scope_id)
74
75 def _get_leftmost_scope_id(self):
76 scope_loaders = self._get_scope_loaders()
77 leftmost_scope_loader = scope_loaders[0]
78 for loader in scope_loaders[1:]:
79 if loader.globalRect.x < leftmost_scope_loader.globalRect.x:
80 leftmost_scope_loader = loader
81 return leftmost_scope_loader.scopeId
82
83 def _get_scope_loaders(self):
84 item = self.dash.dash_content_list.get_children_by_type(
85 'QQuickItem')[0]
86 return item.get_children_by_type('QQuickLoader')
87
88 def _get_scope_name_from_id(self, scope_id):
89 if scope_id.endswith('.scope'):
90 return scope_id[:-6]
91
92 def _get_rightmost_scope_id(self):
93 scope_loaders = self._get_scope_loaders()
94 rightmost_scope_loader = scope_loaders[0]
95 for loader in scope_loaders[1:]:
96 if loader.globalRect.x > rightmost_scope_loader.globalRect.x:
97 rightmost_scope_loader = loader
98 return rightmost_scope_loader.scopeId
99
100 def test_open_scope_to_the_left(self):
101 rightmost_scope = self._get_scope_name_from_id(
102 self._get_rightmost_scope_id())
103 self.dash.open_scope(rightmost_scope)
104
105 scope_id = self._get_leftmost_scope_id()
106 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
107 self._assert_scope_is_opened(scope, scope_id)
108
109 def test_open_generic_scope(self):
110 scope_id = 'home.scope'
111 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
112 self._assert_scope_is_opened(scope, scope_id)
113 self.assertIsInstance(scope, dash_emulators.GenericScopeView)
114
115 def test_open_applications_scope(self):
116 scope_id = 'applications.scope'
117 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
118 self._assert_scope_is_opened(scope, scope_id)
119 self.assertIsInstance(scope, dash_emulators.DashApps)

Subscribers

People subscribed via source and target branches