Merge lp:~canonical-platform-qa/ubuntu-autopilot-tests/launcher_messaging_experience into lp:ubuntu-autopilot-tests/ubuntu-experience-tests

Proposed by Omer Akram
Status: Needs review
Proposed branch: lp:~canonical-platform-qa/ubuntu-autopilot-tests/launcher_messaging_experience
Merge into: lp:ubuntu-autopilot-tests/ubuntu-experience-tests
Diff against target: 83 lines (+56/-1)
3 files modified
debian/control (+2/-0)
ubuntu_experience_tests/helpers.py (+1/-1)
ubuntu_experience_tests/tests/test_user_experiences.py (+53/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-autopilot-tests/launcher_messaging_experience
Reviewer Review Type Date Requested Status
Brendan Donegan (community) Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Leo Arias (community) Needs Fixing
Review via email: mp+225465@code.launchpad.net

Commit message

Automate Launcher to Messaging App experience.

To post a comment you must log in.
Revision history for this message
Omer Akram (om26er) wrote :

While the code is ready, this branch depends on four other branches to be merged.

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

commit in working state, will need to adapt to use helpers from address-book-app once they are moved there.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

103 + messaging_app = helpers.get_proxy_object_by_process_name(
104 + 'messaging-app',
105 + emulator_base=messaging_emulators.MainView
106 + )

Just as with Brendan's branch, the only emulator_base that we must be using is the one from the toolkit. Definitely not a MainView. There's something wrong here.

107 + messaging_app.start_new_message()
108 + messaging_app.type_contact_phone_num('3333333')
109 + messaging_app.type_message('Hello user!')
110 + messaging_app.click_send_button()

This needs to be wrapped in a helper on the messaging app that's called something like: def send_message(recipients, text)

review: Needs Fixing
28. By Omer Akram

don;t alter launcher icons go with stock

29. By Omer Akram

python3 ready

30. By Omer Akram

revert the change to get_proxy_object_by_process_name

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

use the helper from message_app to send message instead of duplicating the code

32. By Omer Akram

use helper from the messaging_app to send message

33. By Omer Akram

flake8

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

also depend on messaging-app-autopilot

35. By Omer Akram

create a method to add contact

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I'm missing how this code implements the use case in the linked bug:
https://bugs.launchpad.net/ubuntu-autopilot-tests/+bug/1328921. It's supposed to use the quicklist, but as far as I can tell it just fills in the details and sends the message.

review: Needs Information
36. By Omer Akram

adapt to contact fixture in address-book-service instead of doing that stuff in our code

37. By Omer Akram

merge trunk

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

fix test as suggested by brendand

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

What is this 'select' option in send_message? I don't see it in messaging-app trunk. I think rather than just calling send_message you want to use the helper to compose a new message (start_new_message), then type in the MultiRecipientInput. You'll need a helper for that based on the one I'm adding here: https://code.launchpad.net/~canonical-platform-qa/messaging-app/more_helpers_test/+merge/227781. That's depending on your address-book-service helper so once that gets merged we can merge that one, then merge this one.

review: Needs Fixing

Unmerged revisions

38. By Omer Akram

fix test as suggested by brendand

37. By Omer Akram

merge trunk

36. By Omer Akram

adapt to contact fixture in address-book-service instead of doing that stuff in our code

35. By Omer Akram

create a method to add contact

34. By Omer Akram

also depend on messaging-app-autopilot

33. By Omer Akram

flake8

32. By Omer Akram

use helper from the messaging_app to send message

31. By Omer Akram

use the helper from message_app to send message instead of duplicating the code

30. By Omer Akram

revert the change to get_proxy_object_by_process_name

29. By Omer Akram

python3 ready

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-07-03 05:13:26 +0000
3+++ debian/control 2014-07-22 19:54:10 +0000
4@@ -21,6 +21,8 @@
5 ubuntu-ui-toolkit-autopilot,
6 unity8-autopilot,
7 url-dispatcher-tools,
8+ messaging-app-autopilot,
9+ address-book-service-testability,
10 Description: Ubuntu user experience Autopilot tests
11 This package provides a set of autopilot tests for testing
12 the inter-app integration under Unity8
13
14=== modified file 'ubuntu_experience_tests/helpers.py'
15--- ubuntu_experience_tests/helpers.py 2014-06-19 17:46:15 +0000
16+++ ubuntu_experience_tests/helpers.py 2014-07-22 19:54:10 +0000
17@@ -108,7 +108,7 @@
18
19 """
20 return get_proxy_object_for_existing_process(
21- _get_pid_by_name(proc_name),
22+ pid=_get_pid_by_name(proc_name),
23 emulator_base=_get_emulator_base(proc_name)
24 )
25
26
27=== added file 'ubuntu_experience_tests/tests/test_user_experiences.py'
28--- ubuntu_experience_tests/tests/test_user_experiences.py 1970-01-01 00:00:00 +0000
29+++ ubuntu_experience_tests/tests/test_user_experiences.py 2014-07-22 19:54:10 +0000
30@@ -0,0 +1,53 @@
31+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
32+#
33+# Copyright 2014 Canonical Ltd.
34+# Author: Omer Akram <omer.akram@canonical.com>
35+#
36+# This file is part of ubuntu-experience-tests.
37+#
38+# This program is free software; you can redistribute it and/or modify
39+# it under the terms of the GNU General Public License version 3, as published
40+# by the Free Software Foundation.
41+#
42+# This program is distributed in the hope that it will be useful,
43+# but WITHOUT ANY WARRANTY; without even the implied warranty of
44+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+# GNU General Public License for more details.
46+#
47+# You should have received a copy of the GNU General Public License
48+# along with this program. If not, see <http://www.gnu.org/licenses/>
49+
50+from unity8 import process_helpers
51+from unity8.shell import tests, disable_qml_mocking
52+
53+from address_book_service import fixture_setup as contact_fixture
54+from messaging_app import fixture_setup as messaging_fixture
55+from messaging_app.emulators import MainView
56+
57+from ubuntu_experience_tests import helpers
58+
59+
60+class LauncherSendSMS(tests.UnityTestCase):
61+
62+ def setUp(self):
63+ self.useFixture(messaging_fixture.MessagingTestEnvironment())
64+ self.useFixture(contact_fixture.AddressBookServiceDummyBackend())
65+ super(LauncherSendSMS, self).setUp()
66+
67+ @disable_qml_mocking
68+ def test_launch_app_and_send_sms_to_contact(self):
69+ """Launch app from launcher and send sms to a contact."""
70+ self.unity_proxy = self.launch_unity()
71+ process_helpers.unlock_unity(self.unity_proxy)
72+ self.main_window.launch_application('messaging-app')
73+
74+ messaging_app = helpers.get_proxy_object_by_process_name(
75+ 'messaging-app',
76+ )
77+ messaging_app_proxy = messaging_app.select_single(MainView)
78+ phone_num = 'UX User'
79+ message = 'Hi!'
80+ bubble = messaging_app_proxy.send_message(
81+ phone_num, message, select=True)
82+
83+ self.assertProperty(bubble, visible=True)

Subscribers

People subscribed via source and target branches