Merge lp:~renatofilho/address-book-app/fix-bottom-edge into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Superseded
Proposed branch: lp:~renatofilho/address-book-app/fix-bottom-edge
Merge into: lp:address-book-app
Prerequisite: lp:~fboucault/address-book-app/converged_bottom_edge
Diff against target: 697 lines (+174/-82)
13 files modified
src/imports/ABContactEditorPage.qml (+2/-0)
src/imports/ABContactListPage.qml (+3/-0)
src/imports/ABContactViewPage.qml (+4/-0)
src/imports/BottomEdge.qml (+58/-13)
tests/autopilot/address_book_app/__init__.py (+50/-30)
tests/autopilot/address_book_app/address_book/_contact_view_page.py (+1/-7)
tests/autopilot/address_book_app/address_book/_sim_card_import_page.py (+2/-2)
tests/autopilot/address_book_app/pages/_ab_contact_list_page.py (+26/-7)
tests/autopilot/address_book_app/tests/__init__.py (+2/-2)
tests/autopilot/address_book_app/tests/test_add_contact.py (+8/-5)
tests/autopilot/address_book_app/tests/test_create_new_from_uri.py (+7/-5)
tests/autopilot/address_book_app/tests/test_delete_contact.py (+1/-1)
tests/autopilot/address_book_app/tests/test_edit_contact.py (+10/-10)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-bottom-edge
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+275242@code.launchpad.net

This proposal has been superseded by a proposal from 2015-10-21.

Commit message

Show a dark background while swiping the bottom edge page.
Fixed bottom edge animation to avoid it to disappear on second interaction.

To post a comment you must log in.
508. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/address-book-app/autopilot-and-sdk-1.3

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
509. By Renato Araujo Oliveira Filho

Fixed font size for new UITK label.

510. By Renato Araujo Oliveira Filho

Use pageStack API on PageWithBottomEdge.

511. By Renato Araujo Oliveira Filho

Make the header invisible on contact share page.

512. By Renato Araujo Oliveira Filho

