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
=== modified file 'src/imports/ABContactEditorPage.qml'
--- src/imports/ABContactEditorPage.qml 2015-10-20 03:38:29 +0000
+++ src/imports/ABContactEditorPage.qml 2015-10-20 03:38:29 +0000
@@ -27,6 +27,7 @@
2727
28 head.backAction: Action {28 head.backAction: Action {
29 objectName: "cancel"29 objectName: "cancel"
30 name: "cancel"
3031
31 text: i18n.tr("Cancel")32 text: i18n.tr("Cancel")
32 iconName: "back"33 iconName: "back"
@@ -38,6 +39,7 @@
38 head.actions: [39 head.actions: [
39 Action {40 Action {
40 objectName: "save"41 objectName: "save"
42 name: "save"
4143
42 text: i18n.tr("Save")44 text: i18n.tr("Save")
43 iconName: "ok"45 iconName: "ok"
4446
=== modified file 'src/imports/ABContactListPage.qml'
--- src/imports/ABContactListPage.qml 2015-10-20 03:38:29 +0000
+++ src/imports/ABContactListPage.qml 2015-10-20 03:38:29 +0000
@@ -39,6 +39,7 @@
39 property Page contactViewPage: null39 property Page contactViewPage: null
40 property Page contactEditorPage: null40 property Page contactEditorPage: null
4141
42 readonly property bool bottomEdgePageOpened: bottomEdge.opened && bottomEdge.fullLoaded
42 readonly property bool isEmpty: (contactList.count === 0)43 readonly property bool isEmpty: (contactList.count === 0)
43 readonly property bool allowToQuit: (application.callbackApplication.length > 0)44 readonly property bool allowToQuit: (application.callbackApplication.length > 0)
44 readonly property var contactModel: contactList.listModel ? contactList.listModel : null45 readonly property var contactModel: contactList.listModel ? contactList.listModel : null
@@ -574,6 +575,7 @@
574575
575 BottomEdge {576 BottomEdge {
576 id: bottomEdge577 id: bottomEdge
578 objectName: "bottomEdge"
577579
578 anchors.fill: parent580 anchors.fill: parent
579 contentComponent: pageStack.columns == 1 ? editorPageBottomEdge : emptyContact581 contentComponent: pageStack.columns == 1 ? editorPageBottomEdge : emptyContact
580582
=== modified file 'src/imports/ABContactViewPage.qml'
--- src/imports/ABContactViewPage.qml 2015-10-20 03:38:29 +0000
+++ src/imports/ABContactViewPage.qml 2015-10-20 03:38:29 +0000
@@ -33,6 +33,8 @@
33 head.actions: [33 head.actions: [
34 Action {34 Action {
35 objectName: "share"35 objectName: "share"
36 name: "share"
37
36 text: i18n.tr("Share")38 text: i18n.tr("Share")
37 iconName: "share"39 iconName: "share"
38 onTriggered: {40 onTriggered: {
@@ -44,6 +46,8 @@
44 },46 },
45 Action {47 Action {
46 objectName: "edit"48 objectName: "edit"
49 name: "edit"
50
47 text: i18n.tr("Edit")51 text: i18n.tr("Edit")
48 iconName: "edit"52 iconName: "edit"
49 onTriggered: {53 onTriggered: {
5054
=== modified file 'src/imports/BottomEdge.qml'
--- src/imports/BottomEdge.qml 2015-10-20 03:38:29 +0000
+++ src/imports/BottomEdge.qml 2015-10-20 03:38:29 +0000
@@ -20,10 +20,13 @@
20Item {20Item {
21 id: bottomEdge21 id: bottomEdge
2222
23 readonly property bool fullLoaded: bottomEdgeLoader.status == Loader.Ready
24 property bool opened: false
23 property Component contentComponent25 property Component contentComponent
24 property Item content: bottomEdgeLoader.item26 property Item content: bottomEdgeLoader.item
25 property string iconName27 property string iconName
26 property Item flickable28 property Item flickable
29
27 signal openBegin30 signal openBegin
28 signal openEnd31 signal openEnd
29 signal clicked32 signal clicked
@@ -82,6 +85,7 @@
8285
83 BottomEdgeHint {86 BottomEdgeHint {
84 id: bottomEdgeHint87 id: bottomEdgeHint
88
85 anchors.bottom: bottomEdgeBody.top89 anchors.bottom: bottomEdgeBody.top
86 iconName: bottomEdge.iconName90 iconName: bottomEdge.iconName
87 onClicked: bottomEdge.clicked()91 onClicked: bottomEdge.clicked()
@@ -170,6 +174,7 @@
170 script: {174 script: {
171 bottomEdgeLoader.active = false;175 bottomEdgeLoader.active = false;
172 bottomEdgeLoader.active = true;176 bottomEdgeLoader.active = true;
177 bottomEdge.opened = false
173 }178 }
174 }179 }
175 }180 }
@@ -200,7 +205,11 @@
200 duration: UbuntuAnimation.FastDuration205 duration: UbuntuAnimation.FastDuration
201 }206 }
202 ScriptAction {207 ScriptAction {
203 script: bottomEdge.openEnd()208 script: {
209 bottomEdge.opened = true
210 bottomEdge.openEnd()
211 }
212
204 }213 }
205 }214 }
206 }215 }
@@ -208,6 +217,7 @@
208217
209 MouseArea {218 MouseArea {
210 id: bottomEdgeDragArea219 id: bottomEdgeDragArea
220 objectName: "bottomEdgeDragArea"
211221
212 property real previousY: -1222 property real previousY: -1
213 property string dragDirection: "None"223 property string dragDirection: "None"
214224
=== modified file 'tests/autopilot/address_book_app/__init__.py'
--- tests/autopilot/address_book_app/__init__.py 2015-10-20 03:38:29 +0000
+++ tests/autopilot/address_book_app/__init__.py 2015-10-20 03:38:29 +0000
@@ -32,7 +32,6 @@
32from address_book_app import pages32from address_book_app import pages
33from address_book_app import address_book33from address_book_app import address_book
3434
35
36logger = logging.getLogger(__name__)35logger = logging.getLogger(__name__)
3736
3837
@@ -65,30 +64,18 @@
65 # ContactListPage is the only page that can appears multiple times64 # ContactListPage is the only page that can appears multiple times
66 # Ex.: During the pick mode we alway push a new contactListPage, to65 # Ex.: During the pick mode we alway push a new contactListPage, to
67 # preserve the current application status.66 # preserve the current application status.
68 contact_list_pages = self.select_many(67 return self.wait_select_single(pages.ABContactListPage,
69 pages.ABContactListPage, objectName='contactListPage')68 objectName='contactListPage', pickMode=False)
70
71 # alway return the page without pickMode
72 for p in contact_list_pages:
73 if not p.pickMode:
74 return p
75 return None
7669
77 def get_contact_edit_page(self):70 def get_contact_edit_page(self):
78 # We can have two contact editor page because of bottom edge page71 # We can have two contact editor page because of bottom edge page
79 # but we will return only the active one72 # but we will return only the active one
80 list_page = self.get_contact_list_page()73 return self.wait_select_single(objectName="contactEditorPage", active=True)
81 list_page.bottomEdgePageLoaded.wait_for(True)
82 contact_editor_pages = self.select_many(
83 pages.ABContactEditorPage, objectName="contactEditorPage")
84 for p in contact_editor_pages:
85 if p.active:
86 return p
87 raise exceptions.StateNotFoundError('contactEditorPage not found')
8874
89 def get_contact_view_page(self):75 def get_contact_view_page(self):
90 return self.wait_select_single(pages.ABContactViewPage,76 return self.wait_select_single(pages.ABContactViewPage,
91 objectName="contactViewPage")77 objectName="contactViewPage",
78 active=True)
9279
93 def get_contact_list_pick_page(self):80 def get_contact_list_pick_page(self):
94 contact_list_pages = self.select_many(81 contact_list_pages = self.select_many(
@@ -100,10 +87,10 @@
10087
101 def get_share_page(self):88 def get_share_page(self):
102 return self.wait_select_single("ContactSharePage",89 return self.wait_select_single("ContactSharePage",
103 objectName="contactSharePage")90 objectName="contactSharePage",
91 active=True)
10492
105 def start_import_contacts(self):93 def start_import_contacts(self):
106 self.open_header()
107 view = self.get_contact_list_view()94 view = self.get_contact_list_view()
108 if view.count > 0:95 if view.count > 0:
109 self.click_action_button("importFromSimHeaderButton")96 self.click_action_button("importFromSimHeaderButton")
@@ -114,19 +101,37 @@
114 self.pointing_device.click_object(import_buttom)101 self.pointing_device.click_object(import_buttom)
115102
116 return self.wait_select_single(address_book.SIMCardImportPage,103 return self.wait_select_single(address_book.SIMCardImportPage,
117 objectName="simCardImportPage")104 objectName="simCardImportPage",
105 active=True)
118106
119 def get_contact_list_view(self):107 def get_contact_list_view(self):
120 """108 """
121 Returns a ContactListView iobject for the current window109 Returns a ContactListView object for the current window
122 """110 """
123 return self.wait_select_single("ContactListView",111 return self.wait_select_single("ContactListView",
124 objectName="contactListView")112 objectName="contactListView")
125113
126 def get_button(self, buttonName):114 def get_action(self, action_name):
127 actionbar = self.select_single('ActionBar', objectName='headerActionBar')115 actionbars = self.select_many('ActionBar', objectName='headerActionBar')
128 return actionbar._get_action_button(buttonName)116 for actionbar in actionbars:
117 object_name = action_name + "_action_button"
118 try:
119 button = actionbar.select_single(objectName=object_name)
120 if button:
121 return button
122 except introspection.dbus.StateNotFoundError:
123 continue
124 return None
129125
126 def click_action_button(self, action_name):
127 actionbars = self.select_many('ActionBar', objectName='headerActionBar')
128 for actionbar in actionbars:
129 try:
130 actionbar.click_action_button(action_name)
131 return
132 except ubuntuuitoolkit.ToolkitException:
133 continue
134 raise exceptions.StateNotFoundError('Action %s not found.' % action_name)
130135
131 def open_header(self):136 def open_header(self):
132 header = self.get_header()137 header = self.get_header()
@@ -153,22 +158,36 @@
153 """158 """
154 Press the 'Cancel' button159 Press the 'Cancel' button
155 """160 """
156 header = self.open_header()161 buttons = self.select_many(objectName='customBackButton')
157 header.click_custom_back_button()162 for button in buttons:
163 if button.enabled and button.visible:
164 self.pointing_device.click_object(button)
165 return
166
167 #self.click_action_button("customBackButton")
158168
159 def save(self):169 def save(self):
160 """170 """
161 Press the 'Save' button171 Press the 'Save' button
162 """172 """
163 bottom_swipe_page = self.get_contact_list_page()
164 self.click_action_button("save")173 self.click_action_button("save")
165 bottom_swipe_page.isCollapsed.wait_for(True)174
175 def edit(self):
176 """
177 Press the 'Save' button
178 """
179 self.click_action_button("edit")
180
181 def delete(self):
182 """
183 Press the 'Delete' button
184 """
185 self.click_action_button("delete")
166186
167 def confirm_import(self):187 def confirm_import(self):
168 """188 """
169 Press the 'confirm' button189 Press the 'confirm' button
170 """190 """
171 self.open_header()
172 self.click_action_button("confirmImport")191 self.click_action_button("confirmImport")
173192
174 def get_toolbar(self):193 def get_toolbar(self):
@@ -182,4 +201,5 @@
182 """201 """
183 bottom_swipe_page = self.get_contact_list_page()202 bottom_swipe_page = self.get_contact_list_page()
184 bottom_swipe_page.reveal_bottom_edge_page()203 bottom_swipe_page.reveal_bottom_edge_page()
204
185 return self.get_contact_edit_page()205 return self.get_contact_edit_page()
186206
=== modified file 'tests/autopilot/address_book_app/address_book/_contact_view_page.py'
--- tests/autopilot/address_book_app/address_book/_contact_view_page.py 2015-05-11 14:21:03 +0000
+++ tests/autopilot/address_book_app/address_book/_contact_view_page.py 2015-10-20 03:38:29 +0000
@@ -19,10 +19,4 @@
1919
20class ContactViewPage(_common.PageWithHeader):20class ContactViewPage(_common.PageWithHeader):
21 """Autopilot helper for the ContactView page."""21 """Autopilot helper for the ContactView page."""
2222 pass
23 def go_to_edit_contact(self):
24 self.get_header().click_action_button('edit')
25 return self.get_root_instance().select_single(
26 _contact_editor_page.ContactEditorPage,
27 objectName='contactEditorPage',
28 active=True)
2923
=== modified file 'tests/autopilot/address_book_app/address_book/_sim_card_import_page.py'
--- tests/autopilot/address_book_app/address_book/_sim_card_import_page.py 2015-05-12 15:43:25 +0000
+++ tests/autopilot/address_book_app/address_book/_sim_card_import_page.py 2015-10-20 03:38:29 +0000
@@ -72,7 +72,7 @@
72 """Return a list with the names of the contacts."""72 """Return a list with the names of the contacts."""
73 contact_delegates = self._get_sorted_contact_delegates()73 contact_delegates = self._get_sorted_contact_delegates()
74 name_labels = [74 name_labels = [
75 delegate.select_single('Label', objectName='nameLabel') for75 delegate.select_single('UCLabel', objectName='nameLabel') for
76 delegate in contact_delegates76 delegate in contact_delegates
77 ]77 ]
78 return [label.text for label in name_labels]78 return [label.text for label in name_labels]
@@ -96,6 +96,6 @@
96 contact = self._get_contact_delegate(index)96 contact = self._get_contact_delegate(index)
97 self.pointing_device.click_object(contact)97 self.pointing_device.click_object(contact)
98 contacts.append(contact.select_single(98 contacts.append(contact.select_single(
99 'Label', objectName='nameLabel').text)99 'UCLabel', objectName='nameLabel').text)
100100
101 return contacts101 return contacts
102102
=== modified file 'tests/autopilot/address_book_app/pages/_ab_contact_list_page.py'
--- tests/autopilot/address_book_app/pages/_ab_contact_list_page.py 2015-05-13 13:25:18 +0000
+++ tests/autopilot/address_book_app/pages/_ab_contact_list_page.py 2015-10-20 03:38:29 +0000
@@ -21,9 +21,9 @@
2121
22import autopilot.logging22import autopilot.logging
23import ubuntuuitoolkit23import ubuntuuitoolkit
24
25import address_book_app.address_book as address_book24import address_book_app.address_book as address_book
2625
26from autopilot.introspection import dbus
27from address_book_app.pages import ABContactViewPage27from address_book_app.pages import ABContactViewPage
2828
2929
@@ -32,7 +32,7 @@
32log_action_debug = autopilot.logging.log_action(logging.debug)32log_action_debug = autopilot.logging.log_action(logging.debug)
3333
3434
35class ABContactListPage(address_book.PageWithHeader, address_book.PageWithBottomEdge):35class ABContactListPage(address_book.PageWithHeader):
3636
37 """Autopilot helper for the Contact List page."""37 """Autopilot helper for the Contact List page."""
3838
@@ -46,8 +46,10 @@
46 """46 """
47 contact_delegate = self._get_contact_delegate(index)47 contact_delegate = self._get_contact_delegate(index)
48 self.pointing_device.click_object(contact_delegate)48 self.pointing_device.click_object(contact_delegate)
49 # WORKAROUND: give some time to the view became available
50 time.sleep(5.0)
49 return self.get_root_instance().select_single(51 return self.get_root_instance().select_single(
50 ABContactViewPage, objectName='contactViewPage')52 ABContactViewPage, objectName='contactViewPage', active=True)
5153
52 def _get_contact_delegate(self, index):54 def _get_contact_delegate(self, index):
53 contact_delegates = self._get_sorted_contact_delegates()55 contact_delegates = self._get_sorted_contact_delegates()
@@ -108,9 +110,9 @@
108 'ContactListView', objectName='contactListView')110 'ContactListView', objectName='contactListView')
109111
110 @log_action_info112 @log_action_info
111 def delete_selected_contacts(self):113 def delete_selected_contacts(self, main_window):
112 self.get_header().click_action_button('delete')114 main_window.delete()
113 self.isCollapsed.wait_for(True)115 self.bottomEdgePageOpened.wait_for(False)
114 dialog = self.get_root_instance().wait_select_single(116 dialog = self.get_root_instance().wait_select_single(
115 address_book.RemoveContactsDialog, objectName='removeContactsDialog')117 address_book.RemoveContactsDialog, objectName='removeContactsDialog')
116 dialog.confirm_removal()118 dialog.confirm_removal()
@@ -119,7 +121,7 @@
119 """Return a list with the names of the contacts."""121 """Return a list with the names of the contacts."""
120 contact_delegates = self._get_sorted_contact_delegates()122 contact_delegates = self._get_sorted_contact_delegates()
121 name_labels = [123 name_labels = [
122 delegate.select_single('Label', objectName='nameLabel') for124 delegate.select_single('UCLabel', objectName='nameLabel') for
123 delegate in contact_delegates125 delegate in contact_delegates
124 ]126 ]
125 return [label.text for label in name_labels]127 return [label.text for label in name_labels]
@@ -136,3 +138,20 @@
136 objectName='contactListView.importFromSimCardButton')138 objectName='contactListView.importFromSimCardButton')
137 return import_from_sim_button.visible139 return import_from_sim_button.visible
138140
141 def reveal_bottom_edge_page(self):
142 """Bring the bottom edge page to the screen"""
143 self.bottomEdgePageOpened.wait_for(False)
144 try:
145 action_item = self.wait_select_single(objectName='bottomEdgeDragArea')
146 action_item.enabled.wait_for(True)
147 start_x = (action_item.globalRect.x +
148 (action_item.globalRect.width * 0.5))
149 start_y = action_item.globalRect.y + (action_item.height * 0.2)
150 stop_y = start_y - (self.height * 0.7)
151 self.pointing_device.drag(
152 start_x, start_y, start_x, stop_y, rate=2)
153 #self pointer became invalid at this point
154 #self.bottomEdgePageOpened.wait_for(True)
155 except dbus.StateNotFoundError:
156 logger.error('ButtomEdge element not found.')
157 raise
139158
=== modified file 'tests/autopilot/address_book_app/tests/__init__.py'
--- tests/autopilot/address_book_app/tests/__init__.py 2015-04-14 22:19:01 +0000
+++ tests/autopilot/address_book_app/tests/__init__.py 2015-10-20 03:38:29 +0000
@@ -169,12 +169,12 @@
169 list_page = self.main_window.get_contact_list_page()169 list_page = self.main_window.get_contact_list_page()
170 list_page.open_contact(index)170 list_page.open_contact(index)
171171
172 self.assertThat(list_page.visible, Eventually(Equals(False)))
173 view_page = self.main_window.get_contact_view_page()172 view_page = self.main_window.get_contact_view_page()
174 self.assertThat(view_page.visible, Eventually(Equals(True)))173 self.assertThat(view_page.visible, Eventually(Equals(True)))
175174
176 # Edit contact175 # Edit contact
177 edit_page = view_page.go_to_edit_contact()176 self.main_window.edit()
177 edit_page = self.main_window.get_contact_edit_page()
178 self.assertThat(edit_page.visible, Eventually(Equals(True)))178 self.assertThat(edit_page.visible, Eventually(Equals(True)))
179179
180 return edit_page180 return edit_page
181181
=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
--- tests/autopilot/address_book_app/tests/test_add_contact.py 2015-05-12 15:43:25 +0000
+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2015-10-20 03:38:29 +0000
@@ -36,14 +36,17 @@
36 contact_editor = self.app.main_window.go_to_add_contact()36 contact_editor = self.app.main_window.go_to_add_contact()
3737
38 # Check if the contact list disapear and contact editor appears38 # Check if the contact list disapear and contact editor appears
39 self.assertThat(list_page.visible, Eventually(Equals(False)))39 #FIXME: list_page became an invalid pointer after push a new page
40 #self.assertThat(list_page.bottomEdgePageOpened, Eventually(Equals(True)))
40 self.assertThat(contact_editor.visible, Eventually(Equals(True)))41 self.assertThat(contact_editor.visible, Eventually(Equals(True)))
42 self.assertThat(contact_editor.active, Eventually(Equals(True)))
4143
42 # cancel new contact without save44 # cancel new contact without save
43 self.app.main_window.cancel()45 self.app.main_window.cancel()
4446
45 # Check if the contact list is visible again47 # Check if the contact list is visible again
46 self.assertThat(list_page.visible, Eventually(Equals(True)))48 self.assertThat(list_page.visible, Eventually(Equals(True)))
49 self.assertThat(list_page.bottomEdgePageOpened, Eventually(Equals(False)))
4750
48 # Check if the contact list still empty51 # Check if the contact list still empty
49 list_view = self.app.main_window.get_contact_list_view()52 list_view = self.app.main_window.get_contact_list_view()
@@ -115,11 +118,11 @@
115 # Check if they have the correct label118 # Check if they have the correct label
116 for idx in range(3):119 for idx in range(3):
117 email_type = view_page.select_single(120 email_type = view_page.select_single(
118 "Label",121 "UCLabel",
119 objectName="type_email_" + str(idx))122 objectName="type_email_" + str(idx))
120123
121 email_label = view_page.select_single(124 email_label = view_page.select_single(
122 "Label",125 "UCLabel",
123 objectName="label_emailAddress_" + str(idx) + ".0")126 objectName="label_emailAddress_" + str(idx) + ".0")
124127
125 self.assertThat(emails[email_label.text], Equals(email_type.text))128 self.assertThat(emails[email_label.text], Equals(email_type.text))
@@ -166,11 +169,11 @@
166 # Check if they have the correct label169 # Check if they have the correct label
167 for idx in range(5):170 for idx in range(5):
168 phone_type = view_page.select_single(171 phone_type = view_page.select_single(
169 "Label",172 "UCLabel",
170 objectName="type_phoneNumber_" + str(idx))173 objectName="type_phoneNumber_" + str(idx))
171174
172 phone_label = view_page.select_single(175 phone_label = view_page.select_single(
173 "Label",176 "UCLabel",
174 objectName="label_phoneNumber_" + str(idx) + ".0")177 objectName="label_phoneNumber_" + str(idx) + ".0")
175178
176 self.assertThat(phones[phone_label.text], Equals(phone_type.text))179 self.assertThat(phones[phone_label.text], Equals(phone_type.text))
177180
=== modified file 'tests/autopilot/address_book_app/tests/test_create_new_from_uri.py'
--- tests/autopilot/address_book_app/tests/test_create_new_from_uri.py 2014-09-02 19:23:05 +0000
+++ tests/autopilot/address_book_app/tests/test_create_new_from_uri.py 2015-10-20 03:38:29 +0000
@@ -23,16 +23,17 @@
2323
24 def test_save_new_contact(self):24 def test_save_new_contact(self):
25 list_page = self.app.main_window.get_contact_list_page()25 list_page = self.app.main_window.get_contact_list_page()
26 list_page.isReady.wait_for(True)26 #FIXME: contacts list object became invalid after push a new page
27 #list_page.bottomEdgePageOpened.wait_for(True)
2728
28 edit_page = self.app.main_window.get_contact_edit_page()29 edit_page = self.app.main_window.get_contact_edit_page()
29 self.assertThat(edit_page.visible, Eventually(Equals(True)))30 self.assertThat(edit_page.visible, Eventually(Equals(True)))
3031
31 # add name to the contact32 # add name to the contact
32 firstNameField = self.app.main_window.wait_select_single(33 firstNameField = edit_page.wait_select_single(
33 "TextInputDetail",34 "TextInputDetail",
34 objectName="firstName")35 objectName="firstName")
35 lastNameField = self.app.main_window.wait_select_single(36 lastNameField = edit_page.wait_select_single(
36 "TextInputDetail",37 "TextInputDetail",
37 objectName="lastName")38 objectName="lastName")
3839
@@ -43,6 +44,7 @@
43 self.app.main_window.save()44 self.app.main_window.save()
4445
45 # open contact view46 # open contact view
47 list_page = self.app.main_window.get_contact_list_page()
46 list_page.open_contact(0)48 list_page.open_contact(0)
47 view_page = self.app.main_window.get_contact_view_page()49 view_page = self.app.main_window.get_contact_view_page()
48 self.assertThat(view_page.visible, Eventually(Equals(True)))50 self.assertThat(view_page.visible, Eventually(Equals(True)))
@@ -53,10 +55,10 @@
53 objectName="phones")55 objectName="phones")
54 self.assertThat(phone_group.detailsCount, Eventually(Equals(1)))56 self.assertThat(phone_group.detailsCount, Eventually(Equals(1)))
55 phone_type = view_page.select_single(57 phone_type = view_page.select_single(
56 "Label",58 "UCLabel",
57 objectName="type_phoneNumber_0")59 objectName="type_phoneNumber_0")
58 phone_label = view_page.select_single(60 phone_label = view_page.select_single(
59 "Label",61 "UCLabel",
60 objectName="label_phoneNumber_0.0")62 objectName="label_phoneNumber_0.0")
61 self.assertThat(phone_label.text, Eventually(Equals("1234567890")))63 self.assertThat(phone_label.text, Eventually(Equals("1234567890")))
62 self.assertThat(phone_type.text, Eventually(Equals("Mobile")))64 self.assertThat(phone_type.text, Eventually(Equals("Mobile")))
6365
=== modified file 'tests/autopilot/address_book_app/tests/test_delete_contact.py'
--- tests/autopilot/address_book_app/tests/test_delete_contact.py 2014-09-02 19:23:05 +0000
+++ tests/autopilot/address_book_app/tests/test_delete_contact.py 2015-10-20 03:38:29 +0000
@@ -69,6 +69,6 @@
69 if self.action == "cancel":69 if self.action == "cancel":
70 self.app.main_window.cancel()70 self.app.main_window.cancel()
71 elif self.action == "delete":71 elif self.action == "delete":
72 list_page.delete_selected_contacts()72 list_page.delete_selected_contacts(self.app.main_window)
7373
74 self.assertEqual(list_page.get_contacts(), self.expected_result)74 self.assertEqual(list_page.get_contacts(), self.expected_result)
7575
=== modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py'
--- tests/autopilot/address_book_app/tests/test_edit_contact.py 2015-05-12 15:43:25 +0000
+++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2015-10-20 03:38:29 +0000
@@ -59,7 +59,7 @@
5959
60 # check if the new value is correct60 # check if the new value is correct
61 phone_label_1 = view_page.select_single(61 phone_label_1 = view_page.select_single(
62 "Label",62 "UCLabel",
63 objectName="label_phoneNumber_1.0")63 objectName="label_phoneNumber_1.0")
64 self.assertThat(phone_label_1.text,64 self.assertThat(phone_label_1.text,
65 Eventually(Equals(self.PHONE_NUMBERS[1])))65 Eventually(Equals(self.PHONE_NUMBERS[1])))
@@ -89,14 +89,14 @@
8989
90 # check if we have onlye one phone90 # check if we have onlye one phone
91 view_page = list_page.open_contact(0)91 view_page = list_page.open_contact(0)
92 phone_group = view_page.select_single(92 phone_group = self.main_window.wait_select_single(
93 "ContactDetailGroupWithTypeView",93 "ContactDetailGroupWithTypeView",
94 objectName="phones")94 objectName="phones")
95 self.assertThat(phone_group.detailsCount, Eventually(Equals(1)))95 self.assertThat(phone_group.detailsCount, Eventually(Equals(1)))
9696
97 # check if the new value is correct97 # check if the new value is correct
98 phone_label_1 = view_page.select_single(98 phone_label_1 = phone_group.wait_select_single(
99 "Label",99 "UCLabel",
100 objectName="label_phoneNumber_0.0")100 objectName="label_phoneNumber_0.0")
101 self.assertThat(phone_label_1.text,101 self.assertThat(phone_label_1.text,
102 Eventually(Equals(self.PHONE_NUMBERS[1])))102 Eventually(Equals(self.PHONE_NUMBERS[1])))
@@ -119,14 +119,14 @@
119 self.assertThat(view_page.visible, Eventually(Equals(True)))119 self.assertThat(view_page.visible, Eventually(Equals(True)))
120120
121 # check if we have a new email121 # check if we have a new email
122 email_group = view_page.select_single(122 email_group = self.main_window.select_single(
123 "ContactDetailGroupWithTypeView",123 "ContactDetailGroupWithTypeView",
124 objectName="emails")124 objectName="emails")
125 self.assertThat(email_group.detailsCount, Eventually(Equals(1)))125 self.assertThat(email_group.detailsCount, Eventually(Equals(1)))
126126
127 # check if the new value is correct127 # check if the new value is correct
128 email_label_1 = view_page.select_single(128 email_label_1 = email_group.select_single(
129 "Label",129 "UCLabel",
130 objectName="label_emailAddress_0.0")130 objectName="label_emailAddress_0.0")
131 self.assertThat(email_label_1.text,131 self.assertThat(email_label_1.text,
132 Eventually(Equals("fulano@internet.com.br")))132 Eventually(Equals("fulano@internet.com.br")))
@@ -146,7 +146,7 @@
146146
147 # check if the email list is empty147 # check if the email list is empty
148 view_page = self.app.main_window.get_contact_view_page()148 view_page = self.app.main_window.get_contact_view_page()
149 emails_group = view_page.select_single(149 emails_group = self.main_window.select_single(
150 "ContactDetailGroupWithTypeView",150 "ContactDetailGroupWithTypeView",
151 objectName="emails")151 objectName="emails")
152 self.assertThat(emails_group.detailsCount, Eventually(Equals(0)))152 self.assertThat(emails_group.detailsCount, Eventually(Equals(0)))
@@ -168,7 +168,7 @@
168168
169 # check if is possible to save a contact without name169 # check if is possible to save a contact without name
170 self.app.main_window.save()170 self.app.main_window.save()
171 accept_button = self.app.main_window.get_button("save")171 accept_button = self.app.main_window.get_action("save")
172 self.assertThat(accept_button.enabled, Eventually(Equals(False)))172 self.assertThat(accept_button.enabled, Eventually(Equals(False)))
173173
174 # Cancel edit174 # Cancel edit
@@ -213,6 +213,6 @@
213213
214 # check if the type was saved correct214 # check if the type was saved correct
215 im_type = view_page.select_single(215 im_type = view_page.select_single(
216 "Label",216 "UCLabel",
217 objectName="type_onlineAccount_0")217 objectName="type_onlineAccount_0")
218 self.assertThat(im_type.text, Eventually(Equals("Aim")))218 self.assertThat(im_type.text, Eventually(Equals("Aim")))

Subscribers

People subscribed via source and target branches