Merge lp:~allanlesage/ubuntu-autopilot-tests/pick-first-app-demo into lp:~rhuddie/ubuntu-autopilot-tests/create-u1-user-install-app

Proposed by Allan LeSage
Status: Needs review
Proposed branch: lp:~allanlesage/ubuntu-autopilot-tests/pick-first-app-demo
Merge into: lp:~rhuddie/ubuntu-autopilot-tests/create-u1-user-install-app
Diff against target: 89 lines (+24/-9)
2 files modified
ubuntu_integration_tests/tests/__init__.py (+6/-2)
ubuntu_integration_tests/tests/test_u1_create_user_install_app.py (+18/-7)
To merge this branch: bzr merge lp:~allanlesage/ubuntu-autopilot-tests/pick-first-app-demo
Reviewer Review Type Date Requested Status
Richard Huddie Pending
Review via email: mp+212954@code.launchpad.net

Description of the change

Add a few steps to select and open the first app in the apps scope. This will require some dash emulator changes which are still in process, will update here when they're MP'ed.

To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Can we reject this MP if it's no longer needed? Thanks!

Unmerged revisions

14. By Allan LeSage

Cleanup from NF team suggestions.

13. By Allan LeSage

Demo of 'pick first app' test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_integration_tests/tests/__init__.py'
2--- ubuntu_integration_tests/tests/__init__.py 2014-02-08 14:47:33 +0000
3+++ ubuntu_integration_tests/tests/__init__.py 2014-03-26 21:30:09 +0000
4@@ -9,17 +9,21 @@
5 # by the Free Software Foundation.
6
7 from autopilot.input import Touch, Pointer
8-from autopilot.testcase import AutopilotTestCase
9+from unity8.process_helpers import unlock_unity
10+from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
11
12 from ubuntu_integration_tests import fixture_setup, helpers
13
14
15-class IntegrationTestCase(AutopilotTestCase):
16+class IntegrationTestCase(UnityTestCase):
17
18 def setUp(self):
19 super(IntegrationTestCase, self).setUp()
20 self.pointing_device = Pointer(Touch.create())
21 self._set_testability_environment()
22+ self.unity_proxy = self.launch_unity()
23+ unlock_unity(self.unity_proxy)
24+ self.dash = self.main_window.get_dash()
25
26 def _set_testability_environment(self):
27 testability_environment = fixture_setup.TestabilityEnvironment()
28
29=== modified file 'ubuntu_integration_tests/tests/test_u1_create_user_install_app.py'
30--- ubuntu_integration_tests/tests/test_u1_create_user_install_app.py 2014-03-07 09:59:37 +0000
31+++ ubuntu_integration_tests/tests/test_u1_create_user_install_app.py 2014-03-26 21:30:09 +0000
32@@ -16,10 +16,15 @@
33 # You should have received a copy of the GNU General Public License
34 # along with this program. If not, see <http://www.gnu.org/licenses/>.
35
36+from time import sleep
37 import uuid
38
39 from autopilot import platform
40+from autopilot.input import Touch, Pointer
41 from ubuntu_integration_tests import helpers, tests
42+from ubuntu_integration_tests.emulators.dash import AlesageDash
43+from unity8.process_helpers import unlock_unity
44+from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
45
46
47 class UbuntuOneIntegrationTestCase(tests.IntegrationTestCase):
48@@ -31,13 +36,16 @@
49 return 'u1test+{}@canonical.com'.format(uuid.uuid4())
50
51 def open_system_settings(self):
52- raise NotImplementedError('TODO')
53+ pass
54+ #raise NotImplementedError('TODO')
55
56 def return_to_home_screen(self):
57- raise NotImplementedError('TODO')
58+ pass
59+ #raise NotImplementedError('TODO')
60
61 def assert_app_is_running(self, app_name):
62- raise NotImplementedError('TODO')
63+ pass
64+ #raise NotImplementedError('TODO')
65
66 def test_create_ubuntuone_user_install_app(self):
67 # generate unique user info
68@@ -56,9 +64,13 @@
69 self.return_to_homescreen()
70
71 # navigate to apps scope, navigate to suggested apps and select an app to install
72- app_scope = self.open_app_scope()
73- suggested_apps = app_scope.navigate_to_suggested_apps()
74- selected_app, selected_app_name = suggested_apps.press_first_available_app()
75+ dash_apps = self.dash.open_scope('clickscope')
76+ applications = dash_apps.get_applications('appstore')
77+ try:
78+ selected_app = applications[0]
79+ except KeyError:
80+ self.fail('No applications found.')
81+ dash_apps.open_preview('appstore', selected_app.title)
82
83 # install app and then launch it
84 selected_app.press_install()
85@@ -67,4 +79,3 @@
86
87 # assert the app is running
88 self.assert_app_is_running(selected_app_name)
89-

Subscribers

People subscribed via source and target branches

to all changes: