Merge lp:~elopio/unity-scope-click/autopilot-tests1 into lp:unity-scope-click

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 100
Merged at revision: 100
Proposed branch: lp:~elopio/unity-scope-click/autopilot-tests1
Merge into: lp:unity-scope-click
Diff against target: 50 lines (+42/-0)
1 file modified
src/tests/autopilot/unityclickscope/test_click_scope.py (+42/-0)
To merge this branch: bzr merge lp:~elopio/unity-scope-click/autopilot-tests1
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Mike McCracken (community) Approve
Richard Huddie (community) Approve
Review via email: mp+200126@code.launchpad.net

Commit message

Added a simple autopilot test that opens the scope.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:98
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~elopio/unity-scope-click/autopilot-tests1/+merge/200126/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-scope-click-ci/139/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-click-trusty-amd64-ci/37
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-click-trusty-armhf-ci/37

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity-scope-click-ci/139/rebuild

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

Waiting for the scope scrolling methods to be merged into unity:
https://code.launchpad.net/~elopio/unity8/open_scope/+merge/200426

Revision history for this message
Richard Huddie (rhuddie) :
review: Approve
Revision history for this message
Javier Collado (javier.collado) wrote :

The code looks good, but I'm curious about why `dict` is being used instead of
a dictionary literal. Is not a big deal, but I'd like to be consistent with the
style being used in other tests when I write one in the future.

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

> The code looks good, but I'm curious about why `dict` is being used instead of
> a dictionary literal. Is not a big deal, but I'd like to be consistent with
> the
> style being used in other tests when I write one in the future.

Well, I just copied this from Unity. Unity has a private method _get_scenarios or something like that, but I prefer to have the scenarios we are testing listed explicitly.
About using 'dict', I prefer it this way but I have no real reason. If you don't have any reason or preference for using the {}, lets keep doing it this way.

99. By Leo Arias

Updated to use unity helpers.

Revision history for this message
Mike McCracken (mikemc) wrote :

oops - copyright header says 2013

review: Needs Fixing
100. By Leo Arias

Updated copyright year.

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

tests pass for me with current trunk of unity8 installed, then pointing these tests at the unity8 python autopilot modules manually, which I did because I was too lazy to figure out how to manually install that package:

PYTHONPATH=$PYTHONPATH:/home/mmccrack/src/unity8/trunk/tests/autopilot autopilot run unityclickscope

Thanks for tackling this, Leo!

review: Approve
Revision history for this message
Mike McCracken (mikemc) wrote :

note - my comment is about running on the desktop btw.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'src/tests'
2=== added directory 'src/tests/autopilot'
3=== added directory 'src/tests/autopilot/unityclickscope'
4=== added file 'src/tests/autopilot/unityclickscope/__init__.py'
5=== added file 'src/tests/autopilot/unityclickscope/test_click_scope.py'
6--- src/tests/autopilot/unityclickscope/test_click_scope.py 1970-01-01 00:00:00 +0000
7+++ src/tests/autopilot/unityclickscope/test_click_scope.py 2014-01-10 17:19:33 +0000
8@@ -0,0 +1,42 @@
9+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
10+#
11+# Copyright (C) 2013, 2014 Canonical Ltd.
12+#
13+# This program is free software; you can redistribute it and/or modify
14+# it under the terms of the GNU General Public License version 3, as published
15+# by the Free Software Foundation.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU General Public License for more details.
21+#
22+# You should have received a copy of the GNU General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
25+from autopilot.matchers import Eventually
26+from testtools.matchers import Equals
27+from unity8 import process_helpers
28+from unity8.shell import tests as unity_tests
29+
30+
31+class ScopeClickTestCase(unity_tests.UnityTestCase):
32+
33+ scenarios = [
34+ ('Desktop Nexus 4', dict(
35+ app_width=768, app_height=1280, grid_unit_px=18)),
36+ ('Desktop Nexus 10',
37+ dict(app_width=2560, app_height=1600, grid_unit_px=20))
38+ ]
39+
40+ def setUp(self):
41+ super(ScopeClickTestCase, self).setUp()
42+ unity_proxy = self.launch_unity()
43+ process_helpers.unlock_unity(unity_proxy)
44+ self.dash = self.main_window.get_dash()
45+ self.scope = self.dash.get_scope('applications')
46+
47+ def test_open_scope_scrolling(self):
48+ self.assertFalse(self.scope.isCurrent)
49+ self.dash.open_scope('applications')
50+ self.assertThat(self.scope.isCurrent, Eventually(Equals(True)))

Subscribers

People subscribed via source and target branches

to all changes: