Merge lp:~om26er/address-book-app/abook_navigation_favorites into lp:address-book-app

Proposed by Omer Akram
Status: Superseded
Proposed branch: lp:~om26er/address-book-app/abook_navigation_favorites
Merge into: lp:address-book-app
Diff against target: 1149 lines (+582/-248)
22 files modified
debian/control (+1/-0)
src/imports/ContactList/ContactListPage.qml (+0/-1)
src/imports/ContactView/ContactDetailFavoriteView.qml (+14/-8)
src/imports/ContactView/ContactDetailPhoneNumbersView.qml (+1/-17)
src/imports/ContactView/ContactView.qml (+10/-0)
src/imports/Ubuntu/Contacts/CMakeLists.txt (+0/-1)
src/imports/Ubuntu/Contacts/ContactListView.qml (+70/-73)
src/imports/Ubuntu/Contacts/FavoriteDelegate.qml (+0/-112)
src/imports/Ubuntu/Contacts/qmldir (+0/-1)
tests/autopilot/address_book_app/emulators/__init__.py (+12/-0)
tests/autopilot/address_book_app/emulators/contact_list_page.py (+152/-26)
tests/autopilot/address_book_app/emulators/contact_view.py (+94/-0)
tests/autopilot/address_book_app/emulators/main_window.py (+3/-3)
tests/autopilot/address_book_app/helpers.py (+55/-0)
tests/autopilot/address_book_app/tests/__init__.py (+25/-6)
tests/autopilot/address_book_app/tests/test_add_contact.py (+4/-0)
tests/autopilot/address_book_app/tests/test_contactlist.py (+4/-0)
tests/autopilot/address_book_app/tests/test_delete_contact.py (+1/-0)
tests/autopilot/address_book_app/tests/test_edit_contact.py (+4/-0)
tests/autopilot/address_book_app/tests/test_favorites.py (+130/-0)
tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py (+1/-0)
tests/autopilot/address_book_app/tests/test_single_pick_mode.py (+1/-0)
To merge this branch: bzr merge lp:~om26er/address-book-app/abook_navigation_favorites
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+211430@code.launchpad.net

This proposal has been superseded by a proposal from 2014-03-17.

To post a comment you must log in.
161. By Omer Akram

remove unused test code

162. By Omer Akram

fix pep8 and pyflakes warnings for test_favorite, did not touch other modules

163. By Omer Akram

remove syncevolution dep

164. By Omer Akram

remove unused test code, fix things

165. By Omer Akram

make dummy backend code reusable by other test cases

166. By Omer Akram

add docstrings for new tests

167. By Omer Akram

make starting of dummy backend a reusable helper for other apps to consume

168. By Omer Akram

adapt autopilot tests to UI changes in trunk

169. By Omer Akram

merge trunk

Unmerged revisions

169. By Omer Akram

merge trunk

168. By Omer Akram

adapt autopilot tests to UI changes in trunk

167. By Omer Akram

make starting of dummy backend a reusable helper for other apps to consume

166. By Omer Akram

add docstrings for new tests

165. By Omer Akram

make dummy backend code reusable by other test cases

164. By Omer Akram

remove unused test code, fix things

163. By Omer Akram

remove syncevolution dep

162. By Omer Akram

fix pep8 and pyflakes warnings for test_favorite, did not touch other modules

161. By Omer Akram

remove unused test code

160. By Omer Akram