Does not show empty state message if contact editor is open.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/ABContactEditorPage.qml'
2--- src/imports/ABContactEditorPage.qml 2015-10-21 21:37:17 +0000
3+++ src/imports/ABContactEditorPage.qml 2015-10-21 21:37:17 +0000
4@@ -27,6 +27,7 @@
5
6 head.backAction: Action {
7 objectName: "cancel"
8+ name: "cancel"
9
10 text: i18n.tr("Cancel")
11 iconName: "back"
12@@ -38,6 +39,7 @@
13 head.actions: [
14 Action {
15 objectName: "save"
16+ name: "save"
17
18 text: i18n.tr("Save")
19 iconName: "ok"
20
21=== modified file 'src/imports/ABContactListPage.qml'
22--- src/imports/ABContactListPage.qml 2015-10-21 21:37:17 +0000
23+++ src/imports/ABContactListPage.qml 2015-10-21 21:37:17 +0000
24@@ -39,6 +39,7 @@
25 property Page contactViewPage: null
26 property Page contactEditorPage: null
27
28+ readonly property bool bottomEdgePageOpened: bottomEdge.opened && bottomEdge.fullLoaded
29 readonly property bool isEmpty: (contactList.count === 0)
30 readonly property bool allowToQuit: (application.callbackApplication.length > 0)
31 readonly property var contactModel: contactList.listModel ? contactList.listModel : null
32@@ -574,12 +575,14 @@
33
34 BottomEdge {
35 id: bottomEdge
36+ objectName: "bottomEdge"
37
38 anchors.fill: parent
39 contentComponent: pageStack.columns == 1 ? editorPageBottomEdge : emptyContact
40 flickable: contactList
41 iconName: "contact-new"
42 enabled: !contactList.isInSelectionMode
43+ backGroundEffectEnabled: pageStack.columns === 1
44
45 // FIXME: this is a workaround for the lack of fully asynchronous loading
46 // of Pages in AdaptativePageLayout
47
48=== modified file 'src/imports/ABContactViewPage.qml'
49--- src/imports/ABContactViewPage.qml 2015-10-21 21:37:17 +0000
50+++ src/imports/ABContactViewPage.qml 2015-10-21 21:37:17 +0000
51@@ -33,6 +33,8 @@
52 head.actions: [
53 Action {
54 objectName: "share"
55+ name: "share"
56+
57 text: i18n.tr("Share")
58 iconName: "share"
59 onTriggered: {
60@@ -44,6 +46,8 @@
61 },
62 Action {
63 objectName: "edit"
64+ name: "edit"
65+
66 text: i18n.tr("Edit")
67 iconName: "edit"
68 onTriggered: {
69
70=== modified file 'src/imports/BottomEdge.qml'
71--- src/imports/BottomEdge.qml 2015-10-21 21:37:17 +0000
72+++ src/imports/BottomEdge.qml 2015-10-21 21:37:17 +0000
73@@ -20,10 +20,15 @@
74 Item {
75 id: bottomEdge
76
77+ readonly property alias content: bottomEdgeLoader.item
78+ readonly property bool fullLoaded: bottomEdgeLoader.status == Loader.Ready
79+
80+ property bool opened: false
81 property Component contentComponent
82- property Item content: bottomEdgeLoader.item
83 property string iconName
84 property Item flickable
85+ property alias backGroundEffectEnabled: darkBg.visible
86+
87 signal openBegin
88 signal openEnd
89 signal clicked
90@@ -37,6 +42,17 @@
91 bottomEdge.state = "collapsed";
92 }
93
94+ Rectangle {
95+ id: darkBg
96+
97+ anchors.fill: parent
98+ color: "black"
99+ opacity: bottomEdgeBody.y > 0 ? 0.8 - (bottomEdgeBody.y / bottomEdgeDragArea.drag.maximumY) : 0.8
100+ Behavior on opacity {
101+ NumberAnimation { duration: UbuntuAnimation.FastDuration }
102+ }
103+ }
104+
105 Item {
106 id: bottomEdgeBody
107 anchors {
108@@ -82,6 +98,7 @@
109
110 BottomEdgeHint {
111 id: bottomEdgeHint
112+
113 anchors.bottom: bottomEdgeBody.top
114 iconName: bottomEdge.iconName
115 onClicked: bottomEdge.clicked()
116@@ -117,13 +134,19 @@
117 states: [
118 State {
119 name: "collapsed"
120+ ParentChange {
121+ target: bottomEdgeContent
122+ parent: bottomEdgeBody
123+ x: 0
124+ y: 0
125+ }
126 PropertyChanges {
127 target: bottomEdgeBody
128 y: bottomEdgeDragArea.drag.maximumY
129 }
130 PropertyChanges {
131 target: bottomEdgeContent
132- visible: false
133+ opacity: 0.0
134 }
135 },
136 State {
137@@ -135,9 +158,12 @@
138 y: 0
139 }
140 PropertyChanges {
141+ target: bottomEdgeContent
142+ opacity: 1.0
143+ }
144+ PropertyChanges {
145 target: bottomEdgeBody
146- y: bottomEdgeDragArea.drag.maximumY
147- opacity: 0.0
148+ y: 0
149 }
150 PropertyChanges {
151 target: bottomEdgeShadows
152@@ -150,7 +176,7 @@
153 when: bottomEdgeDragArea.drag.active
154 PropertyChanges {
155 target: bottomEdgeContent
156- visible: true
157+ opacity: 1.0
158 }
159 }
160 ]
161@@ -160,16 +186,29 @@
162 to: "collapsed"
163 SequentialAnimation {
164 alwaysRunToEnd: true
165-
166- SmoothedAnimation {
167- target: bottomEdgeBody
168- property: "y"
169- duration: UbuntuAnimation.SlowDuration
170+ ParallelAnimation {
171+ ParentAnimation {
172+ UbuntuNumberAnimation {
173+ properties: "x,y"
174+ duration: UbuntuAnimation.SlowDuration
175+ target: bottomEdgeContent
176+ }
177+ }
178+ UbuntuNumberAnimation {
179+ target: bottomEdgeBody
180+ property: "y"
181+ duration: UbuntuAnimation.SlowDuration
182+ }
183+ }
184+ PropertyAction {
185+ target: bottomEdgeContent
186+ property: "opacity"
187 }
188 ScriptAction {
189 script: {
190- bottomEdgeLoader.active = false;
191- bottomEdgeLoader.active = true;
192+ bottomEdgeLoader.active = false
193+ bottomEdgeLoader.active = true
194+ bottomEdge.opened = false
195 }
196 }
197 }
198@@ -177,6 +216,7 @@
199 Transition {
200 to: "expanded"
201 SequentialAnimation {
202+ alwaysRunToEnd: true
203 ParallelAnimation {
204 ScriptAction {
205 script: bottomEdge.openBegin()
206@@ -200,7 +240,11 @@
207 duration: UbuntuAnimation.FastDuration
208 }
209 ScriptAction {
210- script: bottomEdge.openEnd()
211+ script: {
212+ bottomEdge.opened = true
213+ bottomEdge.openEnd()
214+ }
215+
216 }
217 }
218 }
219@@ -208,6 +252,7 @@
220
221 MouseArea {
222 id: bottomEdgeDragArea
223+ objectName: "bottomEdgeDragArea"
224
225 property real previousY: -1
226 property string dragDirection: "None"
227
228=== modified file 'tests/autopilot/address_book_app/__init__.py'
229--- tests/autopilot/address_book_app/__init__.py 2015-10-21 21:37:17 +0000
230+++ tests/autopilot/address_book_app/__init__.py 2015-10-21 21:37:17 +0000
231@@ -32,7 +32,6 @@
232 from address_book_app import pages
233 from address_book_app import address_book
234
235-
236 logger = logging.getLogger(__name__)
237
238
239@@ -65,30 +64,18 @@
240 # ContactListPage is the only page that can appears multiple times
241 # Ex.: During the pick mode we alway push a new contactListPage, to
242 # preserve the current application status.
243- contact_list_pages = self.select_many(
244- pages.ABContactListPage, objectName='contactListPage')
245-
246- # alway return the page without pickMode
247- for p in contact_list_pages:
248- if not p.pickMode:
249- return p
250- return None
251+ return self.wait_select_single(pages.ABContactListPage,
252+ objectName='contactListPage', pickMode=False)
253
254 def get_contact_edit_page(self):
255 # We can have two contact editor page because of bottom edge page
256 # but we will return only the active one
257- list_page = self.get_contact_list_page()
258- list_page.bottomEdgePageLoaded.wait_for(True)
259- contact_editor_pages = self.select_many(
260- pages.ABContactEditorPage, objectName="contactEditorPage")
261- for p in contact_editor_pages:
262- if p.active:
263- return p
264- raise exceptions.StateNotFoundError('contactEditorPage not found')
265+ return self.wait_select_single(objectName="contactEditorPage", active=True)
266
267 def get_contact_view_page(self):
268 return self.wait_select_single(pages.ABContactViewPage,
269- objectName="contactViewPage")
270+ objectName="contactViewPage",
271+ active=True)
272
273 def get_contact_list_pick_page(self):
274 contact_list_pages = self.select_many(
275@@ -100,10 +87,10 @@
276
277 def get_share_page(self):
278 return self.wait_select_single("ContactSharePage",
279- objectName="contactSharePage")
280+ objectName="contactSharePage",
281+ active=True)
282
283 def start_import_contacts(self):
284- self.open_header()
285 view = self.get_contact_list_view()
286 if view.count > 0:
287 self.click_action_button("importFromSimHeaderButton")
288@@ -114,19 +101,37 @@
289 self.pointing_device.click_object(import_buttom)
290
291 return self.wait_select_single(address_book.SIMCardImportPage,
292- objectName="simCardImportPage")
293+ objectName="simCardImportPage",
294+ active=True)
295
296 def get_contact_list_view(self):
297 """
298- Returns a ContactListView iobject for the current window
299+ Returns a ContactListView object for the current window
300 """
301 return self.wait_select_single("ContactListView",
302 objectName="contactListView")
303
304- def get_button(self, buttonName):
305- actionbar = self.select_single('ActionBar', objectName='headerActionBar')
306- return actionbar._get_action_button(buttonName)
307+ def get_action(self, action_name):
308+ actionbars = self.select_many('ActionBar', objectName='headerActionBar')
309+ for actionbar in actionbars:
310+ object_name = action_name + "_action_button"
311+ try:
312+ button = actionbar.select_single(objectName=object_name)
313+ if button:
314+ return button
315+ except introspection.dbus.StateNotFoundError:
316+ continue
317+ return None
318
319+ def click_action_button(self, action_name):
320+ actionbars = self.select_many('ActionBar', objectName='headerActionBar')
321+ for actionbar in actionbars:
322+ try:
323+ actionbar.click_action_button(action_name)
324+ return
325+ except ubuntuuitoolkit.ToolkitException:
326+ continue
327+ raise exceptions.StateNotFoundError('Action %s not found.' % action_name)
328
329 def open_header(self):
330 header = self.get_header()
331@@ -153,22 +158,36 @@
332 """
333 Press the 'Cancel' button
334 """
335- header = self.open_header()
336- header.click_custom_back_button()
337+ buttons = self.select_many(objectName='customBackButton')
338+ for button in buttons:
339+ if button.enabled and button.visible:
340+ self.pointing_device.click_object(button)
341+ return
342+
343+ #self.click_action_button("customBackButton")
344
345 def save(self):
346 """
347 Press the 'Save' button
348 """
349- bottom_swipe_page = self.get_contact_list_page()
350 self.click_action_button("save")
351- bottom_swipe_page.isCollapsed.wait_for(True)
352+
353+ def edit(self):
354+ """
355+ Press the 'Save' button
356+ """
357+ self.click_action_button("edit")
358+
359+ def delete(self):
360+ """
361+ Press the 'Delete' button
362+ """
363+ self.click_action_button("delete")
364
365 def confirm_import(self):
366 """
367 Press the 'confirm' button
368 """
369- self.open_header()
370 self.click_action_button("confirmImport")
371
372 def get_toolbar(self):
373@@ -182,4 +201,5 @@
374 """
375 bottom_swipe_page = self.get_contact_list_page()
376 bottom_swipe_page.reveal_bottom_edge_page()
377+
378 return self.get_contact_edit_page()
379
380=== modified file 'tests/autopilot/address_book_app/address_book/_contact_view_page.py'
381--- tests/autopilot/address_book_app/address_book/_contact_view_page.py 2015-05-11 14:21:03 +0000
382+++ tests/autopilot/address_book_app/address_book/_contact_view_page.py 2015-10-21 21:37:17 +0000
383@@ -19,10 +19,4 @@
384
385 class ContactViewPage(_common.PageWithHeader):
386 """Autopilot helper for the ContactView page."""
387-
388- def go_to_edit_contact(self):
389- self.get_header().click_action_button('edit')
390- return self.get_root_instance().select_single(
391- _contact_editor_page.ContactEditorPage,
392- objectName='contactEditorPage',
393- active=True)
394+ pass
395
396=== modified file 'tests/autopilot/address_book_app/address_book/_sim_card_import_page.py'
397--- tests/autopilot/address_book_app/address_book/_sim_card_import_page.py 2015-05-12 15:43:25 +0000
398+++ tests/autopilot/address_book_app/address_book/_sim_card_import_page.py 2015-10-21 21:37:17 +0000
399@@ -72,7 +72,7 @@
400 """Return a list with the names of the contacts."""
401 contact_delegates = self._get_sorted_contact_delegates()
402 name_labels = [
403- delegate.select_single('Label', objectName='nameLabel') for
404+ delegate.select_single('UCLabel', objectName='nameLabel') for
405 delegate in contact_delegates
406 ]
407 return [label.text for label in name_labels]
408@@ -96,6 +96,6 @@
409 contact = self._get_contact_delegate(index)
410 self.pointing_device.click_object(contact)
411 contacts.append(contact.select_single(
412- 'Label', objectName='nameLabel').text)
413+ 'UCLabel', objectName='nameLabel').text)
414
415 return contacts
416
417=== modified file 'tests/autopilot/address_book_app/pages/_ab_contact_list_page.py'
418--- tests/autopilot/address_book_app/pages/_ab_contact_list_page.py 2015-05-13 13:25:18 +0000
419+++ tests/autopilot/address_book_app/pages/_ab_contact_list_page.py 2015-10-21 21:37:17 +0000
420@@ -21,9 +21,9 @@
421
422 import autopilot.logging
423 import ubuntuuitoolkit
424-
425 import address_book_app.address_book as address_book
426
427+from autopilot.introspection import dbus
428 from address_book_app.pages import ABContactViewPage
429
430
431@@ -32,7 +32,7 @@
432 log_action_debug = autopilot.logging.log_action(logging.debug)
433
434
435-class ABContactListPage(address_book.PageWithHeader, address_book.PageWithBottomEdge):
436+class ABContactListPage(address_book.PageWithHeader):
437
438 """Autopilot helper for the Contact List page."""
439
440@@ -46,8 +46,10 @@
441 """
442 contact_delegate = self._get_contact_delegate(index)
443 self.pointing_device.click_object(contact_delegate)
444+ # WORKAROUND: give some time to the view became available
445+ time.sleep(5.0)
446 return self.get_root_instance().select_single(
447- ABContactViewPage, objectName='contactViewPage')
448+ ABContactViewPage, objectName='contactViewPage', active=True)
449
450 def _get_contact_delegate(self, index):
451 contact_delegates = self._get_sorted_contact_delegates()
452@@ -108,9 +110,9 @@
453 'ContactListView', objectName='contactListView')
454
455 @log_action_info
456- def delete_selected_contacts(self):
457- self.get_header().click_action_button('delete')
458- self.isCollapsed.wait_for(True)
459+ def delete_selected_contacts(self, main_window):
460+ main_window.delete()
461+ self.bottomEdgePageOpened.wait_for(False)
462 dialog = self.get_root_instance().wait_select_single(
463 address_book.RemoveContactsDialog, objectName='removeContactsDialog')
464 dialog.confirm_removal()
465@@ -119,7 +121,7 @@
466 """Return a list with the names of the contacts."""
467 contact_delegates = self._get_sorted_contact_delegates()
468 name_labels = [
469- delegate.select_single('Label', objectName='nameLabel') for
470+ delegate.select_single('UCLabel', objectName='nameLabel') for
471 delegate in contact_delegates
472 ]
473 return [label.text for label in name_labels]
474@@ -136,3 +138,20 @@
475 objectName='contactListView.importFromSimCardButton')
476 return import_from_sim_button.visible
477
478+ def reveal_bottom_edge_page(self):
479+ """Bring the bottom edge page to the screen"""
480+ self.bottomEdgePageOpened.wait_for(False)
481+ try:
482+ action_item = self.wait_select_single(objectName='bottomEdgeDragArea')
483+ action_item.enabled.wait_for(True)
484+ start_x = (action_item.globalRect.x +
485+ (action_item.globalRect.width * 0.5))
486+ start_y = action_item.globalRect.y + (action_item.height * 0.2)
487+ stop_y = start_y - (self.height * 0.7)
488+ self.pointing_device.drag(
489+ start_x, start_y, start_x, stop_y, rate=2)
490+ #self pointer became invalid at this point
491+ #self.bottomEdgePageOpened.wait_for(True)
492+ except dbus.StateNotFoundError:
493+ logger.error('ButtomEdge element not found.')
494+ raise
495
496=== modified file 'tests/autopilot/address_book_app/tests/__init__.py'
497--- tests/autopilot/address_book_app/tests/__init__.py 2015-04-14 22:19:01 +0000
498+++ tests/autopilot/address_book_app/tests/__init__.py 2015-10-21 21:37:17 +0000
499@@ -169,12 +169,12 @@
500 list_page = self.main_window.get_contact_list_page()
501 list_page.open_contact(index)
502
503- self.assertThat(list_page.visible, Eventually(Equals(False)))
504 view_page = self.main_window.get_contact_view_page()
505 self.assertThat(view_page.visible, Eventually(Equals(True)))
506
507 # Edit contact
508- edit_page = view_page.go_to_edit_contact()
509+ self.main_window.edit()
510+ edit_page = self.main_window.get_contact_edit_page()
511 self.assertThat(edit_page.visible, Eventually(Equals(True)))
512
513 return edit_page
514
515=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
516--- tests/autopilot/address_book_app/tests/test_add_contact.py 2015-05-12 15:43:25 +0000
517+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2015-10-21 21:37:17 +0000
518@@ -36,14 +36,17 @@
519 contact_editor = self.app.main_window.go_to_add_contact()
520
521 # Check if the contact list disapear and contact editor appears
522- self.assertThat(list_page.visible, Eventually(Equals(False)))
523+ #FIXME: list_page became an invalid pointer after push a new page
524+ #self.assertThat(list_page.bottomEdgePageOpened, Eventually(Equals(True)))
525 self.assertThat(contact_editor.visible, Eventually(Equals(True)))
526+ self.assertThat(contact_editor.active, Eventually(Equals(True)))
527
528 # cancel new contact without save
529 self.app.main_window.cancel()
530
531 # Check if the contact list is visible again
532 self.assertThat(list_page.visible, Eventually(Equals(True)))
533+ self.assertThat(list_page.bottomEdgePageOpened, Eventually(Equals(False)))
534
535 # Check if the contact list still empty
536 list_view = self.app.main_window.get_contact_list_view()
537@@ -115,11 +118,11 @@
538 # Check if they have the correct label
539 for idx in range(3):
540 email_type = view_page.select_single(
541- "Label",
542+ "UCLabel",
543 objectName="type_email_" + str(idx))
544
545 email_label = view_page.select_single(
546- "Label",
547+ "UCLabel",
548 objectName="label_emailAddress_" + str(idx) + ".0")
549
550 self.assertThat(emails[email_label.text], Equals(email_type.text))
551@@ -166,11 +169,11 @@
552 # Check if they have the correct label
553 for idx in range(5):
554 phone_type = view_page.select_single(
555- "Label",
556+ "UCLabel",
557 objectName="type_phoneNumber_" + str(idx))
558
559 phone_label = view_page.select_single(
560- "Label",
561+ "UCLabel",
562 objectName="label_phoneNumber_" + str(idx) + ".0")
563
564 self.assertThat(phones[phone_label.text], Equals(phone_type.text))
565
566=== modified file 'tests/autopilot/address_book_app/tests/test_create_new_from_uri.py'
567--- tests/autopilot/address_book_app/tests/test_create_new_from_uri.py 2014-09-02 19:23:05 +0000
568+++ tests/autopilot/address_book_app/tests/test_create_new_from_uri.py 2015-10-21 21:37:17 +0000
569@@ -23,16 +23,17 @@
570
571 def test_save_new_contact(self):
572 list_page = self.app.main_window.get_contact_list_page()
573- list_page.isReady.wait_for(True)
574+ #FIXME: contacts list object became invalid after push a new page
575+ #list_page.bottomEdgePageOpened.wait_for(True)
576
577 edit_page = self.app.main_window.get_contact_edit_page()
578 self.assertThat(edit_page.visible, Eventually(Equals(True)))
579
580 # add name to the contact
581- firstNameField = self.app.main_window.wait_select_single(
582+ firstNameField = edit_page.wait_select_single(
583 "TextInputDetail",
584 objectName="firstName")
585- lastNameField = self.app.main_window.wait_select_single(
586+ lastNameField = edit_page.wait_select_single(
587 "TextInputDetail",
588 objectName="lastName")
589
590@@ -43,6 +44,7 @@
591 self.app.main_window.save()
592
593 # open contact view
594+ list_page = self.app.main_window.get_contact_list_page()
595 list_page.open_contact(0)
596 view_page = self.app.main_window.get_contact_view_page()
597 self.assertThat(view_page.visible, Eventually(Equals(True)))
598@@ -53,10 +55,10 @@
599 objectName="phones")
600 self.assertThat(phone_group.detailsCount, Eventually(Equals(1)))
601 phone_type = view_page.select_single(
602- "Label",
603+ "UCLabel",
604 objectName="type_phoneNumber_0")
605 phone_label = view_page.select_single(
606- "Label",
607+ "UCLabel",
608 objectName="label_phoneNumber_0.0")
609 self.assertThat(phone_label.text, Eventually(Equals("1234567890")))
610 self.assertThat(phone_type.text, Eventually(Equals("Mobile")))
611
612=== modified file 'tests/autopilot/address_book_app/tests/test_delete_contact.py'
613--- tests/autopilot/address_book_app/tests/test_delete_contact.py 2014-09-02 19:23:05 +0000
614+++ tests/autopilot/address_book_app/tests/test_delete_contact.py 2015-10-21 21:37:17 +0000
615@@ -69,6 +69,6 @@
616 if self.action == "cancel":
617 self.app.main_window.cancel()
618 elif self.action == "delete":
619- list_page.delete_selected_contacts()
620+ list_page.delete_selected_contacts(self.app.main_window)
621
622 self.assertEqual(list_page.get_contacts(), self.expected_result)
623
624=== modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py'
625--- tests/autopilot/address_book_app/tests/test_edit_contact.py 2015-05-12 15:43:25 +0000
626+++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2015-10-21 21:37:17 +0000
627@@ -59,7 +59,7 @@
628
629 # check if the new value is correct
630 phone_label_1 = view_page.select_single(
631- "Label",
632+ "UCLabel",
633 objectName="label_phoneNumber_1.0")
634 self.assertThat(phone_label_1.text,
635 Eventually(Equals(self.PHONE_NUMBERS[1])))
636@@ -89,14 +89,14 @@
637
638 # check if we have onlye one phone
639 view_page = list_page.open_contact(0)
640- phone_group = view_page.select_single(
641+ phone_group = self.main_window.wait_select_single(
642 "ContactDetailGroupWithTypeView",
643 objectName="phones")
644 self.assertThat(phone_group.detailsCount, Eventually(Equals(1)))
645
646 # check if the new value is correct
647- phone_label_1 = view_page.select_single(
648- "Label",
649+ phone_label_1 = phone_group.wait_select_single(
650+ "UCLabel",
651 objectName="label_phoneNumber_0.0")
652 self.assertThat(phone_label_1.text,
653 Eventually(Equals(self.PHONE_NUMBERS[1])))
654@@ -119,14 +119,14 @@
655 self.assertThat(view_page.visible, Eventually(Equals(True)))
656
657 # check if we have a new email
658- email_group = view_page.select_single(
659+ email_group = self.main_window.select_single(
660 "ContactDetailGroupWithTypeView",
661 objectName="emails")
662 self.assertThat(email_group.detailsCount, Eventually(Equals(1)))
663
664 # check if the new value is correct
665- email_label_1 = view_page.select_single(
666- "Label",
667+ email_label_1 = email_group.select_single(
668+ "UCLabel",
669 objectName="label_emailAddress_0.0")
670 self.assertThat(email_label_1.text,
671 Eventually(Equals("fulano@internet.com.br")))
672@@ -146,7 +146,7 @@
673
674 # check if the email list is empty
675 view_page = self.app.main_window.get_contact_view_page()
676- emails_group = view_page.select_single(
677+ emails_group = self.main_window.select_single(
678 "ContactDetailGroupWithTypeView",
679 objectName="emails")
680 self.assertThat(emails_group.detailsCount, Eventually(Equals(0)))
681@@ -168,7 +168,7 @@
682
683 # check if is possible to save a contact without name
684 self.app.main_window.save()
685- accept_button = self.app.main_window.get_button("save")
686+ accept_button = self.app.main_window.get_action("save")
687 self.assertThat(accept_button.enabled, Eventually(Equals(False)))
688
689 # Cancel edit
690@@ -213,6 +213,6 @@
691
692 # check if the type was saved correct
693 im_type = view_page.select_single(
694- "Label",
695+ "UCLabel",
696 objectName="type_onlineAccount_0")
697 self.assertThat(im_type.text, Eventually(Equals("Aim")))

Subscribers

People subscribed via source and target branches