Merge lp:~elopio/ubuntu-autopilot-tests/url_dispatcher into lp:ubuntu-autopilot-tests/ubuntu-experience-tests

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 22
Merged at revision: 19
Proposed branch: lp:~elopio/ubuntu-autopilot-tests/url_dispatcher
Merge into: lp:ubuntu-autopilot-tests/ubuntu-experience-tests
Diff against target: 111 lines (+65/-4)
4 files modified
debian/control (+1/-0)
ubuntu_experience_tests/tests/__init__.py (+6/-2)
ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py (+57/-0)
ubuntu_experience_tests/tests/test_osd_dialer_integration.py (+1/-2)
To merge this branch: bzr merge lp:~elopio/ubuntu-autopilot-tests/url_dispatcher
Reviewer Review Type Date Requested Status
Chris Gagnon (community) Approve
Review via email: mp+208616@code.launchpad.net

Commit message

Test that online accounts launched with url dispatcher can be swiped into background.

To post a comment you must log in.
21. By Leo Arias

Added a docstring.

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

This would be better in a custom proxy object or it it's own click_accept_button method

+ accept_button = self._get_accept_button(self.unity_proxy)
110
111 self.pointing_device.click_object(accept_button)

review: Needs Fixing
22. By Leo Arias

Remove the apostrophe.

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

I didn't look closely enough at the code, it's already in a method... lgtm

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 2014-03-27 17:39:27 +0000
3+++ debian/control 2014-05-28 11:33:37 +0000
4@@ -23,6 +23,7 @@
5 dialer-app-autopilot ( >= 0.1+14.04.20140130-0ubuntu1),
6 ubuntu-ui-toolkit-autopilot,
7 unity8-autopilot,
8+ url-dispatcher-tools,
9 Description: Ubuntu Autopilot Testcases
10 This package provides a set of autopilot tests for testing
11 the inter-app integration under Unity8
12
13=== modified file 'ubuntu_experience_tests/tests/__init__.py'
14--- ubuntu_experience_tests/tests/__init__.py 2014-05-20 12:35:59 +0000
15+++ ubuntu_experience_tests/tests/__init__.py 2014-05-28 11:33:37 +0000
16@@ -19,6 +19,7 @@
17
18 from autopilot.input import Touch, Pointer
19 from unity8.shell import tests as unity_tests
20+from unity8.shell.emulators import main_window
21
22 from unity8 import process_helpers
23
24@@ -28,5 +29,8 @@
25 def setUp(self):
26 super(UbuntuExperienceTestCase, self).setUp()
27 self.pointing_device = Pointer(Touch.create())
28- unity_proxy = self.launch_unity()
29- process_helpers.unlock_unity(unity_proxy)
30+ self._qml_mock_enabled = False
31+ self._data_dirs_mock_enabled = False
32+ self.unity_proxy = self.launch_unity()
33+ process_helpers.unlock_unity(self.unity_proxy)
34+ self.unity = self.unity_proxy.select_single(main_window.QQuickView)
35
36=== added directory 'ubuntu_experience_tests/tests/application_life_cycle'
37=== added file 'ubuntu_experience_tests/tests/application_life_cycle/__init__.py'
38=== added file 'ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py'
39--- ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py 1970-01-01 00:00:00 +0000
40+++ ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py 2014-05-28 11:33:37 +0000
41@@ -0,0 +1,57 @@
42+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
43+#
44+# Copyright (C) 2014 Canonical Ltd.
45+#
46+# This file is part of ubuntu-integration-tests.
47+#
48+# ubuntu-integration-tests is free software; you can redistribute it and/or
49+# modify it under the terms of the GNU General Public License as published by
50+# the Free Software Foundation; version 3.
51+#
52+# This program is distributed in the hope that it will be useful,
53+# but WITHOUT ANY WARRANTY; without even the implied warranty of
54+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+# GNU Lesser General Public License for more details.
56+#
57+# You should have received a copy of the GNU General Public License
58+# along with this program. If not, see <http://www.gnu.org/licenses/>.
59+
60+import os
61+import subprocess
62+
63+from autopilot import platform
64+from autopilot.matchers import Eventually
65+from testtools.matchers import Equals
66+
67+from ubuntu_experience_tests import tests
68+
69+
70+class URLDispatcherTestCase(tests.UbuntuExperienceTestCase):
71+
72+ def setUp(self):
73+ super(URLDispatcherTestCase, self).setUp()
74+ if platform.model() == 'Desktop':
75+ self.skipTest('URL dispatcher does not work on the desktop.')
76+
77+ def test_swipe_out_online_accounts_launched_with_url_dispatcher(self):
78+ """Test online accounts launched with URL Dispatcher.
79+
80+ Check that the application can be swiped out showing the dashboard and
81+ no focused application.
82+
83+ """
84+ self.assertEqual('', self.unity.get_current_focused_app_id())
85+ self.addCleanup(os.system, 'pkill system-settings')
86+ self.addCleanup(os.system, 'pkill online-accounts')
87+
88+ subprocess.check_call(
89+ ['url-dispatcher', 'settings:///system/online-accounts'])
90+
91+ self.assertThat(
92+ self.unity.get_current_focused_app_id,
93+ Eventually(Equals('online-accounts-ui')))
94+
95+ self.unity.show_dash_swiping()
96+ self.assertThat(
97+ self.unity.get_current_focused_app_id,
98+ Eventually(Equals('')))
99
100=== modified file 'ubuntu_experience_tests/tests/test_osd_dialer_integration.py'
101--- ubuntu_experience_tests/tests/test_osd_dialer_integration.py 2014-05-20 13:35:53 +0000
102+++ ubuntu_experience_tests/tests/test_osd_dialer_integration.py 2014-05-28 11:33:37 +0000
103@@ -50,8 +50,7 @@
104 return unity.select_single(objectName='button1', visible=True)
105
106 def _accept_call_from_ui(self):
107- unity = helpers.get_proxy_object_by_process_name('unity8')
108- accept_button = self._get_accept_button(unity)
109+ accept_button = self._get_accept_button(self.unity_proxy)
110
111 self.pointing_device.click_object(accept_button)
112

Subscribers

People subscribed via source and target branches