Merge lp:~brendan-donegan/messaging-app/fix_action_items into lp:messaging-app

Proposed by Brendan Donegan
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 121
Merged at revision: 134
Proposed branch: lp:~brendan-donegan/messaging-app/fix_action_items
Merge into: lp:messaging-app
Diff against target: 138 lines (+37/-10)
3 files modified
src/qml/MainPage.qml (+1/-0)
src/qml/Messages.qml (+8/-0)
tests/autopilot/messaging_app/emulators.py (+28/-10)
To merge this branch: bzr merge lp:~brendan-donegan/messaging-app/fix_action_items
Reviewer Review Type Date Requested Status
Leo Arias (community) code review Needs Fixing
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+223437@code.launchpad.net

Commit message

Add objectName's to Action items and fix some test helpers, plus add a few that are useful.

Description of the change

This gives object names to most of the Action items in the messaging app. It also fixes some helpers to use these object names, as they were broken without. Also add helpers for interacting with the Save Contact dialog.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

looks good to me.
The AP tests failures are unrelated to this change. I will approve this once the
issue causing the failures is fixed.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :
121. By Brendan Donegan

Fixed wrong objectName in emulator

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Got the name of contactCallAction wrong in the emulator. Fixed now

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 :

Are there any related MPs required for this MP to build/function as expected? Please list.

No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

Yes, on the device

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/messaging-app) on device or emulator?

N/A? Only test code is changed here

If you changed the UI, was the change specified/approved by design?

N/A, no UI changes

If you changed the packaging (debian), did you subscribe a core-dev to this MP?

N/A, no packaging changes

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
No, but the failures are not caused by this change.

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

review: Approve
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This is approved but still hasn't been merged or landed - why?

122. By Brendan Donegan

Merged from trunk

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

It is missing tests for:
click_add_to_contact_button
click_create_new_contact_button

cancel_save_button is probably not needed.
on autopilot we are trying to write tests for things that give value to the user.
cancelling a save does not fit well into that description. For that, a QML test sounds better.

review: Needs Fixing (code review)
Revision history for this message
Leo Arias (elopio) wrote :

click_add_button and click_call_button also need tests. They got outdated with the new header because they had no test to fail during the transition.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MainPage.qml'
2--- src/qml/MainPage.qml 2014-06-11 20:13:37 +0000
3+++ src/qml/MainPage.qml 2014-07-08 13:38:02 +0000
4@@ -88,6 +88,7 @@
5 id: searchButton
6 objectName: "searchButton"
7 action: Action {
8+ objectName: "searchAction"
9 iconSource: "image://theme/search"
10 onTriggered: {
11 mainPage.searching = true
12
13=== modified file 'src/qml/Messages.qml'
14--- src/qml/Messages.qml 2014-07-01 16:40:20 +0000
15+++ src/qml/Messages.qml 2014-07-08 13:38:02 +0000
16@@ -217,6 +217,7 @@
17 title: i18n.tr("Save contact")
18 text: i18n.tr("How do you want to save the contact?")
19 Button {
20+ objectName: "addToExistingContact"
21 text: i18n.tr("Add to existing contact")
22 color: UbuntuColors.orange
23 onClicked: {
24@@ -226,6 +227,7 @@
25 }
26 }
27 Button {
28+ objectName: "createNewContact"
29 text: i18n.tr("Create new contact")
30 color: UbuntuColors.orange
31 onClicked: {
32@@ -234,6 +236,7 @@
33 }
34 }
35 Button {
36+ objectName: "cancelSave"
37 text: i18n.tr("Cancel")
38 color: UbuntuColors.warmGrey
39 onClicked: {
40@@ -400,6 +403,7 @@
41 id: groupChatButton
42 objectName: "groupChatButton"
43 action: Action {
44+ objectName: "groupChatAction"
45 iconSource: "image://theme/navigation-menu"
46 onTriggered: {
47 PopupUtils.open(participantsPopover, messages.header)
48@@ -428,6 +432,7 @@
49 ToolbarButton {
50 objectName: "contactCallButton"
51 action: Action {
52+ objectName: "contactCallAction"
53 visible: participants.length == 1
54 iconSource: "image://theme/call-start"
55 text: i18n.tr("Call")
56@@ -440,6 +445,7 @@
57 ToolbarButton {
58 objectName: "addContactButton"
59 action: Action {
60+ objectName: "addContactAction"
61 visible: contactWatcher.isUnknown && participants.length == 1
62 iconSource: "image://theme/new-contact"
63 text: i18n.tr("Add")
64@@ -457,6 +463,7 @@
65 ToolbarButton {
66 objectName: "contactCallButton"
67 action: Action {
68+ objectName: "contactCallKnownAction"
69 visible: participants.length == 1
70 iconSource: "image://theme/call-start"
71 text: i18n.tr("Call")
72@@ -469,6 +476,7 @@
73 ToolbarButton {
74 objectName: "contactProfileButton"
75 action: Action {
76+ objectName: "contactProfileAction"
77 visible: !contactWatcher.isUnknown && participants.length == 1
78 iconSource: "image://theme/contact"
79 text: i18n.tr("Contact")
80
81=== modified file 'tests/autopilot/messaging_app/emulators.py'
82--- tests/autopilot/messaging_app/emulators.py 2014-06-25 07:21:10 +0000
83+++ tests/autopilot/messaging_app/emulators.py 2014-07-08 13:38:02 +0000
84@@ -291,19 +291,13 @@
85
86 def click_add_button(self):
87 """Click add button from toolbar on messages page"""
88-
89- toolbar = self.open_toolbar()
90- button = toolbar.wait_select_single("ActionItem", text=u"Add")
91- self.pointing_device.click_object(button)
92- toolbar.animating.wait_for(False)
93+ header = self.get_header()
94+ header.click_action_button("addContactAction")
95
96 def click_call_button(self):
97 """Click call button from toolbar on messages page"""
98-
99- toolbar = self.open_toolbar()
100- button = toolbar.wait_select_single("ActionItem", text=u"Call")
101- self.pointing_device.click_object(button)
102- toolbar.animating.wait_for(False)
103+ header = self.get_header()
104+ header.click_action_button("contactCallAction")
105
106 def click_back_button(self):
107 """Click back button from toolbar on messages page"""
108@@ -313,6 +307,30 @@
109 self.pointing_device.click_object(button)
110 toolbar.animating.wait_for(False)
111
112+ def click_add_to_contact_button(self):
113+ """
114+ Click the 'Add to existing contact' button
115+ in the 'Save Contact' dialog.
116+ """
117+ button = self.wait_select_single('Button',
118+ objectName="addToExistingContact")
119+ self.pointing_device.click_object(button)
120+
121+ def click_create_new_contact_button(self):
122+ """
123+ Click the 'Create new contact' button
124+ in the 'Save Contact' dialog
125+ """
126+ button = self.wait_select_single('Button',
127+ objectName="createNewContact")
128+ self.pointing_device.click_object(button)
129+
130+ def click_cancel_save_button(self):
131+ " Click the 'Cancel' button in the 'Save Contact' dialog """
132+ button = self.wait_select_single('Button',
133+ objectName="cancelSave")
134+ self.pointing_device.click_object(button)
135+
136 def click_threads_header_delete(self):
137 """Click the header action 'Delete' on Messages view"""
138 self.click_header_action('selectionModeDeleteAction')

Subscribers

People subscribed via source and target branches