don't use memory backend for favorite tests, use the new dummy backend from the service

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2013-12-11 15:03:32 +0000
+++ debian/control 2014-03-17 23:53:00 +0000
@@ -68,6 +68,7 @@
68 libqt5test5,68 libqt5test5,
69 libqt5widgets5,69 libqt5widgets5,
70 ubuntu-ui-toolkit-autopilot,70 ubuntu-ui-toolkit-autopilot,
71 syncevolution,
71 address-book-app (>= ${binary:Version}),72 address-book-app (>= ${binary:Version}),
72Description: Test package for address-book-app73Description: Test package for address-book-app
73 Autopilot tests for the address-book-app package74 Autopilot tests for the address-book-app package
7475
=== modified file 'src/imports/ContactList/ContactListPage.qml'
--- src/imports/ContactList/ContactListPage.qml 2014-01-30 21:13:08 +0000
+++ src/imports/ContactList/ContactListPage.qml 2014-03-17 23:53:00 +0000
@@ -72,7 +72,6 @@
72 id: contactList72 id: contactList
73 objectName: "contactListView"73 objectName: "contactListView"
7474
75 showFavoritePhoneLabel: false
76 multiSelectionEnabled: true75 multiSelectionEnabled: true
77 acceptAction.text: pickMode ? i18n.tr("Select") : i18n.tr("Delete")76 acceptAction.text: pickMode ? i18n.tr("Select") : i18n.tr("Delete")
78 multipleSelection: !pickMode ||77 multipleSelection: !pickMode ||
7978
=== modified file 'src/imports/ContactView/ContactDetailFavoriteView.qml'
--- src/imports/ContactView/ContactDetailFavoriteView.qml 2013-07-04 20:57:19 +0000
+++ src/imports/ContactView/ContactDetailFavoriteView.qml 2014-03-17 23:53:00 +0000
@@ -24,15 +24,21 @@
24 id: root24 id: root
2525
26 detail: root.contact ? root.contact.favorite : null26 detail: root.contact ? root.contact.favorite : null
27 Image {27 showDivider: false
28
29 Icon {
30 id: icon
31 objectName: 'favoriteIcon'
32
28 anchors.fill: parent33 anchors.fill: parent
29 source: root.detail && root.detail.favorite ? "artwork:/favorite-selected.png" : "artwork:/favorite-unselected.png"34 name: root.detail && root.detail.favorite ? "favorite-selected" : "favorite-unselected"
35 color: UbuntuColors.orange
30 MouseArea {36 MouseArea {
31 anchors.fill: parent37 anchors.fill: parent
32 onClicked: {38 onClicked: {
33 root.detail.favorite = !root.detail.favorite39 root.detail.favorite = !root.detail.favorite
34 //TODO: save favorite if not in edit mode40 root.contact.save()
35 }41 }
36 }42 }
37 }43 }
38}44}
3945
=== modified file 'src/imports/ContactView/ContactDetailPhoneNumbersView.qml'
--- src/imports/ContactView/ContactDetailPhoneNumbersView.qml 2014-01-14 20:43:59 +0000
+++ src/imports/ContactView/ContactDetailPhoneNumbersView.qml 2014-03-17 23:53:00 +0000
@@ -36,28 +36,12 @@
3636
37 detailDelegate: ContactDetailPhoneNumberView {37 detailDelegate: ContactDetailPhoneNumberView {
38 property variant detailType: detail && root.contact && root.typeModel.ready ? root.getType(detail) : null38 property variant detailType: detail && root.contact && root.typeModel.ready ? root.getType(detail) : null
39 property bool isPreferred: root.contact && root.contact.preferredDetails && detail && root.contact.isPreferredDetail("TEL", detail)39
40
41 action: Action {
42 objectName: "favoriteAction"
43
44 text: i18n.tr("Favorite")
45 iconSource: (contact.favorite.favorite && isPreferred) ? "artwork:/favorite-selected.svg" : "artwork:/favorite-unselected.svg"
46 }
47 contact: root.contact40 contact: root.contact
48 fields: root.fields41 fields: root.fields
49 typeLabel: detailType ? detailType.label : ""42 typeLabel: detailType ? detailType.label : ""
5043
51 height: implicitHeight44 height: implicitHeight
52 width: root.width45 width: root.width
53 onClicked: {
54 if (isPreferred && contact.favorite.favorite) {
55 contact.favorite.favorite = false
56 } else {
57 root.contact.setPreferredDetail("TEL", detail)
58 contact.favorite.favorite = true
59 }
60 contact.save()
61 }
62 }46 }
63}47}
6448
=== modified file 'src/imports/ContactView/ContactView.qml'
--- src/imports/ContactView/ContactView.qml 2013-11-14 17:48:48 +0000
+++ src/imports/ContactView/ContactView.qml 2014-03-17 23:53:00 +0000
@@ -81,6 +81,16 @@
81 right: parent.right81 right: parent.right
82 }82 }
83 height: implicitHeight83 height: implicitHeight
84 ContactDetailFavoriteView {
85 contact: root.contact
86 anchors {
87 left: parent.left
88 bottom: parent.bottom
89 margins: units.gu(2)
90 }
91 width: units.gu(4)
92 height: units.gu(4)
93 }
84 }94 }
8595
86 ContactDetailPhoneNumbersView {96 ContactDetailPhoneNumbersView {
8797
=== modified file 'src/imports/Ubuntu/Contacts/CMakeLists.txt'
--- src/imports/Ubuntu/Contacts/CMakeLists.txt 2013-12-16 15:04:12 +0000
+++ src/imports/Ubuntu/Contacts/CMakeLists.txt 2014-03-17 23:53:00 +0000
@@ -11,7 +11,6 @@
11 ContactSearchListView.qml11 ContactSearchListView.qml
12 ContactSimpleListView.qml12 ContactSimpleListView.qml
13 DialogButtons.qml13 DialogButtons.qml
14 FavoriteDelegate.qml
15 MultipleSelectionListView.qml14 MultipleSelectionListView.qml
16 MultipleSelectionVisualModel.qml15 MultipleSelectionVisualModel.qml
17 qmldir16 qmldir
1817
=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
--- src/imports/Ubuntu/Contacts/ContactListView.qml 2013-11-14 13:25:28 +0000
+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2014-03-17 23:53:00 +0000
@@ -41,78 +41,75 @@
41ContactSimpleListView {41ContactSimpleListView {
42 id: root42 id: root
4343
44 /*!44 property bool showFavourites: false
45 \qmlproperty bool showFavoritePhoneLabel45
4646 header: Rectangle {
47 This property holds if the phone label should appear on favorite contact or not47 id: itemHeader
48 By default this is set to true.48
49 */49 height: units.gu(4)
50 property bool showFavoritePhoneLabel: true50 anchors {
5151 left: parent.left
52 header: Column {52 right: parent.right
53 objectName: "listHeader"53 }
5454 color: UbuntuColors.coolGrey
55 width: parent.width55
56 height: favouritesList.count > 0 ? childrenRect.height : 056 Row {
5757 anchors.fill: parent
58 ContactSimpleListView {58 Label {
59 id: favouritesList59 id: lblAll
60 objectName: "favouritesList"60
6161 anchors {
62 manager: root.manager62 top: parent.top
63 header: ListItem.Header {63 bottom: parent.bottom
64 height: units.gu(5)64 }
65 width: parent.width / 2
66 text: i18n.tr("All")
67 horizontalAlignment: Text.AlignHCenter
68 verticalAlignment: Text.AlignVCenter
69 color: root.showFavourites ? UbuntuColors.warmGrey : UbuntuColors.orange
70 MouseArea {
71 anchors.fill: parent
72 onClicked: root.showFavourites = false
73 }
74 }
75
76 Rectangle {
77 anchors {
78 top: parent.top
79 bottom: parent.bottom
80 margins: units.gu(1)
81 }
82 width: 1
83 }
84
85 Label {
86 id: lblFavourites
87
88 anchors {
89 top: parent.top
90 bottom: parent.bottom
91 }
92 width: parent.width / 2
65 text: i18n.tr("Favourites")93 text: i18n.tr("Favourites")
66 }94 horizontalAlignment: Text.AlignHCenter
6795 verticalAlignment: Text.AlignVCenter
68 anchors {96 color: root.showFavourites ? UbuntuColors.orange : UbuntuColors.warmGrey
69 left: parent.left97 MouseArea {
70 right: parent.right98 anchors.fill: parent
71 }99 onClicked: root.showFavourites = true
72100 }
73 height: (count > 0 && !root.isInSelectionMode) ? contentHeight : 0101 }
74 onContactClicked: root.contactClicked(contact)102 }
75 defaultAvatarImageUrl: root.defaultAvatarImageUrl103 }
76 multiSelectionEnabled: false104
77 interactive: false105 DetailFilter {
78 showSections: false106 id: favouritesFilter
79107
80 fetchHint: FetchHint {108 detail: ContactDetail.Favorite
81 optimizationHints: FetchHint.AllRequired109 field: Favorite.Favorite
82 detailTypesHint: [ ContactDetail.Avatar,110 value: true
83 ContactDetail.Favorite,111 matchFlags: DetailFilter.MatchExactly
84 ContactDetail.Name,112 }
85 ContactDetail.PhoneNumber ]113
86 }114 filter: showFavourites ? favouritesFilter : null
87
88 filter: DetailFilter {
89 detail: ContactDetail.Favorite
90 field: Favorite.Favorite
91 value: true
92 matchFlags: DetailFilter.MatchExactly
93 }
94
95 listDelegate: FavoriteDelegate {
96 showPhoneLabel: root.showFavoritePhoneLabel
97 defaultAvatarUrl: favouritesList.defaultAvatarImageUrl
98 onContactClicked: _fetchContact(index, contact)
99 }
100
101 Behavior on height {
102 UbuntuNumberAnimation {}
103 }
104
105 // WORKAROUND: Due a bug on the SDK Page component the page is nto correct positioned if it changes
106 // the size dynamically
107 onHeightChanged: {
108 root.contentY = -contentHeight * 2
109 root.returnToBounds()
110 }
111 }
112 ListItem.Header {
113 height: favouritesList.count > 0 ? units.gu(5) : 0
114 visible: height > 0
115 text: i18n.tr("All contacts")
116 }
117 }
118}115}
119116
=== removed file 'src/imports/Ubuntu/Contacts/FavoriteDelegate.qml'
--- src/imports/Ubuntu/Contacts/FavoriteDelegate.qml 2013-10-11 00:12:19 +0000
+++ src/imports/Ubuntu/Contacts/FavoriteDelegate.qml 1970-01-01 00:00:00 +0000
@@ -1,112 +0,0 @@
1/*
2 * Copyright (C) 2012-2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import Ubuntu.Components.ListItems 0.1 as ListItem
20import QtContacts 5.0
21import "Contacts.js" as ContactsJS
22
23ListItem.Empty {
24 id: favoriteItem
25
26 property int index: -1
27 property bool showAvatar: true
28 property string defaultAvatarUrl: ""
29 property int titleDetail: ContactDetail.Name
30 property variant titleFields: [ Name.FirstName, Name.LastName ]
31 property bool showPhoneLabel: true
32
33 signal contactClicked(var index, var contact)
34
35 implicitHeight: units.gu(8)
36 width: parent ? parent.width : 0
37
38 Rectangle {
39 anchors {
40 fill: parent
41 bottomMargin: units.dp(1)
42 }
43 color: UbuntuColors.warmGrey
44 opacity: 0.07
45 }
46
47 UbuntuShape {
48 id: avatar
49
50 anchors {
51 left: parent.left
52 leftMargin: units.gu(2)
53 top: parent.top
54 topMargin: units.gu(1)
55 bottom: parent.bottom
56 bottomMargin: units.gu(1)
57 }
58 width: favoriteItem.showAvatar ? height : 0
59 visible: favoriteItem.showAvatar
60 radius: "medium"
61 image: Image {
62 property bool isDefaultAvatar: (source == favoriteItem.defaultAvatarUrl)
63
64 fillMode: Image.PreserveAspectCrop
65 asynchronous: true
66 source: ContactsJS.getAvatar(contact, favoriteItem.defaultAvatarUrl)
67 sourceSize.width: isDefaultAvatar ? undefined : width * 1.5
68 sourceSize.height: isDefaultAvatar ? undefined : height * 1.5
69 }
70 }
71
72 Column {
73 anchors {
74 top: parent.top
75 topMargin: units.gu(2)
76 left: avatar.right
77 leftMargin: units.gu(2)
78 right: parent.right
79 bottom: parent.bottom
80 }
81
82 Label {
83 id: name
84
85 anchors {
86 left: parent.left
87 right: parent.right
88 }
89
90 height: favoriteItem.showPhoneLabel ? paintedHeight : paintedHeight * 2
91 verticalAlignment: Text.AlignVCenter
92 text: ContactsJS.formatToDisplay(contact, favoriteItem.titleDetail, favoriteItem.titleFields)
93 fontSize: "medium"
94 }
95
96 Label {
97 id: label
98
99 anchors {
100 left: parent.left
101 right: parent.right
102 }
103
104 opacity: 0.2
105 height: favoriteItem.showPhoneLabel ? paintedHeight : 0
106 text: favoriteItem.showPhoneLabel && contact.phoneNumbers ? ContactsJS.getFavoritePhoneLabel(contact, "") : ""
107 fontSize: "medium"
108 }
109 }
110
111 onClicked: favoriteItem.contactClicked(index, contact)
112}
1130
=== modified file 'src/imports/Ubuntu/Contacts/qmldir'
--- src/imports/Ubuntu/Contacts/qmldir 2013-10-21 19:25:51 +0000
+++ src/imports/Ubuntu/Contacts/qmldir 2014-03-17 23:53:00 +0000
@@ -10,7 +10,6 @@
1010
11internal ContactDetailPickerDelegate ContactDetailPickerDelegate.qml11internal ContactDetailPickerDelegate ContactDetailPickerDelegate.qml
12internal ContactDetailPickerPhoneNumberDelegate ContactDetailPickerPhoneNumberDelegate.qml12internal ContactDetailPickerPhoneNumberDelegate ContactDetailPickerPhoneNumberDelegate.qml
13internal ContactFavoriteListDelegate ContactFavoriteDelegate.qml
14internal DialogButtons DialogButtons.qml13internal DialogButtons DialogButtons.qml
15internal OrganicView OrganicView.qml14internal OrganicView OrganicView.qml
16internal ContactList ContactList.js15internal ContactList ContactList.js
1716
=== modified file 'tests/autopilot/address_book_app/emulators/__init__.py'
--- tests/autopilot/address_book_app/emulators/__init__.py 2013-07-09 18:42:30 +0000
+++ tests/autopilot/address_book_app/emulators/__init__.py 2014-03-17 23:53:00 +0000
@@ -4,3 +4,15 @@
4# This program is free software: you can redistribute it and/or modify it4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.6# by the Free Software Foundation.
7
8
9def get_nearest_parent_matching_type(child, desired_type):
10 """Climb down the widget tree, return first instance of desired_type"""
11 while type(child).__name__ != desired_type:
12 parent = child.get_parent()
13 if type(child).__name__ == 'AddressBookApp':
14 # we reached the root and found nothing
15 return None
16 else:
17 child = parent
18 return child
719
=== modified file 'tests/autopilot/address_book_app/emulators/contact_list_page.py'
--- tests/autopilot/address_book_app/emulators/contact_list_page.py 2014-02-13 16:44:12 +0000
+++ tests/autopilot/address_book_app/emulators/contact_list_page.py 2014-03-17 23:53:00 +0000
@@ -1,20 +1,24 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
3""" ContactListPage emulator for Addressbook App tests """
4
5# Copyright 2014 Canonical2# Copyright 2014 Canonical
6#3#
7# This program is free software: you can redistribute it and/or modify it4# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published5# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.6# by the Free Software Foundation.
107
8""" ContactListPage emulator for Addressbook App tests """
9
11import logging10import logging
11from time import sleep
1212
13from autopilot import logging as autopilot_logging
13from autopilot.introspection.dbus import StateNotFoundError14from autopilot.introspection.dbus import StateNotFoundError
15from autopilot.matchers import Eventually
16from testtools.matchers import GreaterThan
14from ubuntuuitoolkit import emulators as uitk17from ubuntuuitoolkit import emulators as uitk
1518
16LOGGER = logging.getLogger(__name__)19from address_book_app.emulators import get_nearest_parent_matching_type
17from time import sleep20
21logger = logging.getLogger(__name__)
1822
1923
20class ContactListPage(uitk.UbuntuUIToolkitEmulatorBase):24class ContactListPage(uitk.UbuntuUIToolkitEmulatorBase):
@@ -27,9 +31,12 @@
27 super(ContactListPage, self).__init__(*args)31 super(ContactListPage, self).__init__(*args)
2832
29 def get_contacts(self):33 def get_contacts(self):
30 """34 """Returns a list of ContactDelegate objects.
31 Returns a list of ContactDelegate objects and populate35
32 self.selection_marks36 Also populate self.selection_marks.
37
38 :return: The list of ContactDelegate objects.
39
33 """40 """
34 sleep(1)41 sleep(1)
35 self.contacts = self.select_many("ContactDelegate")42 self.contacts = self.select_many("ContactDelegate")
@@ -41,10 +48,12 @@
41 self.selection_marks.append(mark)48 self.selection_marks.append(mark)
42 return self.contacts49 return self.contacts
4350
51 @autopilot_logging.log_action(logger.info)
44 def select_contacts_by_index(self, indices):52 def select_contacts_by_index(self, indices):
45 """ Select contacts corresponding to the list of index in indices53 """Select contacts corresponding to the list of index in indices.
4654
47 :param indices: List of integers55 :param indices: List of integer indices of contacts to select.
56
48 """57 """
49 self.deselect_all()58 self.deselect_all()
5059
@@ -53,8 +62,9 @@
53 self.selected_marks.append(self.selection_marks[idx])62 self.selected_marks.append(self.selection_marks[idx])
54 self.pointing_device.click_object(self.selection_marks[idx])63 self.pointing_device.click_object(self.selection_marks[idx])
5564
65 @autopilot_logging.log_action(logger.info)
56 def deselect_all(self):66 def deselect_all(self):
57 """Deselect every contacts"""67 """Deselect every contact."""
58 contacts = self.select_many("ContactDelegate")68 contacts = self.select_many("ContactDelegate")
59 self.selected_marks = []69 self.selected_marks = []
60 for contact in contacts:70 for contact in contacts:
@@ -63,28 +73,144 @@
63 objectName="selectionMark")73 objectName="selectionMark")
64 self.pointing_device.click_object(mark)74 self.pointing_device.click_object(mark)
6575
76 @autopilot_logging.log_action(logger.info)
66 def click_button(self, objectname):77 def click_button(self, objectname):
67 """Press a button that matches objectname78 """Press a button that matches objectname
6879
69 :param objectname: Name of the object80 :param objectname: The name of the object.
81 :raise StateNotFoundError: When a matching button is not found.
82
70 """83 """
71 try:84 button = self.select_single("Button",
72 buttons = self.select_many("Button",85 objectName=objectname,
73 objectName=objectname)86 visible=True)
74 for button in buttons:87 self.pointing_device.click_object(button)
75 if button.visible:
76 self.pointing_device.click_object(button)
77 except StateNotFoundError:
78 LOGGER.error(
79 'Button with objectName "{0}" not found.'.format(objectname)
80 )
81 raise
8288
89 @autopilot_logging.log_action(logger.info)
83 def cancel(self):90 def cancel(self):
84 """Press the cancel button displayed when pick mode is enabled"""91 """Press the cancel button displayed when pick mode is enabled."""
85 self.click_button("DialogButtons.rejectButton")92 self.click_button("DialogButtons.rejectButton")
8693
94 @autopilot_logging.log_action(logger.info)
87 def delete(self):95 def delete(self):
88 """Press the delete button displayed when pick mode is enabled"""96 """Press the delete button displayed when pick mode is enabled."""
89 self.click_button("DialogButtons.acceptButton")97 self.click_button("DialogButtons.acceptButton")
90 self.get_contacts()98 self.get_contacts()
99
100 def get_contact_by_name(self,
101 contact_name,
102 parent_delegate_type='ContactDelegate'):
103 """Find a label with text matching contact name.
104
105 :param contact_name: The name of the contact, e.g. 'Fulano de Tal'.
106 :param parent_delegate_type: 'ContactDelegate' or 'FavoriteDelegate'.
107 :return: The label for a matching contact.
108 :raises StateNotFoundError: If the contact_name is not found.
109
110 """
111 try:
112 assert(lambda: len(self.select_many("Label",
113 text=contact_name)),
114 Eventually(GreaterThan(0)))
115 contact_name_labels = self.select_many(
116 "Label",
117 text=contact_name)
118 for contact_name_label in contact_name_labels:
119 # we could have a contact or a favorite
120 if get_nearest_parent_matching_type(
121 contact_name_label,
122 parent_delegate_type):
123 return contact_name_label
124 raise StateNotFoundError('Label')
125 except StateNotFoundError:
126 logger.error("Contact {} not found.".format(contact_name))
127 raise
128
129 def get_favorite_by_name(self, contact_name):
130 """Find a label with text matching contact name under Favorites.
131
132 :param contact_name: Name of the contact, e.g. 'Fulano de Tal'.
133 :return: The label for the metching favorite.
134 :raises StateNotFoundError: If the contact_name is not found.
135
136 """
137 return self.get_contact_by_name(
138 contact_name,
139 parent_delegate_type='FavoriteDelegate')
140
141 @autopilot_logging.log_action(logger.info)
142 def click_contact_by_name(self,
143 contact_name,
144 parent_delegate_type='ContactDelegate'):
145 """Click a contact with label matching the given contact name.
146
147 :param contact_name: Name of a contact, e.g. 'Fulano de Tal'.
148 :param parent_delegate_type: 'ContactDelegate' or 'FavoriteDelegate'.
149 :raises StateNotFoundError: If the contact_name is not found.
150
151 """
152 contact_name_label = self.get_contact_by_name(
153 contact_name, parent_delegate_type)
154 self.pointing_device.click_object(contact_name_label)
155
156 @autopilot_logging.log_action(logger.info)
157 def open_contact_view_by_contact_name(self, contact_name):
158 """Open the contact view page for a contact with the given name.
159
160 :param contact_name: The name of the contact, e.g. 'Abe Lincoln'.
161 :return: The ContactView for the contact.
162 :raises StateNotFoundError: If the name is not found.
163
164 """
165 self.click_contact_by_name(contact_name)
166
167 @autopilot_logging.log_action(logger.info)
168 def click_favorite_by_name(self,
169 contact_name):
170 """Click a favorite with label matching the given contact name.
171
172 :param contact_name: Name of a contact, e.g. 'Fulano de Tal'
173 :raises StateNotFoundError: If the contact_name is not found.
174
175 """
176 contact_name_label = self.get_favorite_by_name(
177 contact_name)
178 self.pointing_device.click_object(contact_name_label)
179
180 @autopilot_logging.log_action(logger.info)
181 def open_contact_view_by_favorite_name(self, favorite_name):
182 """Open the contact view page for a favorite with the given name.
183
184 :param favorite_name: The name of the favorite, e.g. 'Abe Lincoln'.
185 :return: The ContactView for the contact.
186 :raises StateNotFoundError: If the name is not found.
187
188 """
189 self.click_favorite_by_name(favorite_name)
190
191 @autopilot_logging.log_action(logger.info)
192 def click_phone_number(self, phone_number):
193 """Click a label matching the given phone number.
194
195 :param phone_number: A phone number, e.g. '3321 1232'.
196 :raises StateNotFoundError: If the phone_number is not found.
197
198 """
199 phone_number_label = self.wait_select_single('Label',
200 text=phone_number)
201 self.pointing_device.click_object(phone_number_label)
202
203 def contact_is_favorite(self, name):
204 """Is the given contact name a favorite?
205
206 :param contact_name: The name of a contact e.g. John.
207 :raises StateNotFoundError: If the contact name is not found.
208 :returns: Boolean.
209
210 """
211 try:
212 self.get_favorite_by_name(name)
213 return True
214 except StateNotFoundError:
215 logger.error("Favorite contact {} not found.".format(name))
216 return False
91217
=== added file 'tests/autopilot/address_book_app/emulators/contact_view.py'
--- tests/autopilot/address_book_app/emulators/contact_view.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/address_book_app/emulators/contact_view.py 2014-03-17 23:53:00 +0000
@@ -0,0 +1,94 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical
3#
4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.
7
8""" ContactView emulator for Addressbook App tests """
9
10import logging
11
12from autopilot import logging as autopilot_logging
13from autopilot.introspection.dbus import StateNotFoundError
14from ubuntuuitoolkit import emulators as uitk
15
16from address_book_app.emulators import get_nearest_parent_matching_type
17
18logger = logging.getLogger(__name__)
19
20
21class ContactView(uitk.UbuntuUIToolkitEmulatorBase):
22 """ContactView emulator class"""
23
24 def __init__(self, *args):
25 super(ContactView, self).__init__(*args)
26
27 @autopilot_logging.log_action(logger.info)
28 def click_button(self, objectname):
29 """Press a button that matches objectname.
30
31 :param objectname: The name of the object.
32 :raises StateNotFoundError: If the matching object is not found.
33
34 """
35 buttons = self.select_single("Button",
36 objectName=objectname,
37 visible=True)
38 self.pointing_device.click_object(button)
39
40 @autopilot_logging.log_action(logger.info)
41 def cancel(self):
42 """Press the cancel button displayed when pick mode is enabled."""
43 self.click_button("DialogButtons.rejectButton")
44
45 @autopilot_logging.log_action(logger.info)
46 def delete(self):
47 """Press the delete button displayed when pick mode is enabled."""
48 self.click_button("DialogButtons.acceptButton")
49 self.get_contacts()
50
51 def get_contact_detail_phone_number_view(self, phone_number):
52 """Returns the View associated with the given phone number.
53
54 :param phone_number: The number listed for contact, e.g. '8675309'.
55 :return: The matching view.
56 :raises StateNotFoundError: If the phone_number is not found.
57
58 """
59 phone_number_label = self.select_single('Label',
60 text=phone_number)
61 return get_nearest_parent_matching_type(
62 phone_number_label,
63 'ContactDetailPhoneNumberView')
64
65 def _star_is_illuminated_for_phone_number(self, phone_number):
66 """Is the star associated with the given phone number illuminated?
67
68 :param phone_number: The number listed for contact, e.g. '8675309'.
69 :return: A Boolean.
70 :raises StateNotFoundError: If the phone_number is not found.
71
72 """
73 contact_detail = self.get_contact_detail_phone_number_view(
74 phone_number)
75 return contact_detail.iconSource == 'artwork:/favorite-selected.svg'
76
77 @autopilot_logging.log_action(logger.info)
78 def click_phone_number(self, phone_number):
79 """Tap/click the label with text matching the given phone number.
80
81 :param phone_number: The number listed for contact, e.g. '8675309'.
82 :raises StateNotFoundError: If the phone_number is not found.
83
84 """
85 phone_number_label = self.wait_select_single('Label',
86 text=phone_number)
87 self.pointing_device.click_object(phone_number_label)
88
89 @autopilot_logging.log_action(logger.info)
90 def click_favorite_icon(self):
91 """Tap/click on the favorite icon to make a contact favorite."""
92 favorite_icon = self.select_single('Icon', objectName='favoriteIcon')
93
94 self.pointing_device.click_object(favorite_icon)
095
=== modified file 'tests/autopilot/address_book_app/emulators/main_window.py'
--- tests/autopilot/address_book_app/emulators/main_window.py 2014-02-13 16:44:12 +0000
+++ tests/autopilot/address_book_app/emulators/main_window.py 2014-03-17 23:53:00 +0000
@@ -13,7 +13,7 @@
1313
14 def get_contact_list_page(self):14 def get_contact_list_page(self):
15 return self. wait_select_single("ContactListPage",15 return self. wait_select_single("ContactListPage",
16 objectName="contactListPage")16 objectName="contactListPage")
1717
18 def get_contact_edit_page(self):18 def get_contact_edit_page(self):
19 return self.wait_select_single("ContactEditor",19 return self.wait_select_single("ContactEditor",
@@ -35,7 +35,7 @@
35 """35 """
36 Returns a ContactListView iobject for the current window36 Returns a ContactListView iobject for the current window
37 """37 """
38 return self.wait_select_single( "ContactListView",38 return self.wait_select_single("ContactListView",
39 objectName="contactListView")39 objectName="contactListView")
4040
41 def get_button(self, name):41 def get_button(self, name):
@@ -45,7 +45,7 @@
45 Arguments:45 Arguments:
46 name: Name of the button46 name: Name of the button
47 """47 """
48 return self.wait_select_single( "Button", objectName=name)48 return self.wait_select_single("Button", objectName=name)
4949
50 def cancel(self):50 def cancel(self):
51 """51 """
5252
=== added file 'tests/autopilot/address_book_app/helpers.py'
--- tests/autopilot/address_book_app/helpers.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/address_book_app/helpers.py 2014-03-17 23:53:00 +0000
@@ -0,0 +1,55 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical
3#
4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.
7
8"""Utilities for the evolution contacts db."""
9
10import os
11import subprocess
12import tempfile
13
14
15def backup_evolution_contacts_db(backup_filepath=None):
16 """Back up the existing evolution contacts db to a file.
17
18 :param backup_filepath: file to which to write, if None make tmpfile.
19 :returns: backup filepath used.
20 """
21 if backup_filepath is None:
22 backup_filepath = tempfile.mktemp(suffix=".syncevolution")
23 subprocess.call([
24 'syncevolution',
25 '--export',
26 backup_filepath,
27 'backend=evolution-contacts',
28 ])
29 return backup_filepath
30
31
32def restore_evolution_contacts_db(backup_filepath):
33 """Restore the evolution contacts db from the backup.
34
35 :param backup_filepath: file from which to restore.
36 """
37 # NOTE restoring from empty file creates a phantom contact
38 if os.path.getsize(backup_filepath) > 0:
39 subprocess.call([
40 'syncevolution',
41 '--import',
42 backup_filepath,
43 'backend=evolution-contacts'
44 ])
45
46
47def wipe_evolution_contacts_db():
48 """Wipe the existing evolution contacts db clean of contacts."""
49 subprocess.call([
50 'syncevolution',
51 '--delete-items',
52 'backend=evolution-contacts',
53 '--luids',
54 '*',
55 ])
056
=== modified file 'tests/autopilot/address_book_app/tests/__init__.py'
--- tests/autopilot/address_book_app/tests/__init__.py 2014-01-30 08:35:04 +0000
+++ tests/autopilot/address_book_app/tests/__init__.py 2014-03-17 23:53:00 +0000
@@ -18,6 +18,9 @@
18from testtools.matchers import Equals18from testtools.matchers import Equals
1919
20from address_book_app.emulators.main_window import MainWindow20from address_book_app.emulators.main_window import MainWindow
21from address_book_app.helpers import (backup_evolution_contacts_db,
22 restore_evolution_contacts_db,
23 wipe_evolution_contacts_db)
21from ubuntuuitoolkit import emulators as toolkit_emulators24from ubuntuuitoolkit import emulators as toolkit_emulators
2225
2326
@@ -31,6 +34,7 @@
31 VCARD_PATH_DEV = os.path.abspath("../data/vcard.vcf")34 VCARD_PATH_DEV = os.path.abspath("../data/vcard.vcf")
32 ARGS = []35 ARGS = []
33 PRELOAD_VCARD = False36 PRELOAD_VCARD = False
37 QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
3438
35 def setUp(self):39 def setUp(self):
36 self.pointing_device = toolkit_emulators.get_pointing_device()40 self.pointing_device = toolkit_emulators.get_pointing_device()
@@ -40,13 +44,25 @@
40 if model() != "Desktop":44 if model() != "Desktop":
41 subprocess.check_call(["/sbin/initctl", "stop", "maliit-server"])45 subprocess.check_call(["/sbin/initctl", "stop", "maliit-server"])
4246
47 self.backup_filepath = backup_evolution_contacts_db()
48 wipe_evolution_contacts_db()
49
43 if 'AUTOPILOT_APP' in os.environ:50 if 'AUTOPILOT_APP' in os.environ:
44 self.app_bin = os.environ['AUTOPILOT_APP']51 self.app_bin = os.environ['AUTOPILOT_APP']
45 else:52 else:
46 self.app_bin = AddressBookAppTestCase.DEFAULT_DEV_LOCATION53 self.app_bin = AddressBookAppTestCase.DEFAULT_DEV_LOCATION
4754
48 os.environ['QTCONTACTS_MANAGER_OVERRIDE'] = 'memory'55 print "Running from: %s" % (self.app_bin)
56 # NOTE defeats favoriting: contacts don't show up in "Favorites" header
57 if AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY:
58 os.environ['QTCONTACTS_MANAGER_OVERRIDE'] = 'memory'
59 else:
60 try:
61 del(os.environ['QTCONTACTS_MANAGER_OVERRIDE'])
62 except KeyError:
63 pass
49 vcard_data = ""64 vcard_data = ""
65
50 if AddressBookAppTestCase.PRELOAD_VCARD:66 if AddressBookAppTestCase.PRELOAD_VCARD:
51 # Use vcard from source tree and fallback on installed vcard (from67 # Use vcard from source tree and fallback on installed vcard (from
52 # address-book-app-autopilot package)68 # address-book-app-autopilot package)
@@ -55,16 +71,16 @@
55 else:71 else:
56 vcard_data = AddressBookAppTestCase.VCARD_PATH_BIN72 vcard_data = AddressBookAppTestCase.VCARD_PATH_BIN
5773
58 os.environ["ADDRESS_BOOK_TEST_DATA"] = vcard_data74 os.environ['ADDRESS_BOOK_TEST_DATA'] = vcard_data
59 if vcard_data != "": print "Using vcard %s" % vcard_data75 if vcard_data != '': print 'Using vcard %s' % vcard_data
60 if os.path.exists(self.app_bin):76 if os.path.exists(self.app_bin):
61 print "Running from: %s" % (self.app_bin)77 print 'Running from: %s' % (self.app_bin)
62 self.launch_test_local()78 self.launch_test_local()
63 elif os.path.exists(self.DEB_LOCALTION):79 elif os.path.exists(self.DEB_LOCALTION):
64 print "Running from: %s" % (self.DEB_LOCALTION)80 print 'Running from: %s' % (self.DEB_LOCALTION)
65 self.launch_test_installed()81 self.launch_test_installed()
66 else:82 else:
67 print "Running from click package: address-book-app"83 print 'Running from click package: address-book-app'
68 self.launch_click_installed()84 self.launch_click_installed()
6985
70 AddressBookAppTestCase.ARGS = []86 AddressBookAppTestCase.ARGS = []
@@ -73,6 +89,9 @@
7389
74 def tearDown(self):90 def tearDown(self):
75 super(AddressBookAppTestCase, self).tearDown()91 super(AddressBookAppTestCase, self).tearDown()
92 wipe_evolution_contacts_db()
93 restore_evolution_contacts_db(self.backup_filepath)
94 os.remove(self.backup_filepath)
7695
77 # start the vkb96 # start the vkb
78 if model() != "Desktop":97 if model() != "Desktop":
7998
=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
--- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-01-28 10:20:07 +0000
+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-03-17 23:53:00 +0000
@@ -18,6 +18,10 @@
18class TestAddContact(AddressBookAppTestCase):18class TestAddContact(AddressBookAppTestCase):
19 """ Tests the Add contact """19 """ Tests the Add contact """
2020
21 def setUp(self):
22 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
23 super(TestAddContact, self).setUp()
24
21 def test_add_and_cancel_contact(self):25 def test_add_and_cancel_contact(self):
22 list_page = self.main_window.get_contact_list_page()26 list_page = self.main_window.get_contact_list_page()
2327
2428
=== modified file 'tests/autopilot/address_book_app/tests/test_contactlist.py'
--- tests/autopilot/address_book_app/tests/test_contactlist.py 2013-11-21 18:53:19 +0000
+++ tests/autopilot/address_book_app/tests/test_contactlist.py 2014-03-17 23:53:00 +0000
@@ -18,6 +18,10 @@
18class TestContactList(AddressBookAppTestCase):18class TestContactList(AddressBookAppTestCase):
19 """Tests the contact list features"""19 """Tests the contact list features"""
2020
21 def setUp(self):
22 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
23 super(TestContactList, self).setUp()
24
21 def test_contact_list(self):25 def test_contact_list(self):
22 contact_list = self.main_window.get_contact_list_page()26 contact_list = self.main_window.get_contact_list_page()
23 self.assertThat(contact_list.visible, Eventually(Equals(True)))27 self.assertThat(contact_list.visible, Eventually(Equals(True)))
2428
=== modified file 'tests/autopilot/address_book_app/tests/test_delete_contact.py'
--- tests/autopilot/address_book_app/tests/test_delete_contact.py 2014-02-13 16:44:12 +0000
+++ tests/autopilot/address_book_app/tests/test_delete_contact.py 2014-03-17 23:53:00 +0000
@@ -40,6 +40,7 @@
40 ]40 ]
4141
42 def setUp(self):42 def setUp(self):
43 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
43 AddressBookAppTestCase.PRELOAD_VCARD = True44 AddressBookAppTestCase.PRELOAD_VCARD = True
44 super(TestDeleteSelectContact, self).setUp()45 super(TestDeleteSelectContact, self).setUp()
4546
4647
=== modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py'
--- tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-01-28 10:20:07 +0000
+++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-03-17 23:53:00 +0000
@@ -17,6 +17,10 @@
17class TestEditContact(AddressBookAppTestCase):17class TestEditContact(AddressBookAppTestCase):
18 """Tests edit a contact"""18 """Tests edit a contact"""
1919
20 def setUp(self):
21 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
22 super(TestEditContact, self).setUp()
23
20 def test_add_new_phone(self):24 def test_add_new_phone(self):
21 self.add_contact("Fulano", "de Tal", ["3321 2300"])25 self.add_contact("Fulano", "de Tal", ["3321 2300"])
22 edit_page = self.edit_contact(0)26 edit_page = self.edit_contact(0)
2327
=== added file 'tests/autopilot/address_book_app/tests/test_favorites.py'
--- tests/autopilot/address_book_app/tests/test_favorites.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/address_book_app/tests/test_favorites.py 2014-03-17 23:53:00 +0000
@@ -0,0 +1,130 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical
3#
4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.
7
8"""Tests of favoriting contacts for the Addressbook App"""
9
10from __future__ import absolute_import
11
12import subprocess
13
14from autopilot.introspection.dbus import StateNotFoundError
15from autopilot.matchers import Eventually
16from testtools.matchers import Equals
17
18from address_book_app.tests import AddressBookAppTestCase
19
20import dbus
21
22DUMMY_BACKEND_ADDRESS = 'com.canonical.test.pim'
23
24
25class TestFavorite(AddressBookAppTestCase):
26 """Test for favoriting contacts"""
27
28 def setUp(self):
29 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = False
30 AddressBookAppTestCase.PRELOAD_VCARD = True
31 self.ensure_dummy_service_backend_running()
32 super(TestFavorite, self).setUp()
33
34 def _set_contact_service_dummy_backend_environment_variables(self):
35 self.patch_environment(
36 'CANONICAL_PIN_SERVICE_NAME', DUMMY_BACKEND_ADDRESS
37 )
38 self.patch_environment(
39 'FOLKS_BACKEND_PATH', self._get_dummy_backend_so_location()
40 )
41 self.patch_environment('FOLKS_BACKENDS_ALLOWED', 'dummy')
42 self.patch_environment('FOLKS_PRIMARY_STORE', 'dummy')
43
44 def _get_dummy_backend_so_location(self):
45 output = subprocess.check_output(
46 [
47 'find', '/usr/lib', '-name', 'dummy.so'
48 ]).split()
49
50 if len(output) is 1:
51 return output[0]
52 elif len(output) > 1:
53 for path in output:
54 if 'address-book-service' in path:
55 return path[0]
56 else:
57 raise RuntimeError(
58 'Dummy backend .so not found is address-book-service-dummy'
59 'installed ?'
60 )
61
62 def _get_address_book_service_binary_location(self):
63 output = subprocess.check_output(
64 [
65 'find', '/usr/lib', '-name', 'address-book-service'
66 ]).split()
67
68 for path in output:
69 if 'address-book-service/address-book-service' in path:
70 return path
71
72 def _start_service_dummy_backend(self):
73 self.service = subprocess.Popen(
74 [self._get_address_book_service_binary_location()]
75 )
76 self.addCleanup(self.service.kill)
77
78 self.assertThat(
79 lambda: self._is_dummy_backend_up(), Eventually(Equals(True))
80 )
81
82 def _is_dummy_backend_up(self):
83 interfaces = dbus.SessionBus().list_names()
84
85 return DUMMY_BACKEND_ADDRESS in interfaces
86
87 def ensure_dummy_service_backend_running(self):
88 self._set_contact_service_dummy_backend_environment_variables()
89 self._start_service_dummy_backend()
90
91 def _add_contact_as_favorite(self, name):
92 contact_list_page = self.main_window.get_contact_list_page()
93 contact_list_page.open_contact_view_by_contact_name(name)
94 contact_view = self.main_window.get_contact_view_page()
95 contact_view.click_favorite_icon()
96 self.main_window.go_back()
97
98 return contact_list_page
99
100 def test_add_favorite(self):
101 contact_list_page = self._add_contact_as_favorite('teste test34')
102
103 self.assertTrue(contact_list_page.contact_is_favorite('teste test34'))
104
105 def test_save_multiple_favorites(self):
106 contact_list_page = self._add_contact_as_favorite('teste test34')
107 self.assertTrue(contact_list_page.contact_is_favorite('teste test34'))
108
109 contact_list_page = self._add_contact_as_favorite('teste teste2')
110 self.assertTrue(contact_list_page.contact_is_favorite('teste teste2'))
111
112 def test_remove_favorite(self):
113 contact_list_page = self._add_contact_as_favorite('teste test34')
114 contact_list_page.open_contact_view_by_contact_name('teste test34')
115 contact_view = self.main_window.get_contact_view_page()
116 contact_view.click_favorite_icon()
117 self.main_window.go_back()
118 self.assertFalse(contact_list_page.contact_is_favorite('teste test34'))
119
120 def test_delete_favorite(self):
121 contact_list_page = self._add_contact_as_favorite('teste test34')
122 contact_list_page.click_favorite_by_name('teste test34')
123 toolbar = self.main_window.open_toolbar()
124 toolbar.click_button('delete')
125 self.assertRaises(
126 StateNotFoundError,
127 lambda: contact_list_page.get_favorite_by_name('teste test34'))
128 self.assertRaises(
129 StateNotFoundError,
130 lambda: contact_list_page.get_contact_by_name('teste test34'))
0131
=== modified file 'tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py'
--- tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py 2013-12-13 19:31:33 +0000
+++ tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py 2014-03-17 23:53:00 +0000
@@ -20,6 +20,7 @@
2020
21 def setUp(self):21 def setUp(self):
22 self.ARGS.append("addressbook:///pick?single=false")22 self.ARGS.append("addressbook:///pick?single=false")
23 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
23 AddressBookAppTestCase.PRELOAD_VCARD = True24 AddressBookAppTestCase.PRELOAD_VCARD = True
24 super(TestMultiplePickerMode, self).setUp()25 super(TestMultiplePickerMode, self).setUp()
2526
2627
=== modified file 'tests/autopilot/address_book_app/tests/test_single_pick_mode.py'
--- tests/autopilot/address_book_app/tests/test_single_pick_mode.py 2013-12-13 19:31:33 +0000
+++ tests/autopilot/address_book_app/tests/test_single_pick_mode.py 2014-03-17 23:53:00 +0000
@@ -21,6 +21,7 @@
21 def setUp(self):21 def setUp(self):
22 AddressBookAppTestCase.ARGS.append("addressbook:///pick?single=true")22 AddressBookAppTestCase.ARGS.append("addressbook:///pick?single=true")
23 AddressBookAppTestCase.PRELOAD_VCARD = True23 AddressBookAppTestCase.PRELOAD_VCARD = True
24 AddressBookAppTestCase.QTCONTACTS_MANAGER_OVERRIDE_MEMORY = True
24 super(TestSinglePickerMode, self).setUp()25 super(TestSinglePickerMode, self).setUp()
2526
26 def test_select_single_contact(self):27 def test_select_single_contact(self):

Subscribers

People subscribed via source and target branches

to all changes: