Merge lp:~renatofilho/address-book-app/improve-vcard-import into lp:address-book-app
- improve-vcard-import
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Arthur Mello |
Approved revision: | 516 |
Merged at revision: | 510 |
Proposed branch: | lp:~renatofilho/address-book-app/improve-vcard-import |
Merge into: | lp:address-book-app |
Prerequisite: | lp:~renatofilho/address-book-app/fix-1511477 |
Diff against target: |
424 lines (+183/-116) 6 files modified
src/imports/ABContactListPage.qml (+136/-20) src/imports/CMakeLists.txt (+0/-1) src/imports/VCardImportDialog.qml (+0/-94) tests/autopilot/address_book_app/tests/__init__.py (+5/-1) tests/autopilot/address_book_app/tests/test_import_from_sim.py (+3/-0) tests/autopilot/address_book_app/tests/test_import_vcard.py (+39/-0) |
To merge this branch: | bzr merge lp:~renatofilho/address-book-app/improve-vcard-import |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Arthur Mello (community) | Approve | ||
Review via email: mp+278165@code.launchpad.net |
This proposal supersedes a proposal from 2015-11-18.
Commit message
Show a list of imported contacts when importing vcards.
Description of the change
Test vcard import
Import a vcard into contacts app using content-hub:
You can use gmail webapp or messaging app to receive vcards on the phone.
Test if a list with imported contacts appear
Test if the imported contact was imported to default address-book.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:502
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:503
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 504. By Renato Araujo Oliveira Filho
-
Merged: ~renatofilho/
address- book-app/ vcard-does- not-export- uid - 505. By Renato Araujo Oliveira Filho
-
Merged: ~renatofilho/
address- book-app/ contact- view-editable
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:503
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:505
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 506. By Renato Araujo Oliveira Filho
-
Does not reset contact list state after edit a contact while importing contacts.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:506
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 507. By Renato Araujo Oliveira Filho
-
Show a 'busy' dialog while importing contacts.
- 508. By Renato Araujo Oliveira Filho
-
Make sure that the contact list is cleared before apply a new filter to avoid delays on contact populte.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:508
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 509. By Renato Araujo Oliveira Filho
-
Trunk merged.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:509
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 510. By Renato Araujo Oliveira Filho
-
Trunk merged.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:510
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 511. By Renato Araujo Oliveira Filho
-
Show a error message if the contact import fails.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:511
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 512. By Renato Araujo Oliveira Filho
-
Test import vcard.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:512
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Arthur Mello (artmello) : | # |
- 513. By Renato Araujo Oliveira Filho
-
Typo fixed.
- 514. By Renato Araujo Oliveira Filho
-
Only try to stop maliit if it is running already.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:514
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 515. By Renato Araujo Oliveira Filho
-
Avoid switch to importVcard state while loading test data.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:515
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 516. By Renato Araujo Oliveira Filho
-
Update import from sim autopilot test.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:516
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/imports/ABContactListPage.qml' | |||
2 | --- src/imports/ABContactListPage.qml 2015-11-24 00:30:20 +0000 | |||
3 | +++ src/imports/ABContactListPage.qml 2015-11-25 18:33:17 +0000 | |||
4 | @@ -38,6 +38,8 @@ | |||
5 | 38 | property alias contactManager: contactList.manager | 38 | property alias contactManager: contactList.manager |
6 | 39 | property Page contactViewPage: null | 39 | property Page contactViewPage: null |
7 | 40 | property Page contactEditorPage: null | 40 | property Page contactEditorPage: null |
8 | 41 | property var _busyDialog: null | ||
9 | 42 | property bool _importingTestData: false | ||
10 | 41 | 43 | ||
11 | 42 | readonly property bool bottomEdgePageOpened: bottomEdge.opened && bottomEdge.fullLoaded | 44 | readonly property bool bottomEdgePageOpened: bottomEdge.opened && bottomEdge.fullLoaded |
12 | 43 | readonly property bool isEmpty: (contactList.count === 0) | 45 | readonly property bool isEmpty: (contactList.count === 0) |
13 | @@ -84,7 +86,8 @@ | |||
14 | 84 | function showContact(contact) | 86 | function showContact(contact) |
15 | 85 | { | 87 | { |
16 | 86 | // go back to normal state if not searching | 88 | // go back to normal state if not searching |
18 | 87 | if (state !== "searching") { | 89 | if ((state !== "searching") && |
19 | 90 | (state !== "vcardImported")) { | ||
20 | 88 | mainPage.state = "default"; | 91 | mainPage.state = "default"; |
21 | 89 | } | 92 | } |
22 | 90 | openViewPage({model: contactList.listModel, | 93 | openViewPage({model: contactList.listModel, |
23 | @@ -106,14 +109,21 @@ | |||
24 | 106 | 109 | ||
25 | 107 | function importContact(urls) | 110 | function importContact(urls) |
26 | 108 | { | 111 | { |
33 | 109 | if (urls.length > 0) { | 112 | mainPage._busyDialog = PopupUtils.open(busyDialogComponent, mainPage) |
34 | 110 | var importDialog = Qt.createQmlObject("VCardImportDialog{}", | 113 | |
35 | 111 | mainPage, | 114 | var importing = false |
36 | 112 | "VCardImportDialog") | 115 | for(var i=0, iMax=urls.length; i < iMax; i++) { |
37 | 113 | if (importDialog) { | 116 | var url = urls[i] |
38 | 114 | importDialog.importVCards(contactList.listModel, urls) | 117 | if (url && url != "") { |
39 | 118 | importing = true | ||
40 | 119 | contactList.listModel.importContacts(url) | ||
41 | 115 | } | 120 | } |
42 | 116 | } | 121 | } |
43 | 122 | |||
44 | 123 | if (!importing) { | ||
45 | 124 | PopupUtils.close(mainPage._busyDialog) | ||
46 | 125 | mainPage._busyDialog = null | ||
47 | 126 | } | ||
48 | 117 | } | 127 | } |
49 | 118 | 128 | ||
50 | 119 | function startPickMode(isSingleSelection, activeTransfer) | 129 | function startPickMode(isSingleSelection, activeTransfer) |
51 | @@ -126,8 +136,9 @@ | |||
52 | 126 | 136 | ||
53 | 127 | function moveListToContact(contact) | 137 | function moveListToContact(contact) |
54 | 128 | { | 138 | { |
57 | 129 | // skipt it if searching | 139 | // skipt it if searching or importing contacts |
58 | 130 | if (state === "searching") { | 140 | if ((state === "searching") || |
59 | 141 | (state === "vcardImported")) { | ||
60 | 131 | return | 142 | return |
61 | 132 | } | 143 | } |
62 | 133 | 144 | ||
63 | @@ -428,6 +439,53 @@ | |||
64 | 428 | detailToPick: -1 | 439 | detailToPick: -1 |
65 | 429 | showAddNewButton: true | 440 | showAddNewButton: true |
66 | 430 | } | 441 | } |
67 | 442 | PropertyChanges { | ||
68 | 443 | target: bottomEdge | ||
69 | 444 | enabled: false | ||
70 | 445 | } | ||
71 | 446 | }, | ||
72 | 447 | PageHeadState { | ||
73 | 448 | id: vcardImportedState | ||
74 | 449 | |||
75 | 450 | name: "vcardImported" | ||
76 | 451 | backAction: Action { | ||
77 | 452 | iconName: "back" | ||
78 | 453 | text: i18n.tr("Back") | ||
79 | 454 | onTriggered: { | ||
80 | 455 | contactList.forceActiveFocus() | ||
81 | 456 | mainPage.state = "default" | ||
82 | 457 | importedIdsFilter.ids = [] | ||
83 | 458 | } | ||
84 | 459 | } | ||
85 | 460 | PropertyChanges { | ||
86 | 461 | target: mainPage.head | ||
87 | 462 | backAction: vcardImportedState.backAction | ||
88 | 463 | } | ||
89 | 464 | PropertyChanges { | ||
90 | 465 | target: bottomEdge | ||
91 | 466 | enabled: false | ||
92 | 467 | } | ||
93 | 468 | PropertyChanges { | ||
94 | 469 | target: mainPage | ||
95 | 470 | title: i18n.tr("Imported contacts") | ||
96 | 471 | } | ||
97 | 472 | } | ||
98 | 473 | ] | ||
99 | 474 | |||
100 | 475 | //WORKAROUND: we need to call 'changeFilter' manually to make sure that the model will be cleared | ||
101 | 476 | // before update it with the new model. This is faster than do a match of contacts | ||
102 | 477 | transitions: [ | ||
103 | 478 | Transition { | ||
104 | 479 | from: "vcardImported" | ||
105 | 480 | ScriptAction { | ||
106 | 481 | script: contactList.listModel.changeFilter(null) | ||
107 | 482 | } | ||
108 | 483 | }, | ||
109 | 484 | Transition { | ||
110 | 485 | to: "vcardImported" | ||
111 | 486 | ScriptAction { | ||
112 | 487 | script: contactList.listModel.changeFilter(importedIdsFilter) | ||
113 | 488 | } | ||
114 | 431 | } | 489 | } |
115 | 432 | ] | 490 | ] |
116 | 433 | 491 | ||
117 | @@ -440,6 +498,10 @@ | |||
118 | 440 | } | 498 | } |
119 | 441 | } | 499 | } |
120 | 442 | 500 | ||
121 | 501 | IdFilter { | ||
122 | 502 | id: importedIdsFilter | ||
123 | 503 | } | ||
124 | 504 | |||
125 | 443 | KeyboardRectangle { | 505 | KeyboardRectangle { |
126 | 444 | id: keyboard | 506 | id: keyboard |
127 | 445 | } | 507 | } |
128 | @@ -492,16 +554,6 @@ | |||
129 | 492 | } | 554 | } |
130 | 493 | } | 555 | } |
131 | 494 | 556 | ||
132 | 495 | Connections { | ||
133 | 496 | target: mainPage.contactModel | ||
134 | 497 | onContactsChanged: { | ||
135 | 498 | if (contactIndex) { | ||
136 | 499 | contactList.positionViewAtContact(mainPage.contactIndex) | ||
137 | 500 | mainPage.contactIndex = null | ||
138 | 501 | } | ||
139 | 502 | } | ||
140 | 503 | } | ||
141 | 504 | |||
142 | 505 | ContactExporter { | 557 | ContactExporter { |
143 | 506 | id: contactExporter | 558 | id: contactExporter |
144 | 507 | 559 | ||
145 | @@ -543,6 +595,35 @@ | |||
146 | 543 | } | 595 | } |
147 | 544 | 596 | ||
148 | 545 | Component { | 597 | Component { |
149 | 598 | id: busyDialogComponent | ||
150 | 599 | |||
151 | 600 | Popups.Dialog { | ||
152 | 601 | id: busyDialog | ||
153 | 602 | |||
154 | 603 | property alias allowToClose: closeButton.visible | ||
155 | 604 | property alias showActivity: busyIndicator.visible | ||
156 | 605 | |||
157 | 606 | title: i18n.tr("Importing...") | ||
158 | 607 | |||
159 | 608 | ActivityIndicator { | ||
160 | 609 | id: busyIndicator | ||
161 | 610 | running: visible | ||
162 | 611 | visible: true | ||
163 | 612 | } | ||
164 | 613 | Button { | ||
165 | 614 | id: closeButton | ||
166 | 615 | text: i18n.tr("Close") | ||
167 | 616 | visible: false | ||
168 | 617 | color: UbuntuColors.red | ||
169 | 618 | onClicked: { | ||
170 | 619 | PopupUtils.close(mainPage._busyDialog) | ||
171 | 620 | mainPage._busyDialog = null | ||
172 | 621 | } | ||
173 | 622 | } | ||
174 | 623 | } | ||
175 | 624 | } | ||
176 | 625 | |||
177 | 626 | Component { | ||
178 | 546 | id: contactShareComponent | 627 | id: contactShareComponent |
179 | 547 | 628 | ||
180 | 548 | ContactSharePage { | 629 | ContactSharePage { |
181 | @@ -552,7 +633,8 @@ | |||
182 | 552 | 633 | ||
183 | 553 | Component.onCompleted: { | 634 | Component.onCompleted: { |
184 | 554 | application.elapsed() | 635 | application.elapsed() |
186 | 555 | if ((typeof(TEST_DATA) !== "undefined") && (TEST_DATA !== "")) { | 636 | if ((typeof(TEST_DATA) !== "undefined") && (TEST_DATA != "")) { |
187 | 637 | mainPage._importingTestData = true | ||
188 | 556 | contactList.listModel.importContacts("file://" + TEST_DATA) | 638 | contactList.listModel.importContacts("file://" + TEST_DATA) |
189 | 557 | } | 639 | } |
190 | 558 | 640 | ||
191 | @@ -661,6 +743,40 @@ | |||
192 | 661 | } | 743 | } |
193 | 662 | 744 | ||
194 | 663 | Connections { | 745 | Connections { |
195 | 746 | target: mainPage.contactModel | ||
196 | 747 | onContactsChanged: { | ||
197 | 748 | if (contactIndex) { | ||
198 | 749 | contactList.positionViewAtContact(mainPage.contactIndex) | ||
199 | 750 | mainPage.contactIndex = null | ||
200 | 751 | } | ||
201 | 752 | } | ||
202 | 753 | onImportCompleted: { | ||
203 | 754 | if (mainPage._importingTestData) { | ||
204 | 755 | mainPage._importingTestData = false | ||
205 | 756 | return | ||
206 | 757 | } | ||
207 | 758 | |||
208 | 759 | if (error !== ContactModel.ImportNoError) { | ||
209 | 760 | console.error("Fail to import vcard:" + error) | ||
210 | 761 | mainPage._busyDialog.title = i18n.tr("Fail to import contacts!") | ||
211 | 762 | mainPage._busyDialog.allowToClose = true | ||
212 | 763 | mainPage._busyDialog.showActivity = false | ||
213 | 764 | } else { | ||
214 | 765 | var importedIds = ids | ||
215 | 766 | importedIds.concat(importedIdsFilter.ids) | ||
216 | 767 | importedIdsFilter.ids = importedIds | ||
217 | 768 | console.debug("Imported ids:" + importedIds) | ||
218 | 769 | mainPage.state = "vcardImported" | ||
219 | 770 | |||
220 | 771 | if (mainPage._busyDialog) { | ||
221 | 772 | PopupUtils.close(mainPage._busyDialog) | ||
222 | 773 | mainPage._busyDialog = null | ||
223 | 774 | } | ||
224 | 775 | } | ||
225 | 776 | } | ||
226 | 777 | } | ||
227 | 778 | |||
228 | 779 | Connections { | ||
229 | 664 | target: mainPage.contactViewPage | 780 | target: mainPage.contactViewPage |
230 | 665 | onEditContact: { | 781 | onEditContact: { |
231 | 666 | openEditPage(editPageProperties, mainPage.contactViewPage); | 782 | openEditPage(editPageProperties, mainPage.contactViewPage); |
232 | 667 | 783 | ||
233 | === modified file 'src/imports/CMakeLists.txt' | |||
234 | --- src/imports/CMakeLists.txt 2015-10-16 13:37:25 +0000 | |||
235 | +++ src/imports/CMakeLists.txt 2015-11-25 18:33:17 +0000 | |||
236 | @@ -6,7 +6,6 @@ | |||
237 | 6 | ABContactViewPage.qml | 6 | ABContactViewPage.qml |
238 | 7 | ContentHubProxy.qml | 7 | ContentHubProxy.qml |
239 | 8 | MainWindow.qml | 8 | MainWindow.qml |
240 | 9 | VCardImportDialog.qml | ||
241 | 10 | BottomEdgeShadow.qml | 9 | BottomEdgeShadow.qml |
242 | 11 | BottomEdge.qml | 10 | BottomEdge.qml |
243 | 12 | ) | 11 | ) |
244 | 13 | 12 | ||
245 | === removed file 'src/imports/VCardImportDialog.qml' | |||
246 | --- src/imports/VCardImportDialog.qml 2015-10-26 13:18:11 +0000 | |||
247 | +++ src/imports/VCardImportDialog.qml 1970-01-01 00:00:00 +0000 | |||
248 | @@ -1,94 +0,0 @@ | |||
249 | 1 | /* | ||
250 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
251 | 3 | * | ||
252 | 4 | * This program is free software; you can redistribute it and/or modify | ||
253 | 5 | * it under the terms of the GNU General Public License as published by | ||
254 | 6 | * the Free Software Foundation; version 3. | ||
255 | 7 | * | ||
256 | 8 | * This program is distributed in the hope that it will be useful, | ||
257 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
258 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
259 | 11 | * GNU General Public License for more details. | ||
260 | 12 | * | ||
261 | 13 | * You should have received a copy of the GNU General Public License | ||
262 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
263 | 15 | */ | ||
264 | 16 | |||
265 | 17 | import QtQuick 2.4 | ||
266 | 18 | import QtContacts 5.0 | ||
267 | 19 | import Ubuntu.Components 1.3 | ||
268 | 20 | import Ubuntu.Components.Popups 1.3 as Popups | ||
269 | 21 | |||
270 | 22 | Item { | ||
271 | 23 | id: root | ||
272 | 24 | |||
273 | 25 | property alias model: modelConnections.target | ||
274 | 26 | property var vcards: [] | ||
275 | 27 | property var importedVcards: [] | ||
276 | 28 | property var importErrors: [] | ||
277 | 29 | property var dialog: null | ||
278 | 30 | |||
279 | 31 | signal finished() | ||
280 | 32 | |||
281 | 33 | function importVCards(model, vcards) | ||
282 | 34 | { | ||
283 | 35 | if (dialog || vcards.length === 0) { | ||
284 | 36 | return | ||
285 | 37 | } | ||
286 | 38 | |||
287 | 39 | root.model = model | ||
288 | 40 | root.vcards = vcards | ||
289 | 41 | dialog = Popups.PopupUtils.open(importDialogComponent, root) | ||
290 | 42 | |||
291 | 43 | for(var i=0, iMax=vcards.length; i < iMax; i++) { | ||
292 | 44 | var vcardUrl = vcards[i] | ||
293 | 45 | model.importContacts(vcardUrl) | ||
294 | 46 | } | ||
295 | 47 | } | ||
296 | 48 | |||
297 | 49 | Connections { | ||
298 | 50 | id: modelConnections | ||
299 | 51 | |||
300 | 52 | onImportCompleted: { | ||
301 | 53 | var imported = root.importedVcards | ||
302 | 54 | var importErrors = root.importErrors | ||
303 | 55 | imported.push(url) | ||
304 | 56 | if (error !== ContactModel.ImportNoError) { | ||
305 | 57 | root.importErrors.push(error) | ||
306 | 58 | console.error("Fail to import vcard:" + error) | ||
307 | 59 | } | ||
308 | 60 | root.importedVcards = imported | ||
309 | 61 | root.importErrors = importErrors | ||
310 | 62 | } | ||
311 | 63 | } | ||
312 | 64 | |||
313 | 65 | Component { | ||
314 | 66 | id: importDialogComponent | ||
315 | 67 | |||
316 | 68 | Popups.Dialog { | ||
317 | 69 | id: importDialog | ||
318 | 70 | |||
319 | 71 | title: i18n.tr("Import vCards") | ||
320 | 72 | text: root.importedVcards.length === 0 ? i18n.tr("Importing...") : i18n.tr("%1 vCards imported").arg(root.importedVcards.length) | ||
321 | 73 | |||
322 | 74 | Button { | ||
323 | 75 | anchors { | ||
324 | 76 | left: parent.left | ||
325 | 77 | right: parent.right | ||
326 | 78 | margins: units.gu(1) | ||
327 | 79 | } | ||
328 | 80 | text: i18n.tr("Close") | ||
329 | 81 | enabled: (root.importedVcards.length === root.vcards.length) | ||
330 | 82 | onClicked: { | ||
331 | 83 | root.dialog = null | ||
332 | 84 | Popups.PopupUtils.close(importDialog) | ||
333 | 85 | } | ||
334 | 86 | } | ||
335 | 87 | |||
336 | 88 | Component.onDestruction: root.destroy() | ||
337 | 89 | } | ||
338 | 90 | } | ||
339 | 91 | } | ||
340 | 92 | |||
341 | 93 | |||
342 | 94 | |||
343 | 95 | 0 | ||
344 | === modified file 'tests/autopilot/address_book_app/tests/__init__.py' | |||
345 | --- tests/autopilot/address_book_app/tests/__init__.py 2015-09-29 18:05:25 +0000 | |||
346 | +++ tests/autopilot/address_book_app/tests/__init__.py 2015-11-25 18:33:17 +0000 | |||
347 | @@ -19,6 +19,7 @@ | |||
348 | 19 | import os | 19 | import os |
349 | 20 | import time | 20 | import time |
350 | 21 | import subprocess | 21 | import subprocess |
351 | 22 | import re | ||
352 | 22 | 23 | ||
353 | 23 | from autopilot.testcase import AutopilotTestCase | 24 | from autopilot.testcase import AutopilotTestCase |
354 | 24 | from autopilot.matchers import Eventually | 25 | from autopilot.matchers import Eventually |
355 | @@ -47,7 +48,10 @@ | |||
356 | 47 | 48 | ||
357 | 48 | # stop vkb | 49 | # stop vkb |
358 | 49 | if model() != "Desktop": | 50 | if model() != "Desktop": |
360 | 50 | subprocess.check_call(["/sbin/initctl", "stop", "maliit-server"]) | 51 | maliit_info = subprocess.Popen(['/sbin/initctl', 'status', 'maliit-server'], stdout=subprocess.PIPE) |
361 | 52 | result = maliit_info.stdout.read() | ||
362 | 53 | if b'start/running,' in result.split(): | ||
363 | 54 | subprocess.check_call(['/sbin/initctl', 'stop', 'maliit-server']) | ||
364 | 51 | 55 | ||
365 | 52 | if 'AUTOPILOT_APP' in os.environ: | 56 | if 'AUTOPILOT_APP' in os.environ: |
366 | 53 | self.app_bin = os.environ['AUTOPILOT_APP'] | 57 | self.app_bin = os.environ['AUTOPILOT_APP'] |
367 | 54 | 58 | ||
368 | === modified file 'tests/autopilot/address_book_app/tests/test_import_from_sim.py' | |||
369 | --- tests/autopilot/address_book_app/tests/test_import_from_sim.py 2015-04-30 17:22:48 +0000 | |||
370 | +++ tests/autopilot/address_book_app/tests/test_import_from_sim.py 2015-11-25 18:33:17 +0000 | |||
371 | @@ -70,6 +70,9 @@ | |||
372 | 70 | self.assertThat(len(contacts), Equals(2)) | 70 | self.assertThat(len(contacts), Equals(2)) |
373 | 71 | self.app.main_window.confirm_import() | 71 | self.app.main_window.confirm_import() |
374 | 72 | 72 | ||
375 | 73 | # dismiss imported contact list | ||
376 | 74 | self.app.main_window.cancel() | ||
377 | 75 | |||
378 | 73 | # verify if the contact was imported | 76 | # verify if the contact was imported |
379 | 74 | new_contacts = list_page.get_contacts() | 77 | new_contacts = list_page.get_contacts() |
380 | 75 | self.assertThat(len(new_contacts), Equals(2)) | 78 | self.assertThat(len(new_contacts), Equals(2)) |
381 | 76 | 79 | ||
382 | === added file 'tests/autopilot/address_book_app/tests/test_import_vcard.py' | |||
383 | --- tests/autopilot/address_book_app/tests/test_import_vcard.py 1970-01-01 00:00:00 +0000 | |||
384 | +++ tests/autopilot/address_book_app/tests/test_import_vcard.py 2015-11-25 18:33:17 +0000 | |||
385 | @@ -0,0 +1,39 @@ | |||
386 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
387 | 2 | # Copyright 2015 Canonical | ||
388 | 3 | # | ||
389 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
390 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
391 | 6 | # by the Free Software Foundation. | ||
392 | 7 | |||
393 | 8 | """Tests for the Addressbook App""" | ||
394 | 9 | |||
395 | 10 | from __future__ import absolute_import | ||
396 | 11 | from testtools.matchers import Equals | ||
397 | 12 | from autopilot.matchers import Eventually | ||
398 | 13 | import os | ||
399 | 14 | |||
400 | 15 | from address_book_app.tests import AddressBookAppTestCase | ||
401 | 16 | |||
402 | 17 | |||
403 | 18 | class TeseImportVCard(AddressBookAppTestCase): | ||
404 | 19 | """Tests import vcard""" | ||
405 | 20 | |||
406 | 21 | def setUp(self): | ||
407 | 22 | vcard_path = AddressBookAppTestCase.VCARD_PATH_DEV | ||
408 | 23 | if os.path.exists(AddressBookAppTestCase.VCARD_PATH_BIN): | ||
409 | 24 | vcard_path = AddressBookAppTestCase.VCARD_PATH_BIN | ||
410 | 25 | |||
411 | 26 | self.ARGS.append("addressbook:///importvcard?url=file://%s" % vcard_path) | ||
412 | 27 | super(TeseImportVCard, self).setUp() | ||
413 | 28 | |||
414 | 29 | def test_import_vcard_results(self): | ||
415 | 30 | # check if app enter on import state | ||
416 | 31 | list_page = self.app.main_window.get_contact_list_page() | ||
417 | 32 | self.assertThat(list_page.state, Eventually(Equals('vcardImported'))) | ||
418 | 33 | self.assertThat(list_page.title, Eventually(Equals('Imported contacts'))) | ||
419 | 34 | self.assertThat(len(list_page.get_contacts()), Equals(3)) | ||
420 | 35 | |||
421 | 36 | #leave import state and show full contact list | ||
422 | 37 | self.app.main_window.cancel() | ||
423 | 38 | self.assertThat(list_page.state, Eventually(Equals('default'))) | ||
424 | 39 | self.assertThat(list_page.title, Eventually(Equals('Contacts'))) |
FAILED: Continuous integration, rev:501 jenkins. qa.ubuntu. com/job/ address- book-app- ci/1009/ jenkins. qa.ubuntu. com/job/ address- book-app- vivid-i386- ci/312/ console jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 5253/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 5273/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/address- book-app- ci/1009/ rebuild
http://