Merge lp:~om26er/camera-app/gallery_integration_test into lp:camera-app

Proposed by Omer Akram
Status: Merged
Approved by: Omer Akram
Approved revision: 219
Merged at revision: 229
Proposed branch: lp:~om26er/camera-app/gallery_integration_test
Merge into: lp:camera-app
Diff against target: 75 lines (+52/-0)
3 files modified
debian/control (+1/-0)
tests/autopilot/camera_app/emulators/main_window.py (+4/-0)
tests/autopilot/camera_app/tests/test_gallery_integration.py (+47/-0)
To merge this branch: bzr merge lp:~om26er/camera-app/gallery_integration_test
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+189797@code.launchpad.net

Commit message

add integration test to make sure gallery icon in the camera toolbar really opens the gallery-app

Description of the change

add integration test to make sure gallery icon in the camera toolbar really opens the gallery-app

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
214. By Omer Akram

make tearDown less error prone

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
215. By Omer Akram

simplify the integration test code much

216. By Omer Akram

fix integration test

217. By Omer Akram

depend -autopilot on unity8-autopilot as we use emulators from there

218. By Omer Akram

merge trunk

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

fix tearDown order

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :
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=== modified file 'debian/control'
2--- debian/control 2013-11-06 15:08:41 +0000
3+++ debian/control 2013-11-19 14:49:27 +0000
4@@ -49,6 +49,7 @@
5 libautopilot-qt (>= 1.4),
6 libqt5test5,
7 libqt5widgets5,
8+ unity8-autopilot,
9 ${misc:Depends},
10 ${shlibs:Depends},
11 Description: Test package for the camera app
12
13=== modified file 'tests/autopilot/camera_app/emulators/main_window.py'
14--- tests/autopilot/camera_app/emulators/main_window.py 2013-11-06 13:49:10 +0000
15+++ tests/autopilot/camera_app/emulators/main_window.py 2013-11-19 14:49:27 +0000
16@@ -71,3 +71,7 @@
17 else:
18 return 'portrait'
19
20+ def get_gallery_button(self):
21+ """Returns the gallery button on the camera toolbar."""
22+ return self.app.select_single(
23+ "CameraToolbarButton", objectName="galleryButton")
24
25=== added file 'tests/autopilot/camera_app/tests/test_gallery_integration.py'
26--- tests/autopilot/camera_app/tests/test_gallery_integration.py 1970-01-01 00:00:00 +0000
27+++ tests/autopilot/camera_app/tests/test_gallery_integration.py 2013-11-19 14:49:27 +0000
28@@ -0,0 +1,47 @@
29+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
30+# Copyright 2013 Canonical
31+#
32+# This program is free software: you can redistribute it and/or modify it
33+# under the terms of the GNU General Public License version 3, as published
34+# by the Free Software Foundation.
35+
36+from __future__ import absolute_import
37+
38+from autopilot.introspection import get_proxy_object_for_existing_process
39+from autopilot.matchers import Eventually
40+from autopilot.platform import model
41+from testtools import skipIf
42+from testtools.matchers import Equals
43+
44+from camera_app.tests import CameraAppTestCase
45+from unity8 import process_helpers as helpers
46+
47+import os
48+
49+
50+@skipIf(model() == 'Desktop', "Phablet only")
51+class TestGalleryIntegration(CameraAppTestCase):
52+
53+ def setUp(self):
54+ super(TestGalleryIntegration, self).setUp()
55+ self.assertThat(
56+ self.main_window.get_qml_view().visible, Eventually(Equals(True)))
57+
58+ def tearDown(self):
59+ os.system("pkill gallery-app")
60+ super(TestGalleryIntegration, self).tearDown()
61+
62+ def get_unity8_proxy_object(self):
63+ pid = helpers._get_unity_pid()
64+ return get_proxy_object_for_existing_process(pid)
65+
66+ def get_current_focused_appid(self, unity8):
67+ return unity8.select_single("Shell").currentFocusedAppId
68+
69+ def test_gallery_button_opens_gallery(self):
70+ gallery_button = self.main_window.get_gallery_button()
71+ unity8 = self.get_unity8_proxy_object()
72+ current_focused_app = self.get_current_focused_appid(unity8)
73+
74+ self.pointing_device.click_object(gallery_button)
75+ self.assertThat(current_focused_app, Eventually(Equals("gallery-app")))

Subscribers

People subscribed via source and target branches