Merge lp:~elopio/address-book-app/fill_form-profesional-update into lp:address-book-app
- fill_form-profesional-update
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Renato Araujo Oliveira Filho |
Approved revision: | 154 |
Merged at revision: | 168 |
Proposed branch: | lp:~elopio/address-book-app/fill_form-profesional-update |
Merge into: | lp:address-book-app |
Prerequisite: | lp:~elopio/address-book-app/fill_form-professional |
Diff against target: |
303 lines (+43/-139) 1 file modified
tests/autopilot/address_book_app/tests/test_add_contact.py (+43/-139) |
To merge this branch: | bzr merge lp:~elopio/address-book-app/fill_form-profesional-update |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Renato Araujo Oliveira Filho (community) | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+208930@code.launchpad.net |
Commit message
Updated the add contacts tests with the new fill form helpers.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:153
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:154
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
looks good.
Preview Diff
1 | === modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py' | |||
2 | --- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-02-28 15:36:09 +0000 | |||
3 | +++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-04-16 14:30:43 +0000 | |||
4 | @@ -13,6 +13,7 @@ | |||
5 | 13 | from autopilot.matchers import Eventually | 13 | from autopilot.matchers import Eventually |
6 | 14 | from autopilot.introspection import dbus | 14 | from autopilot.introspection import dbus |
7 | 15 | 15 | ||
8 | 16 | from address_book_app import data | ||
9 | 16 | from address_book_app.tests import AddressBookAppTestCase | 17 | from address_book_app.tests import AddressBookAppTestCase |
10 | 17 | from address_book_app.emulators import main_window | 18 | from address_book_app.emulators import main_window |
11 | 18 | 19 | ||
12 | @@ -32,12 +33,11 @@ | |||
13 | 32 | list_page = self.main_window.get_contact_list_page() | 33 | list_page = self.main_window.get_contact_list_page() |
14 | 33 | 34 | ||
15 | 34 | # execute add new contact | 35 | # execute add new contact |
18 | 35 | self.main_window.open_toolbar().click_button("Add") | 36 | contact_editor = self.main_window.go_to_add_contact() |
17 | 36 | edit_page = self.main_window.get_contact_edit_page() | ||
19 | 37 | 37 | ||
20 | 38 | # Check if the contact list disapear and contact editor appears | 38 | # Check if the contact list disapear and contact editor appears |
21 | 39 | self.assertThat(list_page.visible, Eventually(Equals(False))) | 39 | self.assertThat(list_page.visible, Eventually(Equals(False))) |
23 | 40 | self.assertThat(edit_page.visible, Eventually(Equals(True))) | 40 | self.assertThat(contact_editor.visible, Eventually(Equals(True))) |
24 | 41 | 41 | ||
25 | 42 | # cancel new contact without save | 42 | # cancel new contact without save |
26 | 43 | self.main_window.cancel() | 43 | self.main_window.cancel() |
27 | @@ -51,8 +51,7 @@ | |||
28 | 51 | 51 | ||
29 | 52 | def test_add_contact_without_name(self): | 52 | def test_add_contact_without_name(self): |
30 | 53 | # execute add new contact | 53 | # execute add new contact |
33 | 54 | self.main_window.open_toolbar().click_button("Add") | 54 | contact_editor = self.main_window.go_to_add_contact() |
32 | 55 | edit_page = self.main_window.get_contact_edit_page() | ||
34 | 56 | 55 | ||
35 | 57 | # Try to save a empty contact | 56 | # Try to save a empty contact |
36 | 58 | acceptButton = self.main_window.get_button("accept") | 57 | acceptButton = self.main_window.get_button("accept") |
37 | @@ -60,33 +59,23 @@ | |||
38 | 60 | # Save button must be disabled | 59 | # Save button must be disabled |
39 | 61 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) | 60 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) |
40 | 62 | 61 | ||
50 | 63 | firstNameField = self.main_window.wait_select_single( | 62 | contact_editor.fill_form(data.Contact(first_name='Fulano')) |
42 | 64 | "TextInputDetail", | ||
43 | 65 | objectName="firstName") | ||
44 | 66 | lastNameField = self.main_window.wait_select_single( | ||
45 | 67 | "TextInputDetail", | ||
46 | 68 | objectName="lastName") | ||
47 | 69 | |||
48 | 70 | # fill fistName field | ||
49 | 71 | self.type_on_field(firstNameField, "Fulano") | ||
51 | 72 | 63 | ||
52 | 73 | # Save button must be enabled | 64 | # Save button must be enabled |
53 | 74 | self.assertThat(acceptButton.enabled, Eventually(Equals(True))) | 65 | self.assertThat(acceptButton.enabled, Eventually(Equals(True))) |
54 | 75 | 66 | ||
57 | 76 | # clear firstName field | 67 | contact_editor.fill_form(data.Contact(first_name='')) |
56 | 77 | self.clear_text_on_field(firstNameField) | ||
58 | 78 | 68 | ||
59 | 79 | # Save button must be disabled | 69 | # Save button must be disabled |
60 | 80 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) | 70 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) |
61 | 81 | 71 | ||
64 | 82 | # fill lastName field | 72 | contact_editor.fill_form(data.Contact(last_name='de Tal')) |
63 | 83 | self.type_on_field(lastNameField, "de Tal") | ||
65 | 84 | 73 | ||
66 | 85 | # Save button must be enabled | 74 | # Save button must be enabled |
67 | 86 | self.assertThat(acceptButton.enabled, Eventually(Equals(True))) | 75 | self.assertThat(acceptButton.enabled, Eventually(Equals(True))) |
68 | 87 | 76 | ||
69 | 88 | # clear lastName field | 77 | # clear lastName field |
71 | 89 | self.clear_text_on_field(lastNameField) | 78 | contact_editor.fill_form(data.Contact(last_name='')) |
72 | 90 | 79 | ||
73 | 91 | # Save button must be disabled | 80 | # Save button must be disabled |
74 | 92 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) | 81 | self.assertThat(acceptButton.enabled, Eventually(Equals(False))) |
75 | @@ -98,28 +87,18 @@ | |||
76 | 98 | list_page = self.main_window.get_contact_list_page() | 87 | list_page = self.main_window.get_contact_list_page() |
77 | 99 | 88 | ||
78 | 100 | self.assertThat(list_page.visible, Eventually(Equals(False))) | 89 | self.assertThat(list_page.visible, Eventually(Equals(False))) |
80 | 101 | self.assertThat(edit_page.visible, Eventually(Equals(True))) | 90 | self.assertThat(contact_editor.visible, Eventually(Equals(True))) |
81 | 102 | 91 | ||
82 | 103 | # Check if the contact list still empty | 92 | # Check if the contact list still empty |
83 | 104 | list_view = self.main_window.get_contact_list_view() | 93 | list_view = self.main_window.get_contact_list_view() |
84 | 105 | self.assertThat(list_view.count, Eventually(Equals(0))) | 94 | self.assertThat(list_view.count, Eventually(Equals(0))) |
85 | 106 | 95 | ||
86 | 107 | def test_add_contact_with_full_name(self): | 96 | def test_add_contact_with_full_name(self): |
87 | 97 | test_contact = data.Contact(first_name='Fulano', last_name='de Tal') | ||
88 | 98 | |||
89 | 108 | # execute add new contact | 99 | # execute add new contact |
104 | 109 | self.main_window.open_toolbar().click_button("Add") | 100 | contact_editor = self.main_window.go_to_add_contact() |
105 | 110 | 101 | contact_editor.fill_form(test_contact) | |
92 | 111 | firstNameField = self.main_window.wait_select_single( | ||
93 | 112 | "TextInputDetail", | ||
94 | 113 | objectName="firstName") | ||
95 | 114 | lastNameField = self.main_window.wait_select_single( | ||
96 | 115 | "TextInputDetail", | ||
97 | 116 | objectName="lastName") | ||
98 | 117 | |||
99 | 118 | # fill fistName field | ||
100 | 119 | self.type_on_field(firstNameField, "Fulano") | ||
101 | 120 | |||
102 | 121 | # fill lastName field | ||
103 | 122 | self.type_on_field(lastNameField, "de Tal") | ||
106 | 123 | 102 | ||
107 | 124 | # Save contact | 103 | # Save contact |
108 | 125 | self.main_window.save() | 104 | self.main_window.save() |
109 | @@ -133,15 +112,11 @@ | |||
110 | 133 | self.assertThat(list_view.count, Eventually(Equals(1))) | 112 | self.assertThat(list_view.count, Eventually(Equals(1))) |
111 | 134 | 113 | ||
112 | 135 | def test_add_contact_with_first_name(self): | 114 | def test_add_contact_with_first_name(self): |
113 | 115 | test_contact = data.Contact(first_name='Fulano') | ||
114 | 116 | |||
115 | 136 | # execute add new contact | 117 | # execute add new contact |
124 | 137 | self.main_window.open_toolbar().click_button("Add") | 118 | contact_editor = self.main_window.go_to_add_contact() |
125 | 138 | 119 | contact_editor.fill_form(test_contact) | |
118 | 139 | firstNameField = self.main_window.wait_select_single( | ||
119 | 140 | "TextInputDetail", | ||
120 | 141 | objectName="firstName") | ||
121 | 142 | |||
122 | 143 | # fill fistName field | ||
123 | 144 | self.type_on_field(firstNameField, "Fulano") | ||
126 | 145 | 120 | ||
127 | 146 | # Save contact | 121 | # Save contact |
128 | 147 | self.main_window.save() | 122 | self.main_window.save() |
129 | @@ -151,15 +126,11 @@ | |||
130 | 151 | self.assertThat(list_view.count, Eventually(Equals(1))) | 126 | self.assertThat(list_view.count, Eventually(Equals(1))) |
131 | 152 | 127 | ||
132 | 153 | def test_add_contact_with_last_name(self): | 128 | def test_add_contact_with_last_name(self): |
133 | 129 | test_contact = data.Contact(last_name='de Tal') | ||
134 | 130 | |||
135 | 154 | # execute add new contact | 131 | # execute add new contact |
144 | 155 | self.main_window.open_toolbar().click_button("Add") | 132 | contact_editor = self.main_window.go_to_add_contact() |
145 | 156 | 133 | contact_editor.fill_form(test_contact) | |
138 | 157 | lastNameField = self.main_window.wait_select_single( | ||
139 | 158 | "TextInputDetail", | ||
140 | 159 | objectName="lastName") | ||
141 | 160 | |||
142 | 161 | # fill fistName field | ||
143 | 162 | self.type_on_field(lastNameField, "de Tal") | ||
146 | 163 | 134 | ||
147 | 164 | # Save contact | 135 | # Save contact |
148 | 165 | self.main_window.save() | 136 | self.main_window.save() |
149 | @@ -169,24 +140,13 @@ | |||
150 | 169 | self.assertThat(list_view.count, Eventually(Equals(1))) | 140 | self.assertThat(list_view.count, Eventually(Equals(1))) |
151 | 170 | 141 | ||
152 | 171 | def test_add_contact_with_name_and_phone(self): | 142 | def test_add_contact_with_name_and_phone(self): |
153 | 143 | test_contact = data.Contact( | ||
154 | 144 | first_name='Fulano', last_name='de Tal', | ||
155 | 145 | phones=[data.Phone.make()]) | ||
156 | 146 | |||
157 | 172 | # execute add new contact | 147 | # execute add new contact |
175 | 173 | self.main_window.open_toolbar().click_button("Add") | 148 | contact_editor = self.main_window.go_to_add_contact() |
176 | 174 | 149 | contact_editor.fill_form(test_contact) | |
160 | 175 | # fill name | ||
161 | 176 | firstNameField = self.main_window.wait_select_single( | ||
162 | 177 | "TextInputDetail", | ||
163 | 178 | objectName="firstName") | ||
164 | 179 | lastNameField = self.main_window.wait_select_single( | ||
165 | 180 | "TextInputDetail", | ||
166 | 181 | objectName="lastName") | ||
167 | 182 | self.type_on_field(firstNameField, "Fulano") | ||
168 | 183 | self.type_on_field(lastNameField, "de Tal") | ||
169 | 184 | |||
170 | 185 | # fill phone number | ||
171 | 186 | phone_number_0 = self.main_window.wait_select_single( | ||
172 | 187 | "TextInputDetail", | ||
173 | 188 | objectName="phoneNumber_0") | ||
174 | 189 | self.type_on_field(phone_number_0, "55 81 8777 7755") | ||
177 | 190 | 150 | ||
178 | 191 | # Save contact | 151 | # Save contact |
179 | 192 | self.main_window.save() | 152 | self.main_window.save() |
180 | @@ -196,58 +156,14 @@ | |||
181 | 196 | self.assertThat(list_view.count, Eventually(Equals(1))) | 156 | self.assertThat(list_view.count, Eventually(Equals(1))) |
182 | 197 | 157 | ||
183 | 198 | def test_add_full_contact(self): | 158 | def test_add_full_contact(self): |
184 | 159 | test_contact = data.Contact.make_unique() | ||
185 | 160 | # TODO implement the filling of professional details. | ||
186 | 161 | # --elopio - 2014-03-01 | ||
187 | 162 | test_contact.professional_details = [] | ||
188 | 163 | |||
189 | 199 | # execute add new contact | 164 | # execute add new contact |
241 | 200 | self.main_window.open_toolbar().click_button("Add") | 165 | contact_editor = self.main_window.go_to_add_contact() |
242 | 201 | 166 | contact_editor.fill_form(test_contact) | |
192 | 202 | # fill name | ||
193 | 203 | firstNameField = self.main_window.wait_select_single( | ||
194 | 204 | "TextInputDetail", | ||
195 | 205 | objectName="firstName") | ||
196 | 206 | lastNameField = self.main_window.wait_select_single( | ||
197 | 207 | "TextInputDetail", | ||
198 | 208 | objectName="lastName") | ||
199 | 209 | self.type_on_field(firstNameField, "Sherlock") | ||
200 | 210 | self.type_on_field(lastNameField, "Holmes") | ||
201 | 211 | |||
202 | 212 | # fill phone number | ||
203 | 213 | phone_number_0 = self.main_window.wait_select_single( | ||
204 | 214 | "TextInputDetail", | ||
205 | 215 | objectName="phoneNumber_0") | ||
206 | 216 | self.type_on_field(phone_number_0, "81 8777 7755") | ||
207 | 217 | |||
208 | 218 | # fill email | ||
209 | 219 | email_0 = self.main_window.wait_select_single( | ||
210 | 220 | "TextInputDetail", | ||
211 | 221 | objectName="emailAddress_0") | ||
212 | 222 | self.type_on_field(email_0, "holmes.sherlock.uk") | ||
213 | 223 | |||
214 | 224 | # fill im | ||
215 | 225 | im_0 = self.main_window.wait_select_single( | ||
216 | 226 | "TextInputDetail", | ||
217 | 227 | objectName="imUri_0") | ||
218 | 228 | self.type_on_field(im_0, "sh.im.com.br") | ||
219 | 229 | |||
220 | 230 | # fill address | ||
221 | 231 | street_0 = self.main_window.wait_select_single( | ||
222 | 232 | "TextInputDetail", | ||
223 | 233 | objectName="streetAddress_0") | ||
224 | 234 | self.type_on_field(street_0, "221B Baker Street") | ||
225 | 235 | locality_0 = self.main_window.wait_select_single( | ||
226 | 236 | "TextInputDetail", | ||
227 | 237 | objectName="localityAddress_0") | ||
228 | 238 | self.type_on_field(locality_0, "West End") | ||
229 | 239 | region_0 = self.main_window.wait_select_single( | ||
230 | 240 | "TextInputDetail", | ||
231 | 241 | objectName="regionAddress_0") | ||
232 | 242 | self.type_on_field(region_0, "London") | ||
233 | 243 | postcode_0 = self.main_window.wait_select_single( | ||
234 | 244 | "TextInputDetail", | ||
235 | 245 | objectName="postcodeAddress_0") | ||
236 | 246 | self.type_on_field(postcode_0, "7777") | ||
237 | 247 | country_0 = self.main_window.wait_select_single( | ||
238 | 248 | "TextInputDetail", | ||
239 | 249 | objectName="countryAddress_0") | ||
240 | 250 | self.type_on_field(country_0, "united kingdom") | ||
243 | 251 | 167 | ||
244 | 252 | # Save contact | 168 | # Save contact |
245 | 253 | self.main_window.save() | 169 | self.main_window.save() |
246 | @@ -258,20 +174,14 @@ | |||
247 | 258 | 174 | ||
248 | 259 | def test_email_label_save(self): | 175 | def test_email_label_save(self): |
249 | 260 | # execute add new contact | 176 | # execute add new contact |
251 | 261 | self.main_window.open_toolbar().click_button("Add") | 177 | contact_editor = self.main_window.go_to_add_contact() |
252 | 262 | 178 | ||
253 | 263 | # fill name | 179 | # fill name |
262 | 264 | firstNameField = self.main_window.wait_select_single( | 180 | contact_editor.fill_form( |
263 | 265 | "TextInputDetail", | 181 | data.Contact(first_name='Sherlock', last_name='Holmes')) |
256 | 266 | objectName="firstName") | ||
257 | 267 | lastNameField = self.main_window.wait_select_single( | ||
258 | 268 | "TextInputDetail", | ||
259 | 269 | objectName="lastName") | ||
260 | 270 | self.type_on_field(firstNameField, "Sherlock") | ||
261 | 271 | self.type_on_field(lastNameField, "Holmes") | ||
264 | 272 | 182 | ||
265 | 273 | # Home | 183 | # Home |
267 | 274 | self.set_email_address(0, "home@email.com", 0) | 184 | self.set_email_address(0, "home@email.com", 0) |
268 | 275 | # Work | 185 | # Work |
269 | 276 | self.set_email_address(1, "work@email.com", 1) | 186 | self.set_email_address(1, "work@email.com", 1) |
270 | 277 | # Other | 187 | # Other |
271 | @@ -314,20 +224,14 @@ | |||
272 | 314 | 224 | ||
273 | 315 | def test_phone_label_save(self): | 225 | def test_phone_label_save(self): |
274 | 316 | # execute add new contact | 226 | # execute add new contact |
276 | 317 | self.main_window.open_toolbar().click_button("Add") | 227 | contact_editor = self.main_window.go_to_add_contact() |
277 | 318 | 228 | ||
278 | 319 | # fill name | 229 | # fill name |
287 | 320 | firstNameField = self.main_window.wait_select_single( | 230 | contact_editor.fill_form( |
288 | 321 | "TextInputDetail", | 231 | data.Contact(first_name='Sherlock', last_name='Holmes')) |
281 | 322 | objectName="firstName") | ||
282 | 323 | lastNameField = self.main_window.wait_select_single( | ||
283 | 324 | "TextInputDetail", | ||
284 | 325 | objectName="lastName") | ||
285 | 326 | self.type_on_field(firstNameField, "Sherlock") | ||
286 | 327 | self.type_on_field(lastNameField, "Holmes") | ||
289 | 328 | 232 | ||
290 | 329 | # Home | 233 | # Home |
292 | 330 | self.set_phone_number(0, "00 0000 0000", 0) | 234 | self.set_phone_number(0, "00 0000 0000", 0) |
293 | 331 | # Work | 235 | # Work |
294 | 332 | self.set_phone_number(1, "11 1111 1111", 1) | 236 | self.set_phone_number(1, "11 1111 1111", 1) |
295 | 333 | # Mobile | 237 | # Mobile |
296 | @@ -355,7 +259,7 @@ | |||
297 | 355 | 259 | ||
298 | 356 | phones = {"00 0000 0000" : "Home", | 260 | phones = {"00 0000 0000" : "Home", |
299 | 357 | "11 1111 1111" : "Work", | 261 | "11 1111 1111" : "Work", |
301 | 358 | "22 2222 2222" : "Mobile", | 262 | "22 2222 2222" : "Mobile", |
302 | 359 | "33 3333 3333" : "Work Mobile", | 263 | "33 3333 3333" : "Work Mobile", |
303 | 360 | "44 4444 4444" : "Other"} | 264 | "44 4444 4444" : "Other"} |
304 | 361 | 265 |
FAILED: Continuous integration, rev:152 jenkins. qa.ubuntu. com/job/ address- book-app- ci/444/ jenkins. qa.ubuntu. com/job/ address- book-app- trusty- amd64-ci/ 154 jenkins. qa.ubuntu. com/job/ address- book-app- trusty- armhf-ci/ 154 jenkins. qa.ubuntu. com/job/ address- book-app- trusty- armhf-ci/ 154/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ address- book-app- trusty- i386-ci/ 154 jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 3611 jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty- touch/3222/ console jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-trusty/ 3177 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/3615 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/3615/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/3224 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/3224/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- mako/5602/ console s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 4409
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/address- book-app- ci/444/ rebuild
http://