Merge lp:~renatofilho/address-book-app/autopilot-and-sdk-1.3 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Merged at revision: 490
Proposed branch: lp:~renatofilho/address-book-app/autopilot-and-sdk-1.3
Merge into: lp:address-book-app
Prerequisite: lp:~fboucault/address-book-app/converged_bottom_edge
Diff against target: 587 lines (+126/-70)
13 files modified
src/imports/ABContactEditorPage.qml (+2/-0)
src/imports/ABContactListPage.qml (+2/-0)
src/imports/ABContactViewPage.qml (+4/-0)
src/imports/BottomEdge.qml (+11/-1)
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/autopilot-and-sdk-1.3
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+272833@code.launchpad.net

Commit message

Update autopilot test to new SDK 1.3

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
506. By Renato Araujo Oliveira Filho

Fix autopilot test for single column app.

507. By Renato Araujo Oliveira Filho

Fixed delete contacts autopilot test.

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

Wait contact view page became active to return it.

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

Fix edit contact test.

510. By Renato Araujo Oliveira Filho

Renamed ContactListPage 'bottomEdgePageLoaded' to 'bottomEdgePageOpened'.

Set it to true only if the botom edge page is fully loaded.

511. By Renato Araujo Oliveira Filho

More fixes for autopilot tests.

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

autopilot fixes.

513. By Renato Araujo Oliveira Filho

Updated autopilo tests.

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

Parent branch merged.

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

Update autopilot tests to use the UITK API.

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

Replaced from 'Label' to new SDK type 'UCLabel'

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

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

Subscribers

People subscribed via source and target branches