Merge lp:~elopio/address-book-app/refactoring_tests1 into lp:address-book-app
- refactoring_tests1
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~elopio/address-book-app/refactoring_tests1 |
Merge into: | lp:address-book-app |
Prerequisite: | lp:~renatofilho/address-book-app/new-header |
Diff against target: |
1505 lines (+527/-519) (has conflicts) 19 files modified
tests/autopilot/address_book_app/__init__.py (+0/-8) tests/autopilot/address_book_app/_errors.py (+21/-0) tests/autopilot/address_book_app/emulators/__init__.py (+0/-6) tests/autopilot/address_book_app/emulators/main_window.py (+0/-376) tests/autopilot/address_book_app/emulators/page_with_bottom_edge.py (+0/-40) tests/autopilot/address_book_app/pages/__init__.py (+25/-0) tests/autopilot/address_book_app/pages/_common.py (+53/-0) tests/autopilot/address_book_app/pages/_contact_editor.py (+272/-0) tests/autopilot/address_book_app/pages/_contact_list_page.py (+35/-14) tests/autopilot/address_book_app/pages/_contact_view.py (+28/-0) tests/autopilot/address_book_app/tests/__init__.py (+7/-5) tests/autopilot/address_book_app/tests/test_add_contact.py (+38/-36) tests/autopilot/address_book_app/tests/test_contactlist.py (+1/-1) tests/autopilot/address_book_app/tests/test_create_new_from_uri.py (+9/-9) tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py (+1/-3) tests/autopilot/address_book_app/tests/test_delete_contact.py (+4/-4) tests/autopilot/address_book_app/tests/test_edit_contact.py (+31/-15) tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py (+1/-1) tests/autopilot/address_book_app/tests/test_single_pick_mode.py (+1/-1) Text conflict in src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml Text conflict in src/imports/ContactEdit/TextInputDetail.qml Text conflict in src/imports/Ubuntu/Contacts/ContactSimpleListView.qml |
To merge this branch: | bzr merge lp:~elopio/address-book-app/refactoring_tests1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+220654@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-05-23.
Commit message
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:230
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
could you resubmit this proposal against the lp:~phablet-team/address-book-app/staging
Unmerged revisions
Preview Diff
1 | === removed file 'tests/autopilot/address_book_app/__init__.py' | |||
2 | --- tests/autopilot/address_book_app/__init__.py 2013-07-09 18:42:30 +0000 | |||
3 | +++ tests/autopilot/address_book_app/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,8 +0,0 @@ | |||
5 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
6 | 2 | # Copyright 2013 Canonical | ||
7 | 3 | # | ||
8 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
9 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
10 | 6 | # by the Free Software Foundation. | ||
11 | 7 | |||
12 | 8 | """address-book-app autopilot tests and emulators - top level package.""" | ||
13 | 9 | 0 | ||
14 | === added file 'tests/autopilot/address_book_app/_errors.py' | |||
15 | --- tests/autopilot/address_book_app/_errors.py 1970-01-01 00:00:00 +0000 | |||
16 | +++ tests/autopilot/address_book_app/_errors.py 2014-05-22 14:40:49 +0000 | |||
17 | @@ -0,0 +1,21 @@ | |||
18 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
19 | 2 | # | ||
20 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
21 | 4 | # | ||
22 | 5 | # This program is free software; you can redistribute it and/or modify | ||
23 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
24 | 7 | # by the Free Software Foundation. | ||
25 | 8 | # | ||
26 | 9 | # This program is distributed in the hope that it will be useful, | ||
27 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
28 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
29 | 12 | # GNU General Public License for more details. | ||
30 | 13 | # | ||
31 | 14 | # You should have received a copy of the GNU General Public License | ||
32 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
33 | 16 | |||
34 | 17 | import ubuntuuitoolkit | ||
35 | 18 | |||
36 | 19 | |||
37 | 20 | class AddressBookAppError(ubuntuuitoolkit.ToolkitException): | ||
38 | 21 | """Exception raised when there is an error with the emulator.""" | ||
39 | 0 | 22 | ||
40 | === removed directory 'tests/autopilot/address_book_app/emulators' | |||
41 | === removed file 'tests/autopilot/address_book_app/emulators/__init__.py' | |||
42 | --- tests/autopilot/address_book_app/emulators/__init__.py 2013-07-09 18:42:30 +0000 | |||
43 | +++ tests/autopilot/address_book_app/emulators/__init__.py 1970-01-01 00:00:00 +0000 | |||
44 | @@ -1,6 +0,0 @@ | |||
45 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
46 | 2 | # Copyright 2013 Canonical | ||
47 | 3 | # | ||
48 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
49 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
50 | 6 | # by the Free Software Foundation. | ||
51 | 7 | 0 | ||
52 | === removed file 'tests/autopilot/address_book_app/emulators/main_window.py' | |||
53 | --- tests/autopilot/address_book_app/emulators/main_window.py 2014-05-22 14:40:49 +0000 | |||
54 | +++ tests/autopilot/address_book_app/emulators/main_window.py 1970-01-01 00:00:00 +0000 | |||
55 | @@ -1,376 +0,0 @@ | |||
56 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
57 | 2 | # Copyright 2013, 2014 Canonical | ||
58 | 3 | # | ||
59 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
60 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
61 | 6 | # by the Free Software Foundation. | ||
62 | 7 | |||
63 | 8 | import collections | ||
64 | 9 | import logging | ||
65 | 10 | import time | ||
66 | 11 | |||
67 | 12 | from autopilot import logging as autopilot_logging | ||
68 | 13 | from autopilot.introspection.dbus import StateNotFoundError | ||
69 | 14 | from ubuntuuitoolkit import emulators as uitk | ||
70 | 15 | from address_book_app import data | ||
71 | 16 | from address_book_app.emulators.page_with_bottom_edge import ContactListPage | ||
72 | 17 | |||
73 | 18 | |||
74 | 19 | logger = logging.getLogger(__name__) | ||
75 | 20 | |||
76 | 21 | |||
77 | 22 | _TEXT_FIELD_OBJECT_NAMES = { | ||
78 | 23 | 'first_name': 'firstName', | ||
79 | 24 | 'last_name': 'lastName', | ||
80 | 25 | 'street': 'streetAddress_{}', | ||
81 | 26 | 'locality': 'localityAddress_{}', | ||
82 | 27 | 'region': 'regionAddress_{}', | ||
83 | 28 | 'postal_code': 'postcodeAddress_{}', | ||
84 | 29 | 'country': 'countryAddress_{}' | ||
85 | 30 | } | ||
86 | 31 | |||
87 | 32 | |||
88 | 33 | def _get_text_field(parent, field, index=None): | ||
89 | 34 | if field not in _TEXT_FIELD_OBJECT_NAMES: | ||
90 | 35 | raise AddressBookAppError('Unknown field: {}.'.format(field)) | ||
91 | 36 | |||
92 | 37 | object_name = _TEXT_FIELD_OBJECT_NAMES[field] | ||
93 | 38 | if index is not None: | ||
94 | 39 | object_name = object_name.format(index) | ||
95 | 40 | return parent.select_single(TextInputDetail, objectName=object_name) | ||
96 | 41 | |||
97 | 42 | |||
98 | 43 | class AddressBookAppError(uitk.ToolkitEmulatorException): | ||
99 | 44 | """Exception raised when there is an error with the emulator.""" | ||
100 | 45 | |||
101 | 46 | |||
102 | 47 | class MainWindow(uitk.MainView): | ||
103 | 48 | """An emulator class that makes it easy to interact with the app.""" | ||
104 | 49 | |||
105 | 50 | def get_contact_list_page(self): | ||
106 | 51 | # ContactListPage is the only page that can appears multiple times | ||
107 | 52 | # Ex.: During the pick mode we alway push a new contactListPage, to | ||
108 | 53 | # preserve the current application status. | ||
109 | 54 | pages = self.select_many(ContactListPage, | ||
110 | 55 | objectName="contactListPage") | ||
111 | 56 | |||
112 | 57 | # alway return the page without pickMode | ||
113 | 58 | for p in pages: | ||
114 | 59 | if not p.pickMode: | ||
115 | 60 | return p | ||
116 | 61 | return None | ||
117 | 62 | |||
118 | 63 | def get_contact_edit_page(self): | ||
119 | 64 | # We can have two contact editor page because of bottom edge page | ||
120 | 65 | # but we will return only the actived one | ||
121 | 66 | list_page = self.get_contact_list_page() | ||
122 | 67 | list_page.bottomEdgePageLoaded.wait_for(True) | ||
123 | 68 | pages = self.select_many(ContactEditor, | ||
124 | 69 | objectName="contactEditorPage") | ||
125 | 70 | for p in pages: | ||
126 | 71 | if p.active: | ||
127 | 72 | return p | ||
128 | 73 | raise StateNotFoundError('contactEditorPage not found') | ||
129 | 74 | return None | ||
130 | 75 | |||
131 | 76 | |||
132 | 77 | def get_contact_view_page(self): | ||
133 | 78 | return self.wait_select_single("ContactView", | ||
134 | 79 | objectName="contactViewPage") | ||
135 | 80 | |||
136 | 81 | def get_contact_list_pick_page(self): | ||
137 | 82 | pages = self.select_many("ContactListPage", | ||
138 | 83 | objectName="contactListPage") | ||
139 | 84 | for p in pages: | ||
140 | 85 | if p.pickMode: | ||
141 | 86 | return p | ||
142 | 87 | return None | ||
143 | 88 | |||
144 | 89 | def get_contact_list_view(self): | ||
145 | 90 | """ | ||
146 | 91 | Returns a ContactListView iobject for the current window | ||
147 | 92 | """ | ||
148 | 93 | return self.wait_select_single("ContactListView", | ||
149 | 94 | objectName="contactListView") | ||
150 | 95 | |||
151 | 96 | def get_button(self, buttonName): | ||
152 | 97 | return self.get_header()._get_action_button(buttonName) | ||
153 | 98 | |||
154 | 99 | def open_header(self): | ||
155 | 100 | header = self.get_header() | ||
156 | 101 | if (header.y != 0): | ||
157 | 102 | edit_page = self.get_contact_edit_page() | ||
158 | 103 | flickable = edit_page.wait_select_single( | ||
159 | 104 | "QQuickFlickable", | ||
160 | 105 | objectName="scrollArea") | ||
161 | 106 | |||
162 | 107 | while (header.y != 0): | ||
163 | 108 | globalRect = flickable.globalRect | ||
164 | 109 | start_x = globalRect.x + (globalRect.width * 0.5) | ||
165 | 110 | start_y = globalRect.y + (flickable.height * 0.1) | ||
166 | 111 | stop_y = start_y + (flickable.height * 0.1) | ||
167 | 112 | |||
168 | 113 | self.pointing_device.drag(start_x, start_y, start_x, stop_y, rate=5) | ||
169 | 114 | # wait flicking stops to move to the next field | ||
170 | 115 | flickable.flicking.wait_for(False) | ||
171 | 116 | |||
172 | 117 | return header | ||
173 | 118 | |||
174 | 119 | def cancel(self): | ||
175 | 120 | """ | ||
176 | 121 | Press the 'Cancel' button | ||
177 | 122 | """ | ||
178 | 123 | header = self.open_header() | ||
179 | 124 | header.click_custom_back_button() | ||
180 | 125 | |||
181 | 126 | def save(self): | ||
182 | 127 | """ | ||
183 | 128 | Press the 'Save' button | ||
184 | 129 | """ | ||
185 | 130 | bottom_swipe_page = self.get_contact_list_page() | ||
186 | 131 | self.click_action_button("save") | ||
187 | 132 | bottom_swipe_page.isCollapsed.wait_for(True) | ||
188 | 133 | |||
189 | 134 | def done_selection(self): | ||
190 | 135 | """ | ||
191 | 136 | Press the 'doneSelection' button | ||
192 | 137 | """ | ||
193 | 138 | bottom_swipe_page = self.get_contact_list_page() | ||
194 | 139 | self.click_action_button("doneSelection") | ||
195 | 140 | bottom_swipe_page.isCollapsed.wait_for(True) | ||
196 | 141 | |||
197 | 142 | def get_toolbar(self): | ||
198 | 143 | """Override base class so we get our expected Toolbar subclass.""" | ||
199 | 144 | return self.select_single(Toolbar) | ||
200 | 145 | |||
201 | 146 | @autopilot_logging.log_action(logger.info) | ||
202 | 147 | def go_to_add_contact(self): | ||
203 | 148 | """ | ||
204 | 149 | Press the 'Add' button and return the contact editor page | ||
205 | 150 | """ | ||
206 | 151 | bottom_swipe_page = self.get_contact_list_page() | ||
207 | 152 | bottom_swipe_page.revel_bottom_edge_page() | ||
208 | 153 | return self.get_contact_edit_page() | ||
209 | 154 | |||
210 | 155 | |||
211 | 156 | class ContactEditor(uitk.UbuntuUIToolkitEmulatorBase): | ||
212 | 157 | """Custom proxy object for the Contact Editor.""" | ||
213 | 158 | |||
214 | 159 | @autopilot_logging.log_action(logger.info) | ||
215 | 160 | def fill_form(self, contact_information): | ||
216 | 161 | """Fill the edit contact form. | ||
217 | 162 | |||
218 | 163 | :param contact_information: Values of the contact to fill the form. | ||
219 | 164 | :type contact_information: data object with the attributes first_name, | ||
220 | 165 | last_name, phones, emails, social_aliases, addresses and | ||
221 | 166 | professional_details | ||
222 | 167 | |||
223 | 168 | """ | ||
224 | 169 | if contact_information.first_name is not None: | ||
225 | 170 | self._fill_first_name(contact_information.first_name) | ||
226 | 171 | if contact_information.last_name is not None: | ||
227 | 172 | self._fill_last_name(contact_information.last_name) | ||
228 | 173 | |||
229 | 174 | groups = collections.OrderedDict() | ||
230 | 175 | groups['phones'] = contact_information.phones | ||
231 | 176 | groups['emails'] = contact_information.emails | ||
232 | 177 | groups['ims'] = contact_information.social_aliases | ||
233 | 178 | groups['addresses'] = contact_information.addresses | ||
234 | 179 | groups['professionalDetails'] = ( | ||
235 | 180 | contact_information.professional_details) | ||
236 | 181 | |||
237 | 182 | for key, information in groups.items(): | ||
238 | 183 | if information: | ||
239 | 184 | self._fill_detail_group( | ||
240 | 185 | object_name=key, details=information) | ||
241 | 186 | |||
242 | 187 | def _fill_first_name(self, first_name): | ||
243 | 188 | text_field = _get_text_field(self, 'first_name') | ||
244 | 189 | text_field.write(first_name) | ||
245 | 190 | |||
246 | 191 | def _fill_last_name(self, last_name): | ||
247 | 192 | text_field = _get_text_field(self, 'last_name') | ||
248 | 193 | text_field.write(last_name) | ||
249 | 194 | |||
250 | 195 | def _fill_detail_group(self, object_name, details): | ||
251 | 196 | editor = self.select_single( | ||
252 | 197 | ContactDetailGroupWithTypeEditor, objectName=object_name) | ||
253 | 198 | editor.fill(details) | ||
254 | 199 | |||
255 | 200 | def _get_form_values(self): | ||
256 | 201 | first_name = _get_text_field(self, 'first_name').text | ||
257 | 202 | last_name = _get_text_field(self, 'last_name').text | ||
258 | 203 | phones = self._get_values_from_detail_group(object_name='phones') | ||
259 | 204 | emails = self._get_values_from_detail_group(object_name='emails') | ||
260 | 205 | social_aliases = self._get_values_from_detail_group(object_name='ims') | ||
261 | 206 | addresses = self._get_values_from_detail_group(object_name='addresses') | ||
262 | 207 | professional_details = self._get_values_from_detail_group( | ||
263 | 208 | object_name='professionalDetails') | ||
264 | 209 | |||
265 | 210 | return data.Contact( | ||
266 | 211 | first_name=first_name, last_name=last_name, phones=phones, | ||
267 | 212 | emails=emails, social_aliases=social_aliases, addresses=addresses, | ||
268 | 213 | professional_details=professional_details) | ||
269 | 214 | |||
270 | 215 | def _get_values_from_detail_group(self, object_name): | ||
271 | 216 | editor = self.select_single( | ||
272 | 217 | ContactDetailGroupWithTypeEditor, objectName=object_name) | ||
273 | 218 | return editor.get_values(object_name) | ||
274 | 219 | |||
275 | 220 | def wait_to_stop_moving(self): | ||
276 | 221 | flickable = self.select_single( | ||
277 | 222 | 'QQuickFlickable', objectName='scrollArea') | ||
278 | 223 | flickable.flicking.wait_for(False) | ||
279 | 224 | |||
280 | 225 | |||
281 | 226 | class TextInputDetail(uitk.TextField): | ||
282 | 227 | """Custom proxy object for the Text Input Detail field.""" | ||
283 | 228 | |||
284 | 229 | |||
285 | 230 | class ContactDetailGroupWithTypeEditor(uitk.UbuntuUIToolkitEmulatorBase): | ||
286 | 231 | """Custom proxy object for the ContactDetailGroupWithTypeEditor widget.""" | ||
287 | 232 | |||
288 | 233 | _DETAIL_EDITORS = { | ||
289 | 234 | 'phones': 'base_phoneNumber_{}', | ||
290 | 235 | 'emails': 'base_email_{}', | ||
291 | 236 | 'ims': 'base_onlineAccount_{}', | ||
292 | 237 | 'addresses': 'base_address_{}', | ||
293 | 238 | # FIXME fix the unknown. --elopio - 2014-03-01 | ||
294 | 239 | 'professionalDetails': 'base_unknown_{}' | ||
295 | 240 | } | ||
296 | 241 | |||
297 | 242 | def fill(self, details): | ||
298 | 243 | """Fill a contact detail group.""" | ||
299 | 244 | for index, detail in enumerate(details[:-1]): | ||
300 | 245 | self._fill_detail(index, detail) | ||
301 | 246 | self._add_detail() | ||
302 | 247 | self._fill_detail(len(details) - 1, details[-1]) | ||
303 | 248 | |||
304 | 249 | def _fill_detail(self, index, detail): | ||
305 | 250 | detail_editor = self._get_detail_editor_by_index(index) | ||
306 | 251 | detail_editor.fill(field=self.objectName, index=index, detail=detail) | ||
307 | 252 | |||
308 | 253 | def _get_detail_editor_by_index(self, index): | ||
309 | 254 | object_name = self._get_contact_detail_editor_object_name(index) | ||
310 | 255 | return self.select_single( | ||
311 | 256 | ContactDetailWithTypeEditor, objectName=object_name) | ||
312 | 257 | |||
313 | 258 | def _get_contact_detail_editor_object_name(self, index): | ||
314 | 259 | return self._DETAIL_EDITORS[self.objectName].format(index) | ||
315 | 260 | |||
316 | 261 | def _add_detail(self): | ||
317 | 262 | # TODO --elopio - 2014-03-01 | ||
318 | 263 | raise NotImplementedError('Add extra details not yet implemented.') | ||
319 | 264 | |||
320 | 265 | def get_values(self, object_name): | ||
321 | 266 | """Return the values of a contact detail group.""" | ||
322 | 267 | values = [] | ||
323 | 268 | for index in range(self.detailsCount): | ||
324 | 269 | detail_editor = self._get_detail_editor_by_index(index) | ||
325 | 270 | value = detail_editor.get_values(field=object_name, index=index) | ||
326 | 271 | if (value): | ||
327 | 272 | values.append(value) | ||
328 | 273 | |||
329 | 274 | return values | ||
330 | 275 | |||
331 | 276 | |||
332 | 277 | class ContactDetailWithTypeEditor(uitk.UbuntuUIToolkitEmulatorBase): | ||
333 | 278 | """Custom proxy object for the ContactDetailWithTypeEditor widget.""" | ||
334 | 279 | |||
335 | 280 | def __init__(self, *args): | ||
336 | 281 | super(ContactDetailWithTypeEditor, self).__init__(*args) | ||
337 | 282 | self.main_view = self.get_root_instance().select_single(MainWindow) | ||
338 | 283 | |||
339 | 284 | def fill(self, field, index, detail): | ||
340 | 285 | self._select_type(detail) | ||
341 | 286 | self._fill_value(field, index, detail) | ||
342 | 287 | |||
343 | 288 | def _select_type(self, detail): | ||
344 | 289 | type_index = detail.TYPES.index(detail.type) | ||
345 | 290 | selected_type_index = self._get_selected_type_index() | ||
346 | 291 | if type_index != selected_type_index: | ||
347 | 292 | # TODO --elopio - 2014-03-01 | ||
348 | 293 | raise NotImplementedError('Type selection not yet implemented.') | ||
349 | 294 | |||
350 | 295 | def _get_selected_type_index(self): | ||
351 | 296 | value_selector = self.select_single('ValueSelector') | ||
352 | 297 | return value_selector.currentIndex | ||
353 | 298 | |||
354 | 299 | def _fill_value(self, field, index, detail): | ||
355 | 300 | single_values = { | ||
356 | 301 | 'phones': 'number', | ||
357 | 302 | 'emails': 'address', | ||
358 | 303 | 'ims': 'alias' | ||
359 | 304 | } | ||
360 | 305 | if field in single_values: | ||
361 | 306 | self._fill_single_field(getattr(detail, single_values[field])) | ||
362 | 307 | elif field == 'addresses': | ||
363 | 308 | self._fill_address(index, detail) | ||
364 | 309 | elif field == 'professionalDetails': | ||
365 | 310 | self._fill_professional_details(index, detail) | ||
366 | 311 | else: | ||
367 | 312 | raise AddressBookAppError('Unknown field: {}.'.format(field)) | ||
368 | 313 | |||
369 | 314 | def _fill_single_field(self, value): | ||
370 | 315 | text_field = self.select_single(TextInputDetail) | ||
371 | 316 | self._make_field_visible_and_write(text_field, value) | ||
372 | 317 | |||
373 | 318 | def _make_field_visible_and_write(self, text_field, value): | ||
374 | 319 | while not text_field.activeFocus: | ||
375 | 320 | # XXX We should just swipe the text field into view. | ||
376 | 321 | # Update this once bug http://pad.lv/1286479 is implemented. | ||
377 | 322 | # --elopio - 2014-03-01 | ||
378 | 323 | text_field.keyboard.press_and_release('Tab') | ||
379 | 324 | time.sleep(0.1) | ||
380 | 325 | self.main_view.get_contact_edit_page().wait_to_stop_moving() | ||
381 | 326 | |||
382 | 327 | text_field.write(value) | ||
383 | 328 | |||
384 | 329 | def _fill_address(self, index, address): | ||
385 | 330 | fields = collections.OrderedDict() | ||
386 | 331 | fields['street'] = address.street | ||
387 | 332 | fields['locality'] = address.locality | ||
388 | 333 | fields['region'] = address.region | ||
389 | 334 | fields['postal_code'] = address.postal_code | ||
390 | 335 | fields['country'] = address.country | ||
391 | 336 | for key, value in fields.items(): | ||
392 | 337 | text_field = _get_text_field(self, key, index) | ||
393 | 338 | self._make_field_visible_and_write(text_field, value) | ||
394 | 339 | |||
395 | 340 | def _fill_professional_details(self, index, address): | ||
396 | 341 | # TODO --elopio - 2014-03-01 | ||
397 | 342 | raise NotImplementedError('Not yet implemented.') | ||
398 | 343 | |||
399 | 344 | def get_values(self, field, index): | ||
400 | 345 | if field == 'phones': | ||
401 | 346 | return data.Phone( | ||
402 | 347 | type_=data.Phone.TYPES[self._get_selected_type_index()], | ||
403 | 348 | number=self._get_single_field_value()) | ||
404 | 349 | if field == 'emails': | ||
405 | 350 | return data.Email( | ||
406 | 351 | type_=data.Email.TYPES[self._get_selected_type_index()], | ||
407 | 352 | address=self._get_single_field_value()) | ||
408 | 353 | if field == 'ims': | ||
409 | 354 | return data.SocialAlias( | ||
410 | 355 | type_=data.SocialAlias.TYPES[self._get_selected_type_index()], | ||
411 | 356 | alias=self._get_single_field_value()) | ||
412 | 357 | if field == 'addresses': | ||
413 | 358 | return self._get_address_value(index) | ||
414 | 359 | if field == 'professionalDetails': | ||
415 | 360 | # TODO --elopio - 2014-03-01 | ||
416 | 361 | return None | ||
417 | 362 | raise AddressBookAppError('Unknown field: {}.'.format(field)) | ||
418 | 363 | |||
419 | 364 | def _get_single_field_value(self): | ||
420 | 365 | return self.select_single(TextInputDetail).text | ||
421 | 366 | |||
422 | 367 | def _get_address_value(self, index): | ||
423 | 368 | street = _get_text_field(self, 'street', index).text | ||
424 | 369 | locality = _get_text_field(self, 'locality', index).text | ||
425 | 370 | region = _get_text_field(self, 'region', index).text | ||
426 | 371 | postal_code = _get_text_field(self, 'postal_code', index).text | ||
427 | 372 | country = _get_text_field(self, 'country', index).text | ||
428 | 373 | return data.Address( | ||
429 | 374 | type_=data.Address.TYPES[self._get_selected_type_index()], | ||
430 | 375 | street=street, locality=locality, region=region, | ||
431 | 376 | postal_code=postal_code, country=country) | ||
432 | 377 | 0 | ||
433 | === removed file 'tests/autopilot/address_book_app/emulators/page_with_bottom_edge.py' | |||
434 | --- tests/autopilot/address_book_app/emulators/page_with_bottom_edge.py 2014-05-22 14:40:49 +0000 | |||
435 | +++ tests/autopilot/address_book_app/emulators/page_with_bottom_edge.py 1970-01-01 00:00:00 +0000 | |||
436 | @@ -1,40 +0,0 @@ | |||
437 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
438 | 2 | |||
439 | 3 | """ PageWithBottomEdge emulator """ | ||
440 | 4 | |||
441 | 5 | # Copyright 2014 Canonical | ||
442 | 6 | # | ||
443 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
444 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
445 | 9 | # by the Free Software Foundation. | ||
446 | 10 | |||
447 | 11 | import logging | ||
448 | 12 | from address_book_app.emulators.contact_list_page import ContactListPage | ||
449 | 13 | from autopilot.introspection.dbus import StateNotFoundError | ||
450 | 14 | from ubuntuuitoolkit import emulators as toolkit_emulators | ||
451 | 15 | |||
452 | 16 | logger = logging.getLogger(__name__) | ||
453 | 17 | |||
454 | 18 | class PageWithBottomEdge(ContactListPage): | ||
455 | 19 | """An emulator class that makes it easy to interact with the bottom edge | ||
456 | 20 | swipe page""" | ||
457 | 21 | def __init__(self, *args): | ||
458 | 22 | super(PageWithBottomEdge, self).__init__(*args) | ||
459 | 23 | |||
460 | 24 | def revel_bottom_edge_page(self): | ||
461 | 25 | """Bring the bottom edge page to the screen""" | ||
462 | 26 | self.bottomEdgePageLoaded.wait_for(True) | ||
463 | 27 | try: | ||
464 | 28 | action_item = self.wait_select_single('QQuickItem', objectName='bottomEdgeTip') | ||
465 | 29 | start_x = action_item.globalRect.x + (action_item.globalRect.width * 0.5) | ||
466 | 30 | start_y = action_item.globalRect.y + (action_item.height * 0.5) | ||
467 | 31 | stop_y = start_y - (self.height * 0.7) | ||
468 | 32 | self.pointing_device.drag(start_x, start_y, start_x, stop_y, rate=2) | ||
469 | 33 | self.isReady.wait_for(True) | ||
470 | 34 | except StateNotFoundError: | ||
471 | 35 | logger.error('ButtomEdge element not found.') | ||
472 | 36 | raise | ||
473 | 37 | |||
474 | 38 | class ContactListPage(PageWithBottomEdge): | ||
475 | 39 | pass | ||
476 | 40 | |||
477 | 41 | 0 | ||
478 | === added directory 'tests/autopilot/address_book_app/pages' | |||
479 | === added file 'tests/autopilot/address_book_app/pages/__init__.py' | |||
480 | --- tests/autopilot/address_book_app/pages/__init__.py 1970-01-01 00:00:00 +0000 | |||
481 | +++ tests/autopilot/address_book_app/pages/__init__.py 2014-05-22 14:40:49 +0000 | |||
482 | @@ -0,0 +1,25 @@ | |||
483 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
484 | 2 | # | ||
485 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
486 | 4 | # | ||
487 | 5 | # This program is free software; you can redistribute it and/or modify | ||
488 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
489 | 7 | # by the Free Software Foundation. | ||
490 | 8 | # | ||
491 | 9 | # This program is distributed in the hope that it will be useful, | ||
492 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
493 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
494 | 12 | # GNU General Public License for more details. | ||
495 | 13 | # | ||
496 | 14 | # You should have received a copy of the GNU General Public License | ||
497 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
498 | 16 | |||
499 | 17 | __all__ = [ | ||
500 | 18 | 'ContactEditor', | ||
501 | 19 | 'ContactListPage', | ||
502 | 20 | 'ContactView', | ||
503 | 21 | ] | ||
504 | 22 | |||
505 | 23 | from address_book_app.pages._contact_editor import ContactEditor | ||
506 | 24 | from address_book_app.pages._contact_list_page import ContactListPage | ||
507 | 25 | from address_book_app.pages._contact_view import ContactView | ||
508 | 0 | 26 | ||
509 | === added file 'tests/autopilot/address_book_app/pages/_common.py' | |||
510 | --- tests/autopilot/address_book_app/pages/_common.py 1970-01-01 00:00:00 +0000 | |||
511 | +++ tests/autopilot/address_book_app/pages/_common.py 2014-05-22 14:40:49 +0000 | |||
512 | @@ -0,0 +1,53 @@ | |||
513 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
514 | 2 | # | ||
515 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
516 | 4 | # | ||
517 | 5 | # This program is free software; you can redistribute it and/or modify | ||
518 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
519 | 7 | # by the Free Software Foundation. | ||
520 | 8 | # | ||
521 | 9 | # This program is distributed in the hope that it will be useful, | ||
522 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
523 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
524 | 12 | # GNU General Public License for more details. | ||
525 | 13 | # | ||
526 | 14 | # You should have received a copy of the GNU General Public License | ||
527 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
528 | 16 | |||
529 | 17 | import logging | ||
530 | 18 | |||
531 | 19 | import ubuntuuitoolkit | ||
532 | 20 | from autopilot.introspection import dbus | ||
533 | 21 | |||
534 | 22 | |||
535 | 23 | logger = logging.getLogger(__name__) | ||
536 | 24 | |||
537 | 25 | |||
538 | 26 | class PageWithHeader(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
539 | 27 | |||
540 | 28 | def get_header(self): | ||
541 | 29 | """Return the Header custom proxy object of the Page.""" | ||
542 | 30 | return self.get_root_instance().select_single( | ||
543 | 31 | 'Header', objectName='MainView_Header') | ||
544 | 32 | |||
545 | 33 | |||
546 | 34 | class PageWithBottomEdge(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
547 | 35 | """An emulator class that makes it easy to interact with the bottom edge | ||
548 | 36 | swipe page""" | ||
549 | 37 | |||
550 | 38 | def revel_bottom_edge_page(self): | ||
551 | 39 | """Bring the bottom edge page to the screen""" | ||
552 | 40 | self.bottomEdgePageLoaded.wait_for(True) | ||
553 | 41 | try: | ||
554 | 42 | action_item = self.wait_select_single( | ||
555 | 43 | 'QQuickItem', objectName='bottomEdgeTip') | ||
556 | 44 | start_x = (action_item.globalRect.x + | ||
557 | 45 | (action_item.globalRect.width * 0.5)) | ||
558 | 46 | start_y = action_item.globalRect.y + (action_item.height * 0.5) | ||
559 | 47 | stop_y = start_y - (self.height * 0.7) | ||
560 | 48 | self.pointing_device.drag( | ||
561 | 49 | start_x, start_y, start_x, stop_y, rate=2) | ||
562 | 50 | self.isReady.wait_for(True) | ||
563 | 51 | except dbus.StateNotFoundError: | ||
564 | 52 | logger.error('ButtomEdge element not found.') | ||
565 | 53 | raise | ||
566 | 0 | 54 | ||
567 | === added file 'tests/autopilot/address_book_app/pages/_contact_editor.py' | |||
568 | --- tests/autopilot/address_book_app/pages/_contact_editor.py 1970-01-01 00:00:00 +0000 | |||
569 | +++ tests/autopilot/address_book_app/pages/_contact_editor.py 2014-05-22 14:40:49 +0000 | |||
570 | @@ -0,0 +1,272 @@ | |||
571 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
572 | 2 | # | ||
573 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
574 | 4 | # | ||
575 | 5 | # This program is free software; you can redistribute it and/or modify | ||
576 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
577 | 7 | # by the Free Software Foundation. | ||
578 | 8 | # | ||
579 | 9 | # This program is distributed in the hope that it will be useful, | ||
580 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
581 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
582 | 12 | # GNU General Public License for more details. | ||
583 | 13 | # | ||
584 | 14 | # You should have received a copy of the GNU General Public License | ||
585 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
586 | 16 | |||
587 | 17 | import collections | ||
588 | 18 | import logging | ||
589 | 19 | import time | ||
590 | 20 | |||
591 | 21 | import autopilot.logging | ||
592 | 22 | import ubuntuuitoolkit | ||
593 | 23 | from address_book_app import data, _errors | ||
594 | 24 | from address_book_app.pages import _common | ||
595 | 25 | |||
596 | 26 | |||
597 | 27 | logger = logging.getLogger(__name__) | ||
598 | 28 | |||
599 | 29 | |||
600 | 30 | _TEXT_FIELD_OBJECT_NAMES = { | ||
601 | 31 | 'first_name': 'firstName', | ||
602 | 32 | 'last_name': 'lastName', | ||
603 | 33 | 'street': 'streetAddress_{}', | ||
604 | 34 | 'locality': 'localityAddress_{}', | ||
605 | 35 | 'region': 'regionAddress_{}', | ||
606 | 36 | 'postal_code': 'postcodeAddress_{}', | ||
607 | 37 | 'country': 'countryAddress_{}' | ||
608 | 38 | } | ||
609 | 39 | |||
610 | 40 | |||
611 | 41 | def _get_text_field(parent, field, index=None): | ||
612 | 42 | if field not in _TEXT_FIELD_OBJECT_NAMES: | ||
613 | 43 | raise _errors.AddressBookAppError('Unknown field: {}.'.format(field)) | ||
614 | 44 | |||
615 | 45 | object_name = _TEXT_FIELD_OBJECT_NAMES[field] | ||
616 | 46 | if index is not None: | ||
617 | 47 | object_name = object_name.format(index) | ||
618 | 48 | return parent.select_single(TextInputDetail, objectName=object_name) | ||
619 | 49 | |||
620 | 50 | |||
621 | 51 | class ContactEditor(_common.PageWithHeader): | ||
622 | 52 | """Custom proxy object for the Contact Editor.""" | ||
623 | 53 | |||
624 | 54 | @autopilot.logging.log_action(logger.info) | ||
625 | 55 | def fill_form(self, contact_information): | ||
626 | 56 | """Fill the edit contact form. | ||
627 | 57 | |||
628 | 58 | :param contact_information: Values of the contact to fill the form. | ||
629 | 59 | :type contact_information: data object with the attributes first_name, | ||
630 | 60 | last_name, phones, emails, social_aliases, addresses and | ||
631 | 61 | professional_details | ||
632 | 62 | |||
633 | 63 | """ | ||
634 | 64 | if contact_information.first_name is not None: | ||
635 | 65 | self._fill_first_name(contact_information.first_name) | ||
636 | 66 | if contact_information.last_name is not None: | ||
637 | 67 | self._fill_last_name(contact_information.last_name) | ||
638 | 68 | |||
639 | 69 | groups = collections.OrderedDict() | ||
640 | 70 | groups['phones'] = contact_information.phones | ||
641 | 71 | groups['emails'] = contact_information.emails | ||
642 | 72 | groups['ims'] = contact_information.social_aliases | ||
643 | 73 | groups['addresses'] = contact_information.addresses | ||
644 | 74 | groups['professionalDetails'] = ( | ||
645 | 75 | contact_information.professional_details) | ||
646 | 76 | |||
647 | 77 | for key, information in groups.items(): | ||
648 | 78 | if information: | ||
649 | 79 | self._fill_detail_group( | ||
650 | 80 | object_name=key, details=information) | ||
651 | 81 | |||
652 | 82 | def _fill_first_name(self, first_name): | ||
653 | 83 | text_field = _get_text_field(self, 'first_name') | ||
654 | 84 | text_field.write(first_name) | ||
655 | 85 | |||
656 | 86 | def _fill_last_name(self, last_name): | ||
657 | 87 | text_field = _get_text_field(self, 'last_name') | ||
658 | 88 | text_field.write(last_name) | ||
659 | 89 | |||
660 | 90 | def _fill_detail_group(self, object_name, details): | ||
661 | 91 | editor = self.select_single( | ||
662 | 92 | ContactDetailGroupWithTypeEditor, objectName=object_name) | ||
663 | 93 | editor.fill(details) | ||
664 | 94 | |||
665 | 95 | def _get_form_values(self): | ||
666 | 96 | first_name = _get_text_field(self, 'first_name').text | ||
667 | 97 | last_name = _get_text_field(self, 'last_name').text | ||
668 | 98 | phones = self._get_values_from_detail_group(object_name='phones') | ||
669 | 99 | emails = self._get_values_from_detail_group(object_name='emails') | ||
670 | 100 | social_aliases = self._get_values_from_detail_group(object_name='ims') | ||
671 | 101 | addresses = self._get_values_from_detail_group(object_name='addresses') | ||
672 | 102 | professional_details = self._get_values_from_detail_group( | ||
673 | 103 | object_name='professionalDetails') | ||
674 | 104 | |||
675 | 105 | return data.Contact( | ||
676 | 106 | first_name=first_name, last_name=last_name, phones=phones, | ||
677 | 107 | emails=emails, social_aliases=social_aliases, addresses=addresses, | ||
678 | 108 | professional_details=professional_details) | ||
679 | 109 | |||
680 | 110 | def _get_values_from_detail_group(self, object_name): | ||
681 | 111 | editor = self.select_single( | ||
682 | 112 | ContactDetailGroupWithTypeEditor, objectName=object_name) | ||
683 | 113 | return editor.get_values(object_name) | ||
684 | 114 | |||
685 | 115 | def wait_to_stop_moving(self): | ||
686 | 116 | flickable = self.select_single( | ||
687 | 117 | 'QQuickFlickable', objectName='scrollArea') | ||
688 | 118 | flickable.flicking.wait_for(False) | ||
689 | 119 | |||
690 | 120 | |||
691 | 121 | class TextInputDetail(ubuntuuitoolkit.TextField): | ||
692 | 122 | """Custom proxy object for the Text Input Detail field.""" | ||
693 | 123 | |||
694 | 124 | |||
695 | 125 | class ContactDetailGroupWithTypeEditor( | ||
696 | 126 | ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
697 | 127 | """Custom proxy object for the ContactDetailGroupWithTypeEditor widget.""" | ||
698 | 128 | |||
699 | 129 | _DETAIL_EDITORS = { | ||
700 | 130 | 'phones': 'base_phoneNumber_{}', | ||
701 | 131 | 'emails': 'base_email_{}', | ||
702 | 132 | 'ims': 'base_onlineAccount_{}', | ||
703 | 133 | 'addresses': 'base_address_{}', | ||
704 | 134 | # FIXME fix the unknown. --elopio - 2014-03-01 | ||
705 | 135 | 'professionalDetails': 'base_unknown_{}' | ||
706 | 136 | } | ||
707 | 137 | |||
708 | 138 | def fill(self, details): | ||
709 | 139 | """Fill a contact detail group.""" | ||
710 | 140 | for index, detail in enumerate(details[:-1]): | ||
711 | 141 | self._fill_detail(index, detail) | ||
712 | 142 | self._add_detail() | ||
713 | 143 | self._fill_detail(len(details) - 1, details[-1]) | ||
714 | 144 | |||
715 | 145 | def _fill_detail(self, index, detail): | ||
716 | 146 | detail_editor = self._get_detail_editor_by_index(index) | ||
717 | 147 | detail_editor.fill(field=self.objectName, index=index, detail=detail) | ||
718 | 148 | |||
719 | 149 | def _get_detail_editor_by_index(self, index): | ||
720 | 150 | object_name = self._get_contact_detail_editor_object_name(index) | ||
721 | 151 | return self.select_single( | ||
722 | 152 | ContactDetailWithTypeEditor, objectName=object_name) | ||
723 | 153 | |||
724 | 154 | def _get_contact_detail_editor_object_name(self, index): | ||
725 | 155 | return self._DETAIL_EDITORS[self.objectName].format(index) | ||
726 | 156 | |||
727 | 157 | def _add_detail(self): | ||
728 | 158 | # TODO --elopio - 2014-03-01 | ||
729 | 159 | raise NotImplementedError('Add extra details not yet implemented.') | ||
730 | 160 | |||
731 | 161 | def get_values(self, object_name): | ||
732 | 162 | """Return the values of a contact detail group.""" | ||
733 | 163 | values = [] | ||
734 | 164 | for index in range(self.detailsCount): | ||
735 | 165 | detail_editor = self._get_detail_editor_by_index(index) | ||
736 | 166 | value = detail_editor.get_values(field=object_name, index=index) | ||
737 | 167 | if (value): | ||
738 | 168 | values.append(value) | ||
739 | 169 | |||
740 | 170 | return values | ||
741 | 171 | |||
742 | 172 | |||
743 | 173 | class ContactDetailWithTypeEditor( | ||
744 | 174 | ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
745 | 175 | """Custom proxy object for the ContactDetailWithTypeEditor widget.""" | ||
746 | 176 | |||
747 | 177 | def fill(self, field, index, detail): | ||
748 | 178 | self._select_type(detail) | ||
749 | 179 | self._fill_value(field, index, detail) | ||
750 | 180 | |||
751 | 181 | def _select_type(self, detail): | ||
752 | 182 | type_index = detail.TYPES.index(detail.type) | ||
753 | 183 | selected_type_index = self._get_selected_type_index() | ||
754 | 184 | if type_index != selected_type_index: | ||
755 | 185 | # TODO --elopio - 2014-03-01 | ||
756 | 186 | raise NotImplementedError('Type selection not yet implemented.') | ||
757 | 187 | |||
758 | 188 | def _get_selected_type_index(self): | ||
759 | 189 | value_selector = self.select_single('ValueSelector') | ||
760 | 190 | return value_selector.currentIndex | ||
761 | 191 | |||
762 | 192 | def _fill_value(self, field, index, detail): | ||
763 | 193 | single_values = { | ||
764 | 194 | 'phones': 'number', | ||
765 | 195 | 'emails': 'address', | ||
766 | 196 | 'ims': 'alias' | ||
767 | 197 | } | ||
768 | 198 | if field in single_values: | ||
769 | 199 | self._fill_single_field(getattr(detail, single_values[field])) | ||
770 | 200 | elif field == 'addresses': | ||
771 | 201 | self._fill_address(index, detail) | ||
772 | 202 | elif field == 'professionalDetails': | ||
773 | 203 | self._fill_professional_details(index, detail) | ||
774 | 204 | else: | ||
775 | 205 | raise _errors.AddressBookAppError( | ||
776 | 206 | 'Unknown field: {}.'.format(field)) | ||
777 | 207 | |||
778 | 208 | def _fill_single_field(self, value): | ||
779 | 209 | text_field = self.select_single(TextInputDetail) | ||
780 | 210 | self._make_field_visible_and_write(text_field, value) | ||
781 | 211 | |||
782 | 212 | def _make_field_visible_and_write(self, text_field, value): | ||
783 | 213 | while not text_field.activeFocus: | ||
784 | 214 | # XXX We should just swipe the text field into view. | ||
785 | 215 | # Update this once bug http://pad.lv/1286479 is implemented. | ||
786 | 216 | # --elopio - 2014-03-01 | ||
787 | 217 | text_field.keyboard.press_and_release('Tab') | ||
788 | 218 | time.sleep(0.1) | ||
789 | 219 | contact_editor = self.get_root_instance().select_single( | ||
790 | 220 | ContactEditor, objectName='contactEditorPage', active=True) | ||
791 | 221 | contact_editor.wait_to_stop_moving() | ||
792 | 222 | |||
793 | 223 | text_field.write(value) | ||
794 | 224 | |||
795 | 225 | def _fill_address(self, index, address): | ||
796 | 226 | fields = collections.OrderedDict() | ||
797 | 227 | fields['street'] = address.street | ||
798 | 228 | fields['locality'] = address.locality | ||
799 | 229 | fields['region'] = address.region | ||
800 | 230 | fields['postal_code'] = address.postal_code | ||
801 | 231 | fields['country'] = address.country | ||
802 | 232 | for key, value in fields.items(): | ||
803 | 233 | text_field = _get_text_field(self, key, index) | ||
804 | 234 | self._make_field_visible_and_write(text_field, value) | ||
805 | 235 | |||
806 | 236 | def _fill_professional_details(self, index, address): | ||
807 | 237 | # TODO --elopio - 2014-03-01 | ||
808 | 238 | raise NotImplementedError('Not yet implemented.') | ||
809 | 239 | |||
810 | 240 | def get_values(self, field, index): | ||
811 | 241 | if field == 'phones': | ||
812 | 242 | return data.Phone( | ||
813 | 243 | type_=data.Phone.TYPES[self._get_selected_type_index()], | ||
814 | 244 | number=self._get_single_field_value()) | ||
815 | 245 | if field == 'emails': | ||
816 | 246 | return data.Email( | ||
817 | 247 | type_=data.Email.TYPES[self._get_selected_type_index()], | ||
818 | 248 | address=self._get_single_field_value()) | ||
819 | 249 | if field == 'ims': | ||
820 | 250 | return data.SocialAlias( | ||
821 | 251 | type_=data.SocialAlias.TYPES[self._get_selected_type_index()], | ||
822 | 252 | alias=self._get_single_field_value()) | ||
823 | 253 | if field == 'addresses': | ||
824 | 254 | return self._get_address_value(index) | ||
825 | 255 | if field == 'professionalDetails': | ||
826 | 256 | # TODO --elopio - 2014-03-01 | ||
827 | 257 | return None | ||
828 | 258 | raise _errors.AddressBookAppError('Unknown field: {}.'.format(field)) | ||
829 | 259 | |||
830 | 260 | def _get_single_field_value(self): | ||
831 | 261 | return self.select_single(TextInputDetail).text | ||
832 | 262 | |||
833 | 263 | def _get_address_value(self, index): | ||
834 | 264 | street = _get_text_field(self, 'street', index).text | ||
835 | 265 | locality = _get_text_field(self, 'locality', index).text | ||
836 | 266 | region = _get_text_field(self, 'region', index).text | ||
837 | 267 | postal_code = _get_text_field(self, 'postal_code', index).text | ||
838 | 268 | country = _get_text_field(self, 'country', index).text | ||
839 | 269 | return data.Address( | ||
840 | 270 | type_=data.Address.TYPES[self._get_selected_type_index()], | ||
841 | 271 | street=street, locality=locality, region=region, | ||
842 | 272 | postal_code=postal_code, country=country) | ||
843 | 0 | 273 | ||
844 | === renamed file 'tests/autopilot/address_book_app/emulators/contact_list_page.py' => 'tests/autopilot/address_book_app/pages/_contact_list_page.py' | |||
845 | --- tests/autopilot/address_book_app/emulators/contact_list_page.py 2014-05-22 14:40:49 +0000 | |||
846 | +++ tests/autopilot/address_book_app/pages/_contact_list_page.py 2014-05-22 14:40:49 +0000 | |||
847 | @@ -1,23 +1,33 @@ | |||
848 | 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 -*- |
849 | 2 | # | ||
850 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
851 | 4 | # | ||
852 | 5 | # This program is free software; you can redistribute it and/or modify | ||
853 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
854 | 7 | # by the Free Software Foundation. | ||
855 | 8 | # | ||
856 | 9 | # This program is distributed in the hope that it will be useful, | ||
857 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
858 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
859 | 12 | # GNU General Public License for more details. | ||
860 | 13 | # | ||
861 | 14 | # You should have received a copy of the GNU General Public License | ||
862 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
863 | 2 | 16 | ||
864 | 3 | """ ContactListPage emulator for Addressbook App tests """ | 17 | """ ContactListPage emulator for Addressbook App tests """ |
865 | 4 | 18 | ||
866 | 5 | # Copyright 2014 Canonical | ||
867 | 6 | # | ||
868 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
869 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
870 | 9 | # by the Free Software Foundation. | ||
871 | 10 | |||
872 | 11 | import logging | 19 | import logging |
873 | 20 | import time | ||
874 | 12 | 21 | ||
875 | 13 | from autopilot.introspection.dbus import StateNotFoundError | 22 | from autopilot.introspection.dbus import StateNotFoundError |
877 | 14 | from ubuntuuitoolkit import emulators as uitk | 23 | |
878 | 24 | from address_book_app.pages import _common, _contact_view | ||
879 | 25 | |||
880 | 15 | 26 | ||
881 | 16 | LOGGER = logging.getLogger(__name__) | 27 | LOGGER = logging.getLogger(__name__) |
886 | 17 | from time import sleep | 28 | |
887 | 18 | 29 | ||
888 | 19 | 30 | class ContactListPage(_common.PageWithHeader, _common.PageWithBottomEdge): | |
885 | 20 | class ContactListPage(uitk.UbuntuUIToolkitEmulatorBase): | ||
889 | 21 | """ ContactListPage emulator class """ | 31 | """ ContactListPage emulator class """ |
890 | 22 | 32 | ||
891 | 23 | def __init__(self, *args): | 33 | def __init__(self, *args): |
892 | @@ -26,6 +36,18 @@ | |||
893 | 26 | self.selected_marks = [] | 36 | self.selected_marks = [] |
894 | 27 | super(ContactListPage, self).__init__(*args) | 37 | super(ContactListPage, self).__init__(*args) |
895 | 28 | 38 | ||
896 | 39 | def open_contact(self, index): | ||
897 | 40 | """Open the page with the contact information. | ||
898 | 41 | |||
899 | 42 | :param index: The index of the contact to open. | ||
900 | 43 | :return: The page with the contact information. | ||
901 | 44 | |||
902 | 45 | """ | ||
903 | 46 | contacts = self.get_contacts() | ||
904 | 47 | self.pointing_device.click_object(contacts[index]) | ||
905 | 48 | return self.get_root_instance().select_single( | ||
906 | 49 | _contact_view.ContactView, objectName='contactViewPage') | ||
907 | 50 | |||
908 | 29 | def _get_list_view(self): | 51 | def _get_list_view(self): |
909 | 30 | return self.wait_select_single("ContactListView", | 52 | return self.wait_select_single("ContactListView", |
910 | 31 | objectName="contactListView") | 53 | objectName="contactListView") |
911 | @@ -35,7 +57,7 @@ | |||
912 | 35 | Returns a list of ContactDelegate objects and populate | 57 | Returns a list of ContactDelegate objects and populate |
913 | 36 | self.selection_marks | 58 | self.selection_marks |
914 | 37 | """ | 59 | """ |
916 | 38 | sleep(1) | 60 | time.sleep(1) |
917 | 39 | self.contacts = self.select_many("ContactDelegate") | 61 | self.contacts = self.select_many("ContactDelegate") |
918 | 40 | self.selection_marks = [] | 62 | self.selection_marks = [] |
919 | 41 | for contact in self.contacts: | 63 | for contact in self.contacts: |
920 | @@ -52,7 +74,7 @@ | |||
921 | 52 | self.selected_marks.append(self.selection_marks[idx]) | 74 | self.selected_marks.append(self.selection_marks[idx]) |
922 | 53 | self.pointing_device.move_to_object(self.contacts[idx]) | 75 | self.pointing_device.move_to_object(self.contacts[idx]) |
923 | 54 | self.pointing_device.press() | 76 | self.pointing_device.press() |
925 | 55 | sleep(2.0) | 77 | time.sleep(2.0) |
926 | 56 | self.pointing_device.release() | 78 | self.pointing_device.release() |
927 | 57 | view.isInSelectionMode.wait_for(True) | 79 | view.isInSelectionMode.wait_for(True) |
928 | 58 | else: | 80 | else: |
929 | @@ -110,4 +132,3 @@ | |||
930 | 110 | dialog = main_window.wait_select_single("RemoveContactsDialog", | 132 | dialog = main_window.wait_select_single("RemoveContactsDialog", |
931 | 111 | objectName="removeContactsDialog") | 133 | objectName="removeContactsDialog") |
932 | 112 | self.click_button(main_window, "removeContactsDialog.Yes") | 134 | self.click_button(main_window, "removeContactsDialog.Yes") |
933 | 113 | |||
934 | 114 | 135 | ||
935 | === added file 'tests/autopilot/address_book_app/pages/_contact_view.py' | |||
936 | --- tests/autopilot/address_book_app/pages/_contact_view.py 1970-01-01 00:00:00 +0000 | |||
937 | +++ tests/autopilot/address_book_app/pages/_contact_view.py 2014-05-22 14:40:49 +0000 | |||
938 | @@ -0,0 +1,28 @@ | |||
939 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
940 | 2 | # | ||
941 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
942 | 4 | # | ||
943 | 5 | # This program is free software; you can redistribute it and/or modify | ||
944 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
945 | 7 | # by the Free Software Foundation. | ||
946 | 8 | # | ||
947 | 9 | # This program is distributed in the hope that it will be useful, | ||
948 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
949 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
950 | 12 | # GNU General Public License for more details. | ||
951 | 13 | # | ||
952 | 14 | # You should have received a copy of the GNU General Public License | ||
953 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
954 | 16 | |||
955 | 17 | from address_book_app.pages import _common, _contact_editor | ||
956 | 18 | |||
957 | 19 | |||
958 | 20 | class ContactView(_common.PageWithHeader): | ||
959 | 21 | """Autopilot helper for the ContactView page.""" | ||
960 | 22 | |||
961 | 23 | def go_to_edit_contact(self): | ||
962 | 24 | self.get_header().click_action_button('edit') | ||
963 | 25 | return self.get_root_instance().select_single( | ||
964 | 26 | _contact_editor.ContactEditor, | ||
965 | 27 | objectName='contactEditorPage', | ||
966 | 28 | active=True) | ||
967 | 0 | 29 | ||
968 | === modified file 'tests/autopilot/address_book_app/tests/__init__.py' | |||
969 | --- tests/autopilot/address_book_app/tests/__init__.py 2014-05-22 14:40:49 +0000 | |||
970 | +++ tests/autopilot/address_book_app/tests/__init__.py 2014-05-22 14:40:49 +0000 | |||
971 | @@ -16,7 +16,8 @@ | |||
972 | 16 | from autopilot.platform import model | 16 | from autopilot.platform import model |
973 | 17 | from testtools.matchers import Equals | 17 | from testtools.matchers import Equals |
974 | 18 | 18 | ||
976 | 19 | from address_book_app.emulators.main_window import MainWindow | 19 | import address_book_app |
977 | 20 | from address_book_app import MainWindow | ||
978 | 20 | from ubuntuuitoolkit import emulators as toolkit_emulators | 21 | from ubuntuuitoolkit import emulators as toolkit_emulators |
979 | 21 | 22 | ||
980 | 22 | 23 | ||
981 | @@ -71,6 +72,7 @@ | |||
982 | 71 | AddressBookAppTestCase.ARGS = [] | 72 | AddressBookAppTestCase.ARGS = [] |
983 | 72 | AddressBookAppTestCase.PRELOAD_VCARD = False | 73 | AddressBookAppTestCase.PRELOAD_VCARD = False |
984 | 73 | self.main_window.visible.wait_for(True) | 74 | self.main_window.visible.wait_for(True) |
985 | 75 | self.app = address_book_app.AddressBookApp(self.app_proxy) | ||
986 | 74 | 76 | ||
987 | 75 | def tearDown(self): | 77 | def tearDown(self): |
988 | 76 | super(AddressBookAppTestCase, self).tearDown() | 78 | super(AddressBookAppTestCase, self).tearDown() |
989 | @@ -80,7 +82,7 @@ | |||
990 | 80 | subprocess.check_call(["/sbin/initctl", "start", "maliit-server"]) | 82 | subprocess.check_call(["/sbin/initctl", "start", "maliit-server"]) |
991 | 81 | 83 | ||
992 | 82 | def launch_test_local(self): | 84 | def launch_test_local(self): |
994 | 83 | self.app = self.launch_test_application( | 85 | self.app_proxy = self.launch_test_application( |
995 | 84 | self.app_bin, | 86 | self.app_bin, |
996 | 85 | *AddressBookAppTestCase.ARGS, | 87 | *AddressBookAppTestCase.ARGS, |
997 | 86 | app_type='qt', | 88 | app_type='qt', |
998 | @@ -89,19 +91,19 @@ | |||
999 | 89 | def launch_test_installed(self): | 91 | def launch_test_installed(self): |
1000 | 90 | df = "/usr/share/applications/address-book-app.desktop" | 92 | df = "/usr/share/applications/address-book-app.desktop" |
1001 | 91 | self.ARGS.append("--desktop_file_hint=" + df) | 93 | self.ARGS.append("--desktop_file_hint=" + df) |
1003 | 92 | self.app = self.launch_test_application( | 94 | self.app_proxy = self.launch_test_application( |
1004 | 93 | "address-book-app", | 95 | "address-book-app", |
1005 | 94 | *AddressBookAppTestCase.ARGS, | 96 | *AddressBookAppTestCase.ARGS, |
1006 | 95 | app_type='qt', | 97 | app_type='qt', |
1007 | 96 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | 98 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
1008 | 97 | 99 | ||
1009 | 98 | def launch_click_installed(self): | 100 | def launch_click_installed(self): |
1011 | 99 | self.app = self.launch_click_package( | 101 | self.app_proxy = self.launch_click_package( |
1012 | 100 | "com.ubuntu.address-book") | 102 | "com.ubuntu.address-book") |
1013 | 101 | 103 | ||
1014 | 102 | @property | 104 | @property |
1015 | 103 | def main_window(self): | 105 | def main_window(self): |
1017 | 104 | return self.app.select_single(MainWindow) | 106 | return self.app_proxy.select_single(MainWindow) |
1018 | 105 | 107 | ||
1019 | 106 | def select_a_value(self, field, value_selector, value): | 108 | def select_a_value(self, field, value_selector, value): |
1020 | 107 | # Make sure the field has focus | 109 | # Make sure the field has focus |
1021 | 108 | 110 | ||
1022 | === modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py' | |||
1023 | --- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-05-22 14:40:49 +0000 | |||
1024 | +++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-05-22 14:40:49 +0000 | |||
1025 | @@ -11,9 +11,9 @@ | |||
1026 | 11 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
1027 | 12 | from autopilot.introspection import dbus | 12 | from autopilot.introspection import dbus |
1028 | 13 | 13 | ||
1029 | 14 | import address_book_app | ||
1030 | 14 | from address_book_app import data | 15 | from address_book_app import data |
1031 | 15 | from address_book_app.tests import AddressBookAppTestCase | 16 | from address_book_app.tests import AddressBookAppTestCase |
1032 | 16 | from address_book_app.emulators import main_window | ||
1033 | 17 | 17 | ||
1034 | 18 | 18 | ||
1035 | 19 | class TestAddContact(AddressBookAppTestCase): | 19 | class TestAddContact(AddressBookAppTestCase): |
1036 | @@ -22,37 +22,39 @@ | |||
1037 | 22 | def test_go_to_add_contact(self): | 22 | def test_go_to_add_contact(self): |
1038 | 23 | """Test to launch the add contact screen using emulator method""" | 23 | """Test to launch the add contact screen using emulator method""" |
1039 | 24 | self.assertRaises( | 24 | self.assertRaises( |
1042 | 25 | dbus.StateNotFoundError, self.main_window.get_contact_edit_page) | 25 | dbus.StateNotFoundError, |
1043 | 26 | contact_editor = self.main_window.go_to_add_contact() | 26 | self.app.main_window.get_contact_edit_page) |
1044 | 27 | contact_editor = self.app.main_window.go_to_add_contact() | ||
1045 | 27 | self.assertTrue(contact_editor.visible) | 28 | self.assertTrue(contact_editor.visible) |
1047 | 28 | self.assertIsInstance(contact_editor, main_window.ContactEditor) | 29 | self.assertIsInstance( |
1048 | 30 | contact_editor, address_book_app.pages.ContactEditor) | ||
1049 | 29 | 31 | ||
1050 | 30 | def test_add_and_cancel_contact(self): | 32 | def test_add_and_cancel_contact(self): |
1052 | 31 | list_page = self.main_window.get_contact_list_page() | 33 | list_page = self.app.main_window.get_contact_list_page() |
1053 | 32 | 34 | ||
1054 | 33 | # execute add new contact | 35 | # execute add new contact |
1056 | 34 | contact_editor = self.main_window.go_to_add_contact() | 36 | contact_editor = self.app.main_window.go_to_add_contact() |
1057 | 35 | 37 | ||
1058 | 36 | # Check if the contact list disapear and contact editor appears | 38 | # Check if the contact list disapear and contact editor appears |
1059 | 37 | self.assertThat(list_page.visible, Eventually(Equals(False))) | 39 | self.assertThat(list_page.visible, Eventually(Equals(False))) |
1060 | 38 | self.assertThat(contact_editor.visible, Eventually(Equals(True))) | 40 | self.assertThat(contact_editor.visible, Eventually(Equals(True))) |
1061 | 39 | 41 | ||
1062 | 40 | # cancel new contact without save | 42 | # cancel new contact without save |
1064 | 41 | self.main_window.cancel() | 43 | self.app.main_window.cancel() |
1065 | 42 | 44 | ||
1066 | 43 | # Check if the contact list is visible again | 45 | # Check if the contact list is visible again |
1067 | 44 | self.assertThat(list_page.visible, Eventually(Equals(True))) | 46 | self.assertThat(list_page.visible, Eventually(Equals(True))) |
1068 | 45 | 47 | ||
1069 | 46 | # Check if the contact list still empty | 48 | # Check if the contact list still empty |
1071 | 47 | list_view = self.main_window.get_contact_list_view() | 49 | list_view = self.app.main_window.get_contact_list_view() |
1072 | 48 | self.assertThat(list_view.count, Eventually(Equals(0))) | 50 | self.assertThat(list_view.count, Eventually(Equals(0))) |
1073 | 49 | 51 | ||
1074 | 50 | def test_add_contact_without_name(self): | 52 | def test_add_contact_without_name(self): |
1075 | 51 | # execute add new contact | 53 | # execute add new contact |
1077 | 52 | contact_editor = self.main_window.go_to_add_contact() | 54 | contact_editor = self.app.main_window.go_to_add_contact() |
1078 | 53 | 55 | ||
1079 | 54 | # Try to save a empty contact | 56 | # Try to save a empty contact |
1081 | 55 | acceptButton = self.main_window.get_button("save") | 57 | acceptButton = self.app.main_window.get_button("save") |
1082 | 56 | 58 | ||
1083 | 57 | # Save button must be disabled | 59 | # Save button must be disabled |
1084 | 58 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) | 60 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) |
1085 | @@ -82,59 +84,59 @@ | |||
1086 | 82 | self.pointing_device.click_object(acceptButton) | 84 | self.pointing_device.click_object(acceptButton) |
1087 | 83 | 85 | ||
1088 | 84 | # Check if the contact editor still visbile | 86 | # Check if the contact editor still visbile |
1090 | 85 | list_page = self.main_window.get_contact_list_page() | 87 | list_page = self.app.main_window.get_contact_list_page() |
1091 | 86 | 88 | ||
1092 | 87 | self.assertThat(list_page.visible, Eventually(Equals(False))) | 89 | self.assertThat(list_page.visible, Eventually(Equals(False))) |
1093 | 88 | self.assertThat(contact_editor.visible, Eventually(Equals(True))) | 90 | self.assertThat(contact_editor.visible, Eventually(Equals(True))) |
1094 | 89 | 91 | ||
1095 | 90 | # Check if the contact list still empty | 92 | # Check if the contact list still empty |
1097 | 91 | list_view = self.main_window.get_contact_list_view() | 93 | list_view = self.app.main_window.get_contact_list_view() |
1098 | 92 | self.assertThat(list_view.count, Eventually(Equals(0))) | 94 | self.assertThat(list_view.count, Eventually(Equals(0))) |
1099 | 93 | 95 | ||
1100 | 94 | def test_add_contact_with_full_name(self): | 96 | def test_add_contact_with_full_name(self): |
1101 | 95 | test_contact = data.Contact(first_name='Fulano', last_name='de Tal') | 97 | test_contact = data.Contact(first_name='Fulano', last_name='de Tal') |
1102 | 96 | 98 | ||
1103 | 97 | # execute add new contact | 99 | # execute add new contact |
1105 | 98 | contact_editor = self.main_window.go_to_add_contact() | 100 | contact_editor = self.app.main_window.go_to_add_contact() |
1106 | 99 | contact_editor.fill_form(test_contact) | 101 | contact_editor.fill_form(test_contact) |
1107 | 100 | 102 | ||
1108 | 101 | # Save contact | 103 | # Save contact |
1110 | 102 | self.main_window.save() | 104 | self.app.main_window.save() |
1111 | 103 | 105 | ||
1112 | 104 | # Check if the contact list is visible again | 106 | # Check if the contact list is visible again |
1114 | 105 | list_page = self.main_window.get_contact_list_page() | 107 | list_page = self.app.main_window.get_contact_list_page() |
1115 | 106 | self.assertThat(list_page.visible, Eventually(Equals(True))) | 108 | self.assertThat(list_page.visible, Eventually(Equals(True))) |
1116 | 107 | 109 | ||
1117 | 108 | # Check if contact was added | 110 | # Check if contact was added |
1119 | 109 | list_view = self.main_window.get_contact_list_view() | 111 | list_view = self.app.main_window.get_contact_list_view() |
1120 | 110 | self.assertThat(list_view.count, Eventually(Equals(1))) | 112 | self.assertThat(list_view.count, Eventually(Equals(1))) |
1121 | 111 | 113 | ||
1122 | 112 | def test_add_contact_with_first_name(self): | 114 | def test_add_contact_with_first_name(self): |
1123 | 113 | test_contact = data.Contact(first_name='Fulano') | 115 | test_contact = data.Contact(first_name='Fulano') |
1124 | 114 | 116 | ||
1125 | 115 | # execute add new contact | 117 | # execute add new contact |
1127 | 116 | contact_editor = self.main_window.go_to_add_contact() | 118 | contact_editor = self.app.main_window.go_to_add_contact() |
1128 | 117 | contact_editor.fill_form(test_contact) | 119 | contact_editor.fill_form(test_contact) |
1129 | 118 | 120 | ||
1130 | 119 | # Save contact | 121 | # Save contact |
1132 | 120 | self.main_window.save() | 122 | self.app.main_window.save() |
1133 | 121 | 123 | ||
1134 | 122 | # Check if contact was added | 124 | # Check if contact was added |
1136 | 123 | list_view = self.main_window.get_contact_list_view() | 125 | list_view = self.app.main_window.get_contact_list_view() |
1137 | 124 | self.assertThat(list_view.count, Eventually(Equals(1))) | 126 | self.assertThat(list_view.count, Eventually(Equals(1))) |
1138 | 125 | 127 | ||
1139 | 126 | def test_add_contact_with_last_name(self): | 128 | def test_add_contact_with_last_name(self): |
1140 | 127 | test_contact = data.Contact(last_name='de Tal') | 129 | test_contact = data.Contact(last_name='de Tal') |
1141 | 128 | 130 | ||
1142 | 129 | # execute add new contact | 131 | # execute add new contact |
1144 | 130 | contact_editor = self.main_window.go_to_add_contact() | 132 | contact_editor = self.app.main_window.go_to_add_contact() |
1145 | 131 | contact_editor.fill_form(test_contact) | 133 | contact_editor.fill_form(test_contact) |
1146 | 132 | 134 | ||
1147 | 133 | # Save contact | 135 | # Save contact |
1149 | 134 | self.main_window.save() | 136 | self.app.main_window.save() |
1150 | 135 | 137 | ||
1151 | 136 | # Check if contact was added | 138 | # Check if contact was added |
1153 | 137 | list_view = self.main_window.get_contact_list_view() | 139 | list_view = self.app.main_window.get_contact_list_view() |
1154 | 138 | self.assertThat(list_view.count, Eventually(Equals(1))) | 140 | self.assertThat(list_view.count, Eventually(Equals(1))) |
1155 | 139 | 141 | ||
1156 | 140 | def test_add_contact_with_name_and_phone(self): | 142 | def test_add_contact_with_name_and_phone(self): |
1157 | @@ -143,14 +145,14 @@ | |||
1158 | 143 | phones=[data.Phone.make()]) | 145 | phones=[data.Phone.make()]) |
1159 | 144 | 146 | ||
1160 | 145 | # execute add new contact | 147 | # execute add new contact |
1162 | 146 | contact_editor = self.main_window.go_to_add_contact() | 148 | contact_editor = self.app.main_window.go_to_add_contact() |
1163 | 147 | contact_editor.fill_form(test_contact) | 149 | contact_editor.fill_form(test_contact) |
1164 | 148 | 150 | ||
1165 | 149 | # Save contact | 151 | # Save contact |
1167 | 150 | self.main_window.save() | 152 | self.app.main_window.save() |
1168 | 151 | 153 | ||
1169 | 152 | # Check if contact was added | 154 | # Check if contact was added |
1171 | 153 | list_view = self.main_window.get_contact_list_view() | 155 | list_view = self.app.main_window.get_contact_list_view() |
1172 | 154 | self.assertThat(list_view.count, Eventually(Equals(1))) | 156 | self.assertThat(list_view.count, Eventually(Equals(1))) |
1173 | 155 | 157 | ||
1174 | 156 | def test_add_full_contact(self): | 158 | def test_add_full_contact(self): |
1175 | @@ -160,19 +162,19 @@ | |||
1176 | 160 | test_contact.professional_details = [] | 162 | test_contact.professional_details = [] |
1177 | 161 | 163 | ||
1178 | 162 | # execute add new contact | 164 | # execute add new contact |
1180 | 163 | contact_editor = self.main_window.go_to_add_contact() | 165 | contact_editor = self.app.main_window.go_to_add_contact() |
1181 | 164 | contact_editor.fill_form(test_contact) | 166 | contact_editor.fill_form(test_contact) |
1182 | 165 | 167 | ||
1183 | 166 | # Save contact | 168 | # Save contact |
1185 | 167 | self.main_window.save() | 169 | self.app.main_window.save() |
1186 | 168 | 170 | ||
1187 | 169 | # Check if contact was added | 171 | # Check if contact was added |
1189 | 170 | list_view = self.main_window.get_contact_list_view() | 172 | list_view = self.app.main_window.get_contact_list_view() |
1190 | 171 | self.assertThat(list_view.count, Eventually(Equals(1))) | 173 | self.assertThat(list_view.count, Eventually(Equals(1))) |
1191 | 172 | 174 | ||
1192 | 173 | def test_email_label_save(self): | 175 | def test_email_label_save(self): |
1193 | 174 | # execute add new contact | 176 | # execute add new contact |
1195 | 175 | contact_editor = self.main_window.go_to_add_contact() | 177 | contact_editor = self.app.main_window.go_to_add_contact() |
1196 | 176 | 178 | ||
1197 | 177 | # fill name | 179 | # fill name |
1198 | 178 | contact_editor.fill_form( | 180 | contact_editor.fill_form( |
1199 | @@ -186,13 +188,13 @@ | |||
1200 | 186 | self.set_email_address(2, "other@email.com", 2) | 188 | self.set_email_address(2, "other@email.com", 2) |
1201 | 187 | 189 | ||
1202 | 188 | # Save contact | 190 | # Save contact |
1204 | 189 | self.main_window.save() | 191 | self.app.main_window.save() |
1205 | 190 | 192 | ||
1207 | 191 | contacts = self.main_window.select_many("ContactDelegate") | 193 | contacts = self.app.main_window.select_many("ContactDelegate") |
1208 | 192 | self.pointing_device.click_object(contacts[0]) | 194 | self.pointing_device.click_object(contacts[0]) |
1209 | 193 | 195 | ||
1210 | 194 | # check if contacts was saved with the correct labels | 196 | # check if contacts was saved with the correct labels |
1212 | 195 | view_page = self.main_window.get_contact_view_page() | 197 | view_page = self.app.main_window.get_contact_view_page() |
1213 | 196 | self.assertThat(view_page.visible, Eventually(Equals(True))) | 198 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
1214 | 197 | 199 | ||
1215 | 198 | # check if we have 3 emails""" | 200 | # check if we have 3 emails""" |
1216 | @@ -222,7 +224,7 @@ | |||
1217 | 222 | 224 | ||
1218 | 223 | def test_phone_label_save(self): | 225 | def test_phone_label_save(self): |
1219 | 224 | # execute add new contact | 226 | # execute add new contact |
1221 | 225 | contact_editor = self.main_window.go_to_add_contact() | 227 | contact_editor = self.app.main_window.go_to_add_contact() |
1222 | 226 | 228 | ||
1223 | 227 | # fill name | 229 | # fill name |
1224 | 228 | contact_editor.fill_form( | 230 | contact_editor.fill_form( |
1225 | @@ -240,13 +242,13 @@ | |||
1226 | 240 | self.set_phone_number(4, "(000) 000-0004", 4) | 242 | self.set_phone_number(4, "(000) 000-0004", 4) |
1227 | 241 | 243 | ||
1228 | 242 | # Save contact | 244 | # Save contact |
1230 | 243 | self.main_window.save() | 245 | self.app.main_window.save() |
1231 | 244 | 246 | ||
1233 | 245 | contacts = self.main_window.select_many("ContactDelegate") | 247 | contacts = self.app.main_window.select_many("ContactDelegate") |
1234 | 246 | self.pointing_device.click_object(contacts[0]) | 248 | self.pointing_device.click_object(contacts[0]) |
1235 | 247 | 249 | ||
1236 | 248 | # check if contacts was saved with the correct labels | 250 | # check if contacts was saved with the correct labels |
1238 | 249 | view_page = self.main_window.get_contact_view_page() | 251 | view_page = self.app.main_window.get_contact_view_page() |
1239 | 250 | self.assertThat(view_page.visible, Eventually(Equals(True))) | 252 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
1240 | 251 | 253 | ||
1241 | 252 | # check if we have five phones""" | 254 | # check if we have five phones""" |
1242 | 253 | 255 | ||
1243 | === modified file 'tests/autopilot/address_book_app/tests/test_contactlist.py' | |||
1244 | --- tests/autopilot/address_book_app/tests/test_contactlist.py 2014-03-12 20:35:16 +0000 | |||
1245 | +++ tests/autopilot/address_book_app/tests/test_contactlist.py 2014-05-22 14:40:49 +0000 | |||
1246 | @@ -17,6 +17,6 @@ | |||
1247 | 17 | """Tests the contact list features""" | 17 | """Tests the contact list features""" |
1248 | 18 | 18 | ||
1249 | 19 | def test_contact_list(self): | 19 | def test_contact_list(self): |
1251 | 20 | contact_list = self.main_window.get_contact_list_page() | 20 | contact_list = self.app.main_window.get_contact_list_page() |
1252 | 21 | self.assertThat(contact_list.visible, Eventually(Equals(True))) | 21 | self.assertThat(contact_list.visible, Eventually(Equals(True))) |
1253 | 22 | pass | 22 | pass |
1254 | 23 | 23 | ||
1255 | === modified file 'tests/autopilot/address_book_app/tests/test_create_new_from_uri.py' | |||
1256 | --- tests/autopilot/address_book_app/tests/test_create_new_from_uri.py 2014-05-22 14:40:49 +0000 | |||
1257 | +++ tests/autopilot/address_book_app/tests/test_create_new_from_uri.py 2014-05-22 14:40:49 +0000 | |||
1258 | @@ -23,17 +23,17 @@ | |||
1259 | 23 | super(TestCreateNewContactFromURI, self).setUp() | 23 | super(TestCreateNewContactFromURI, self).setUp() |
1260 | 24 | 24 | ||
1261 | 25 | def test_save_new_contact(self): | 25 | def test_save_new_contact(self): |
1263 | 26 | list_page = self.main_window.get_contact_list_page() | 26 | list_page = self.app.main_window.get_contact_list_page() |
1264 | 27 | list_page.isReady.wait_for(True) | 27 | list_page.isReady.wait_for(True) |
1267 | 28 | 28 | ||
1268 | 29 | edit_page = self.main_window.get_contact_edit_page() | 29 | edit_page = self.app.main_window.get_contact_edit_page() |
1269 | 30 | self.assertThat(edit_page.visible, Eventually(Equals(True))) | 30 | self.assertThat(edit_page.visible, Eventually(Equals(True))) |
1270 | 31 | 31 | ||
1271 | 32 | # add name to the contact | 32 | # add name to the contact |
1273 | 33 | firstNameField = self.main_window.wait_select_single( | 33 | firstNameField = self.app.main_window.wait_select_single( |
1274 | 34 | "TextInputDetail", | 34 | "TextInputDetail", |
1275 | 35 | objectName="firstName") | 35 | objectName="firstName") |
1277 | 36 | lastNameField = self.main_window.wait_select_single( | 36 | lastNameField = self.app.main_window.wait_select_single( |
1278 | 37 | "TextInputDetail", | 37 | "TextInputDetail", |
1279 | 38 | objectName="lastName") | 38 | objectName="lastName") |
1280 | 39 | 39 | ||
1281 | @@ -41,14 +41,14 @@ | |||
1282 | 41 | self.type_on_field(lastNameField, "de Tal") | 41 | self.type_on_field(lastNameField, "de Tal") |
1283 | 42 | 42 | ||
1284 | 43 | # save the contact | 43 | # save the contact |
1286 | 44 | acceptButton = self.main_window.save() | 44 | self.app.main_window.save() |
1287 | 45 | 45 | ||
1288 | 46 | # open contact view | 46 | # open contact view |
1290 | 47 | contacts = self.main_window.select_many("ContactDelegate") | 47 | contacts = self.app.main_window.select_many("ContactDelegate") |
1291 | 48 | self.pointing_device.click_object(contacts[0]) | 48 | self.pointing_device.click_object(contacts[0]) |
1293 | 49 | view_page = self.main_window.get_contact_view_page() | 49 | view_page = self.app.main_window.get_contact_view_page() |
1294 | 50 | self.assertThat(view_page.visible, Eventually(Equals(True))) | 50 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
1296 | 51 | 51 | ||
1297 | 52 | 52 | ||
1298 | 53 | # check if we have the new phone""" | 53 | # check if we have the new phone""" |
1299 | 54 | phone_group = view_page.select_single( | 54 | phone_group = view_page.select_single( |
1300 | 55 | 55 | ||
1301 | === renamed file 'tests/autopilot/address_book_app/tests/test_emulators.py' => 'tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py' | |||
1302 | --- tests/autopilot/address_book_app/tests/test_emulators.py 2014-03-01 11:03:45 +0000 | |||
1303 | +++ tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py 2014-05-22 14:40:49 +0000 | |||
1304 | @@ -17,8 +17,6 @@ | |||
1305 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1306 | 18 | 18 | ||
1307 | 19 | from address_book_app import data, tests | 19 | from address_book_app import data, tests |
1308 | 20 | from address_book_app.emulators import main_window | ||
1309 | 21 | |||
1310 | 22 | 20 | ||
1311 | 23 | class ContactEditorTestCase(tests.AddressBookAppTestCase): | 21 | class ContactEditorTestCase(tests.AddressBookAppTestCase): |
1312 | 24 | 22 | ||
1313 | @@ -29,7 +27,7 @@ | |||
1314 | 29 | # --elopio - 2014-03-01 | 27 | # --elopio - 2014-03-01 |
1315 | 30 | test_contact.professional_details = [] | 28 | test_contact.professional_details = [] |
1316 | 31 | 29 | ||
1318 | 32 | contact_editor = self.main_window.go_to_add_contact() | 30 | contact_editor = self.app.main_window.go_to_add_contact() |
1319 | 33 | 31 | ||
1320 | 34 | contact_editor.fill_form(test_contact) | 32 | contact_editor.fill_form(test_contact) |
1321 | 35 | 33 | ||
1322 | 36 | 34 | ||
1323 | === modified file 'tests/autopilot/address_book_app/tests/test_delete_contact.py' | |||
1324 | --- tests/autopilot/address_book_app/tests/test_delete_contact.py 2014-05-22 14:40:49 +0000 | |||
1325 | +++ tests/autopilot/address_book_app/tests/test_delete_contact.py 2014-05-22 14:40:49 +0000 | |||
1326 | @@ -35,7 +35,7 @@ | |||
1327 | 35 | def setUp(self): | 35 | def setUp(self): |
1328 | 36 | AddressBookAppTestCase.PRELOAD_VCARD = True | 36 | AddressBookAppTestCase.PRELOAD_VCARD = True |
1329 | 37 | super(TestDeleteSelectContact, self).setUp() | 37 | super(TestDeleteSelectContact, self).setUp() |
1331 | 38 | 38 | ||
1332 | 39 | def test_select(self): | 39 | def test_select(self): |
1333 | 40 | """ | 40 | """ |
1334 | 41 | Delete a contact in pick mode | 41 | Delete a contact in pick mode |
1335 | @@ -45,15 +45,15 @@ | |||
1336 | 45 | contact in the list before and after the action. | 45 | contact in the list before and after the action. |
1337 | 46 | Note that it doesn't check which contact has been deleted. | 46 | Note that it doesn't check which contact has been deleted. |
1338 | 47 | """ | 47 | """ |
1340 | 48 | listpage = self.main_window.get_contact_list_page() | 48 | listpage = self.app.main_window.get_contact_list_page() |
1341 | 49 | contacts_before = listpage.get_contacts() | 49 | contacts_before = listpage.get_contacts() |
1342 | 50 | 50 | ||
1343 | 51 | listpage.select_contacts_by_index(self.select) | 51 | listpage.select_contacts_by_index(self.select) |
1344 | 52 | deleted = [] | 52 | deleted = [] |
1345 | 53 | if self.action == "cancel": | 53 | if self.action == "cancel": |
1347 | 54 | self.main_window.cancel() | 54 | self.app.main_window.cancel() |
1348 | 55 | elif self.action == "delete": | 55 | elif self.action == "delete": |
1350 | 56 | listpage.delete(self.main_window) | 56 | listpage.delete(self.app.main_window) |
1351 | 57 | deleted = self.select | 57 | deleted = self.select |
1352 | 58 | 58 | ||
1353 | 59 | contacts_after = listpage.get_contacts() | 59 | contacts_after = listpage.get_contacts() |
1354 | 60 | 60 | ||
1355 | === modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py' | |||
1356 | --- tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-05-22 14:40:49 +0000 | |||
1357 | +++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-05-22 14:40:49 +0000 | |||
1358 | @@ -10,6 +10,7 @@ | |||
1359 | 10 | from testtools.matchers import Equals | 10 | from testtools.matchers import Equals |
1360 | 11 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
1361 | 12 | 12 | ||
1362 | 13 | from address_book_app import data | ||
1363 | 13 | from address_book_app.tests import AddressBookAppTestCase | 14 | from address_book_app.tests import AddressBookAppTestCase |
1364 | 14 | 15 | ||
1365 | 15 | 16 | ||
1366 | @@ -17,6 +18,21 @@ | |||
1367 | 17 | """Tests edit a contact""" | 18 | """Tests edit a contact""" |
1368 | 18 | PHONE_NUMBERS = ['(333) 123-4567', '(333) 123-4568', '(222) 222-2222'] | 19 | PHONE_NUMBERS = ['(333) 123-4567', '(333) 123-4568', '(222) 222-2222'] |
1369 | 19 | 20 | ||
1370 | 21 | PHONE_NUMBERS = ['(333) 123-4567', '(333) 123-4568', '(222) 222-2222'] | ||
1371 | 22 | |||
1372 | 23 | def add_test_contact(self): | ||
1373 | 24 | test_contact = data.Contact('test', 'test') | ||
1374 | 25 | # TODO implement the filling of professional details. | ||
1375 | 26 | # --elopio - 2014-03-01 | ||
1376 | 27 | test_contact.professional_details = [] | ||
1377 | 28 | |||
1378 | 29 | # execute add new contact | ||
1379 | 30 | contact_editor = self.main_window.go_to_add_contact() | ||
1380 | 31 | contact_editor.fill_form(test_contact) | ||
1381 | 32 | |||
1382 | 33 | # Save contact | ||
1383 | 34 | self.main_window.save() | ||
1384 | 35 | |||
1385 | 20 | def test_add_new_phone(self): | 36 | def test_add_new_phone(self): |
1386 | 21 | self.add_contact("Fulano", "de Tal", [self.PHONE_NUMBERS[0]]) | 37 | self.add_contact("Fulano", "de Tal", [self.PHONE_NUMBERS[0]]) |
1387 | 22 | edit_page = self.edit_contact(0) | 38 | edit_page = self.edit_contact(0) |
1388 | @@ -28,15 +44,15 @@ | |||
1389 | 28 | self.create_new_detail(phoneGroup) | 44 | self.create_new_detail(phoneGroup) |
1390 | 29 | 45 | ||
1391 | 30 | # fill phone number | 46 | # fill phone number |
1393 | 31 | phone_number_1 = self.main_window.select_single( | 47 | phone_number_1 = self.app.main_window.select_single( |
1394 | 32 | "TextInputDetail", | 48 | "TextInputDetail", |
1395 | 33 | objectName="phoneNumber_1") | 49 | objectName="phoneNumber_1") |
1396 | 34 | self.type_on_field(phone_number_1, self.PHONE_NUMBERS[1]) | 50 | self.type_on_field(phone_number_1, self.PHONE_NUMBERS[1]) |
1397 | 35 | 51 | ||
1399 | 36 | self.main_window.save() | 52 | self.app.main_window.save() |
1400 | 37 | 53 | ||
1401 | 38 | # go back to view page | 54 | # go back to view page |
1403 | 39 | view_page = self.main_window.get_contact_view_page() | 55 | view_page = self.app.main_window.get_contact_view_page() |
1404 | 40 | self.assertThat(view_page.visible, Eventually(Equals(True))) | 56 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
1405 | 41 | 57 | ||
1406 | 42 | # check if we have two phones""" | 58 | # check if we have two phones""" |
1407 | @@ -62,10 +78,10 @@ | |||
1408 | 62 | self.clear_text_on_field(phone_number_1) | 78 | self.clear_text_on_field(phone_number_1) |
1409 | 63 | 79 | ||
1410 | 64 | # Save contact | 80 | # Save contact |
1412 | 65 | self.main_window.save() | 81 | self.app.main_window.save() |
1413 | 66 | 82 | ||
1414 | 67 | # check if we have onlye one phone | 83 | # check if we have onlye one phone |
1416 | 68 | view_page = self.main_window.get_contact_view_page() | 84 | view_page = self.app.main_window.get_contact_view_page() |
1417 | 69 | phone_group = view_page.select_single( | 85 | phone_group = view_page.select_single( |
1418 | 70 | "ContactDetailGroupWithTypeView", | 86 | "ContactDetailGroupWithTypeView", |
1419 | 71 | objectName="phones") | 87 | objectName="phones") |
1420 | @@ -92,10 +108,10 @@ | |||
1421 | 92 | objectName="emailAddress_0") | 108 | objectName="emailAddress_0") |
1422 | 93 | self.type_on_field(email_field, "fulano@internet.com.br") | 109 | self.type_on_field(email_field, "fulano@internet.com.br") |
1423 | 94 | 110 | ||
1425 | 95 | self.main_window.save() | 111 | self.app.main_window.save() |
1426 | 96 | 112 | ||
1427 | 97 | # go back to view page | 113 | # go back to view page |
1429 | 98 | view_page = self.main_window.get_contact_view_page() | 114 | view_page = self.app.main_window.get_contact_view_page() |
1430 | 99 | self.assertThat(view_page.visible, Eventually(Equals(True))) | 115 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
1431 | 100 | 116 | ||
1432 | 101 | # check if we have a new email | 117 | # check if we have a new email |
1433 | @@ -122,10 +138,10 @@ | |||
1434 | 122 | self.clear_text_on_field(email_address_0) | 138 | self.clear_text_on_field(email_address_0) |
1435 | 123 | 139 | ||
1436 | 124 | # Save contact | 140 | # Save contact |
1438 | 125 | self.main_window.save() | 141 | self.app.main_window.save() |
1439 | 126 | 142 | ||
1440 | 127 | # check if the email list is empty | 143 | # check if the email list is empty |
1442 | 128 | view_page = self.main_window.get_contact_view_page() | 144 | view_page = self.app.main_window.get_contact_view_page() |
1443 | 129 | emails_group = view_page.select_single( | 145 | emails_group = view_page.select_single( |
1444 | 130 | "ContactDetailGroupWithTypeView", | 146 | "ContactDetailGroupWithTypeView", |
1445 | 131 | objectName="emails") | 147 | objectName="emails") |
1446 | @@ -147,15 +163,15 @@ | |||
1447 | 147 | self.clear_text_on_field(last_name_field) | 163 | self.clear_text_on_field(last_name_field) |
1448 | 148 | 164 | ||
1449 | 149 | # check if is possible to save a contact without name | 165 | # check if is possible to save a contact without name |
1452 | 150 | self.main_window.save() | 166 | self.app.main_window.save() |
1453 | 151 | accept_button = self.main_window.get_button("save") | 167 | accept_button = self.app.main_window.get_button("save") |
1454 | 152 | self.assertThat(accept_button.enabled, Eventually(Equals(False))) | 168 | self.assertThat(accept_button.enabled, Eventually(Equals(False))) |
1455 | 153 | 169 | ||
1456 | 154 | # Cancel edit | 170 | # Cancel edit |
1458 | 155 | self.main_window.cancel() | 171 | self.app.main_window.cancel() |
1459 | 156 | 172 | ||
1460 | 157 | # Check if the names still there | 173 | # Check if the names still there |
1462 | 158 | view_page = self.main_window.get_contact_view_page() | 174 | view_page = self.app.main_window.get_contact_view_page() |
1463 | 159 | self.assertThat(view_page.title, Eventually(Equals("Fulano de Tal"))) | 175 | self.assertThat(view_page.title, Eventually(Equals("Fulano de Tal"))) |
1464 | 160 | 176 | ||
1465 | 161 | def test_im_type(self): | 177 | def test_im_type(self): |
1466 | @@ -177,9 +193,9 @@ | |||
1467 | 177 | self.select_a_value(im_address_0, im_value_selector, 0) | 193 | self.select_a_value(im_address_0, im_value_selector, 0) |
1468 | 178 | 194 | ||
1469 | 179 | # save contact | 195 | # save contact |
1471 | 180 | self.main_window.save() | 196 | self.app.main_window.save() |
1472 | 181 | 197 | ||
1474 | 182 | view_page = self.main_window.get_contact_view_page() | 198 | view_page = self.app.main_window.get_contact_view_page() |
1475 | 183 | 199 | ||
1476 | 184 | # check if the type was saved correct | 200 | # check if the type was saved correct |
1477 | 185 | im_type = view_page.select_single( | 201 | im_type = view_page.select_single( |
1478 | 186 | 202 | ||
1479 | === modified file 'tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py' | |||
1480 | --- tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py 2014-03-12 20:35:16 +0000 | |||
1481 | +++ tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py 2014-05-22 14:40:49 +0000 | |||
1482 | @@ -22,7 +22,7 @@ | |||
1483 | 22 | super(TestMultiplePickerMode, self).setUp() | 22 | super(TestMultiplePickerMode, self).setUp() |
1484 | 23 | 23 | ||
1485 | 24 | def test_select_contacts(self): | 24 | def test_select_contacts(self): |
1487 | 25 | pick_page = self.main_window.get_contact_list_pick_page() | 25 | pick_page = self.app.main_window.get_contact_list_pick_page() |
1488 | 26 | contacts = pick_page.select_many("ContactDelegate") | 26 | contacts = pick_page.select_many("ContactDelegate") |
1489 | 27 | # all selection marks should be visible | 27 | # all selection marks should be visible |
1490 | 28 | selection_marks = [] | 28 | selection_marks = [] |
1491 | 29 | 29 | ||
1492 | === modified file 'tests/autopilot/address_book_app/tests/test_single_pick_mode.py' | |||
1493 | --- tests/autopilot/address_book_app/tests/test_single_pick_mode.py 2014-03-12 20:35:16 +0000 | |||
1494 | +++ tests/autopilot/address_book_app/tests/test_single_pick_mode.py 2014-05-22 14:40:49 +0000 | |||
1495 | @@ -22,7 +22,7 @@ | |||
1496 | 22 | super(TestSinglePickerMode, self).setUp() | 22 | super(TestSinglePickerMode, self).setUp() |
1497 | 23 | 23 | ||
1498 | 24 | def test_select_single_contact(self): | 24 | def test_select_single_contact(self): |
1500 | 25 | pick_page = self.main_window.get_contact_list_pick_page() | 25 | pick_page = self.app.main_window.get_contact_list_pick_page() |
1501 | 26 | contacts = pick_page.select_many("ContactDelegate") | 26 | contacts = pick_page.select_many("ContactDelegate") |
1502 | 27 | # all selection marks should be visible | 27 | # all selection marks should be visible |
1503 | 28 | selection_marks = [] | 28 | selection_marks = [] |
1504 | 29 | 29 | ||
1505 | === renamed file 'tests/autopilot/address_book_app/emulators/toolbar.py' => 'tests/autopilot/address_book_app/toolbar.py' |
FAILED: Continuous integration, rev:228 /code.launchpad .net/~elopio/ address- book-app/ refactoring_ tests1/ +merge/ 220654/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ address- book-app- ci/582/ jenkins. qa.ubuntu. com/job/ address- book-app- utopic- amd64-ci/ 35/console jenkins. qa.ubuntu. com/job/ address- book-app- utopic- armhf-ci/ 35/console jenkins. qa.ubuntu. com/job/ address- book-app- utopic- i386-ci/ 35/console jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/415/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 364/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/816/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/478/ console
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/address- book-app- ci/582/ rebuild
http://