Merge lp:~elopio/address-book-app/fill_form-profesional-update into lp:address-book-app

Proposed by Leo Arias
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
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.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:152
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/444/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/154
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/154/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/154
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3611
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3222/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3177
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3615
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3615/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3224
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3224/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5602/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4409

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/444/rebuild

review: Needs Fixing (continuous-integration)
153. By Leo Arias

Merged with prerequisite.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
154. By Leo Arias

Merged with prerequisite.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
--- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-02-28 15:36:09 +0000
+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-04-16 14:30:43 +0000
@@ -13,6 +13,7 @@
13from autopilot.matchers import Eventually13from autopilot.matchers import Eventually
14from autopilot.introspection import dbus14from autopilot.introspection import dbus
1515
16from address_book_app import data
16from address_book_app.tests import AddressBookAppTestCase17from address_book_app.tests import AddressBookAppTestCase
17from address_book_app.emulators import main_window18from address_book_app.emulators import main_window
1819
@@ -32,12 +33,11 @@
32 list_page = self.main_window.get_contact_list_page()33 list_page = self.main_window.get_contact_list_page()
3334
34 # execute add new contact35 # execute add new contact
35 self.main_window.open_toolbar().click_button("Add")36 contact_editor = self.main_window.go_to_add_contact()
36 edit_page = self.main_window.get_contact_edit_page()
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 self.assertThat(list_page.visible, Eventually(Equals(False)))
40 self.assertThat(edit_page.visible, Eventually(Equals(True)))40 self.assertThat(contact_editor.visible, Eventually(Equals(True)))
4141
42 # cancel new contact without save42 # cancel new contact without save
43 self.main_window.cancel()43 self.main_window.cancel()
@@ -51,8 +51,7 @@
5151
52 def test_add_contact_without_name(self):52 def test_add_contact_without_name(self):
53 # execute add new contact53 # execute add new contact
54 self.main_window.open_toolbar().click_button("Add")54 contact_editor = self.main_window.go_to_add_contact()
55 edit_page = self.main_window.get_contact_edit_page()
5655
57 # Try to save a empty contact56 # Try to save a empty contact
58 acceptButton = self.main_window.get_button("accept")57 acceptButton = self.main_window.get_button("accept")
@@ -60,33 +59,23 @@
60 # Save button must be disabled59 # Save button must be disabled
61 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))60 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))
6261
63 firstNameField = self.main_window.wait_select_single(62 contact_editor.fill_form(data.Contact(first_name='Fulano'))
64 "TextInputDetail",
65 objectName="firstName")
66 lastNameField = self.main_window.wait_select_single(
67 "TextInputDetail",
68 objectName="lastName")
69
70 # fill fistName field
71 self.type_on_field(firstNameField, "Fulano")
7263
73 # Save button must be enabled64 # Save button must be enabled
74 self.assertThat(acceptButton.enabled, Eventually(Equals(True)))65 self.assertThat(acceptButton.enabled, Eventually(Equals(True)))
7566
76 # clear firstName field67 contact_editor.fill_form(data.Contact(first_name=''))
77 self.clear_text_on_field(firstNameField)
7868
79 # Save button must be disabled69 # Save button must be disabled
80 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))70 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))
8171
82 # fill lastName field72 contact_editor.fill_form(data.Contact(last_name='de Tal'))
83 self.type_on_field(lastNameField, "de Tal")
8473
85 # Save button must be enabled74 # Save button must be enabled
86 self.assertThat(acceptButton.enabled, Eventually(Equals(True)))75 self.assertThat(acceptButton.enabled, Eventually(Equals(True)))
8776
88 # clear lastName field77 # clear lastName field
89 self.clear_text_on_field(lastNameField)78 contact_editor.fill_form(data.Contact(last_name=''))
9079
91 # Save button must be disabled80 # Save button must be disabled
92 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))81 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))
@@ -98,28 +87,18 @@
98 list_page = self.main_window.get_contact_list_page()87 list_page = self.main_window.get_contact_list_page()
9988
100 self.assertThat(list_page.visible, Eventually(Equals(False)))89 self.assertThat(list_page.visible, Eventually(Equals(False)))
101 self.assertThat(edit_page.visible, Eventually(Equals(True)))90 self.assertThat(contact_editor.visible, Eventually(Equals(True)))
10291
103 # Check if the contact list still empty92 # Check if the contact list still empty
104 list_view = self.main_window.get_contact_list_view()93 list_view = self.main_window.get_contact_list_view()
105 self.assertThat(list_view.count, Eventually(Equals(0)))94 self.assertThat(list_view.count, Eventually(Equals(0)))
10695
107 def test_add_contact_with_full_name(self):96 def test_add_contact_with_full_name(self):
97 test_contact = data.Contact(first_name='Fulano', last_name='de Tal')
98
108 # execute add new contact99 # execute add new contact
109 self.main_window.open_toolbar().click_button("Add")100 contact_editor = self.main_window.go_to_add_contact()
110101 contact_editor.fill_form(test_contact)
111 firstNameField = self.main_window.wait_select_single(
112 "TextInputDetail",
113 objectName="firstName")
114 lastNameField = self.main_window.wait_select_single(
115 "TextInputDetail",
116 objectName="lastName")
117
118 # fill fistName field
119 self.type_on_field(firstNameField, "Fulano")
120
121 # fill lastName field
122 self.type_on_field(lastNameField, "de Tal")
123102
124 # Save contact103 # Save contact
125 self.main_window.save()104 self.main_window.save()
@@ -133,15 +112,11 @@
133 self.assertThat(list_view.count, Eventually(Equals(1)))112 self.assertThat(list_view.count, Eventually(Equals(1)))
134113
135 def test_add_contact_with_first_name(self):114 def test_add_contact_with_first_name(self):
115 test_contact = data.Contact(first_name='Fulano')
116
136 # execute add new contact117 # execute add new contact
137 self.main_window.open_toolbar().click_button("Add")118 contact_editor = self.main_window.go_to_add_contact()
138119 contact_editor.fill_form(test_contact)
139 firstNameField = self.main_window.wait_select_single(
140 "TextInputDetail",
141 objectName="firstName")
142
143 # fill fistName field
144 self.type_on_field(firstNameField, "Fulano")
145120
146 # Save contact121 # Save contact
147 self.main_window.save()122 self.main_window.save()
@@ -151,15 +126,11 @@
151 self.assertThat(list_view.count, Eventually(Equals(1)))126 self.assertThat(list_view.count, Eventually(Equals(1)))
152127
153 def test_add_contact_with_last_name(self):128 def test_add_contact_with_last_name(self):
129 test_contact = data.Contact(last_name='de Tal')
130
154 # execute add new contact131 # execute add new contact
155 self.main_window.open_toolbar().click_button("Add")132 contact_editor = self.main_window.go_to_add_contact()
156133 contact_editor.fill_form(test_contact)
157 lastNameField = self.main_window.wait_select_single(
158 "TextInputDetail",
159 objectName="lastName")
160
161 # fill fistName field
162 self.type_on_field(lastNameField, "de Tal")
163134
164 # Save contact135 # Save contact
165 self.main_window.save()136 self.main_window.save()
@@ -169,24 +140,13 @@
169 self.assertThat(list_view.count, Eventually(Equals(1)))140 self.assertThat(list_view.count, Eventually(Equals(1)))
170141
171 def test_add_contact_with_name_and_phone(self):142 def test_add_contact_with_name_and_phone(self):
143 test_contact = data.Contact(
144 first_name='Fulano', last_name='de Tal',
145 phones=[data.Phone.make()])
146
172 # execute add new contact147 # execute add new contact
173 self.main_window.open_toolbar().click_button("Add")148 contact_editor = self.main_window.go_to_add_contact()
174149 contact_editor.fill_form(test_contact)
175 # fill name
176 firstNameField = self.main_window.wait_select_single(
177 "TextInputDetail",
178 objectName="firstName")
179 lastNameField = self.main_window.wait_select_single(
180 "TextInputDetail",
181 objectName="lastName")
182 self.type_on_field(firstNameField, "Fulano")
183 self.type_on_field(lastNameField, "de Tal")
184
185 # fill phone number
186 phone_number_0 = self.main_window.wait_select_single(
187 "TextInputDetail",
188 objectName="phoneNumber_0")
189 self.type_on_field(phone_number_0, "55 81 8777 7755")
190150
191 # Save contact151 # Save contact
192 self.main_window.save()152 self.main_window.save()
@@ -196,58 +156,14 @@
196 self.assertThat(list_view.count, Eventually(Equals(1)))156 self.assertThat(list_view.count, Eventually(Equals(1)))
197157
198 def test_add_full_contact(self):158 def test_add_full_contact(self):
159 test_contact = data.Contact.make_unique()
160 # TODO implement the filling of professional details.
161 # --elopio - 2014-03-01
162 test_contact.professional_details = []
163
199 # execute add new contact164 # execute add new contact
200 self.main_window.open_toolbar().click_button("Add")165 contact_editor = self.main_window.go_to_add_contact()
201166 contact_editor.fill_form(test_contact)
202 # fill name
203 firstNameField = self.main_window.wait_select_single(
204 "TextInputDetail",
205 objectName="firstName")
206 lastNameField = self.main_window.wait_select_single(
207 "TextInputDetail",
208 objectName="lastName")
209 self.type_on_field(firstNameField, "Sherlock")
210 self.type_on_field(lastNameField, "Holmes")
211
212 # fill phone number
213 phone_number_0 = self.main_window.wait_select_single(
214 "TextInputDetail",
215 objectName="phoneNumber_0")
216 self.type_on_field(phone_number_0, "81 8777 7755")
217
218 # fill email
219 email_0 = self.main_window.wait_select_single(
220 "TextInputDetail",
221 objectName="emailAddress_0")
222 self.type_on_field(email_0, "holmes.sherlock.uk")
223
224 # fill im
225 im_0 = self.main_window.wait_select_single(
226 "TextInputDetail",
227 objectName="imUri_0")
228 self.type_on_field(im_0, "sh.im.com.br")
229
230 # fill address
231 street_0 = self.main_window.wait_select_single(
232 "TextInputDetail",
233 objectName="streetAddress_0")
234 self.type_on_field(street_0, "221B Baker Street")
235 locality_0 = self.main_window.wait_select_single(
236 "TextInputDetail",
237 objectName="localityAddress_0")
238 self.type_on_field(locality_0, "West End")
239 region_0 = self.main_window.wait_select_single(
240 "TextInputDetail",
241 objectName="regionAddress_0")
242 self.type_on_field(region_0, "London")
243 postcode_0 = self.main_window.wait_select_single(
244 "TextInputDetail",
245 objectName="postcodeAddress_0")
246 self.type_on_field(postcode_0, "7777")
247 country_0 = self.main_window.wait_select_single(
248 "TextInputDetail",
249 objectName="countryAddress_0")
250 self.type_on_field(country_0, "united kingdom")
251167
252 # Save contact168 # Save contact
253 self.main_window.save()169 self.main_window.save()
@@ -258,20 +174,14 @@
258174
259 def test_email_label_save(self):175 def test_email_label_save(self):
260 # execute add new contact176 # execute add new contact
261 self.main_window.open_toolbar().click_button("Add")177 contact_editor = self.main_window.go_to_add_contact()
262178
263 # fill name179 # fill name
264 firstNameField = self.main_window.wait_select_single(180 contact_editor.fill_form(
265 "TextInputDetail",181 data.Contact(first_name='Sherlock', last_name='Holmes'))
266 objectName="firstName")
267 lastNameField = self.main_window.wait_select_single(
268 "TextInputDetail",
269 objectName="lastName")
270 self.type_on_field(firstNameField, "Sherlock")
271 self.type_on_field(lastNameField, "Holmes")
272182
273 # Home183 # Home
274 self.set_email_address(0, "home@email.com", 0) 184 self.set_email_address(0, "home@email.com", 0)
275 # Work185 # Work
276 self.set_email_address(1, "work@email.com", 1)186 self.set_email_address(1, "work@email.com", 1)
277 # Other187 # Other
@@ -314,20 +224,14 @@
314224
315 def test_phone_label_save(self):225 def test_phone_label_save(self):
316 # execute add new contact226 # execute add new contact
317 self.main_window.open_toolbar().click_button("Add")227 contact_editor = self.main_window.go_to_add_contact()
318228
319 # fill name229 # fill name
320 firstNameField = self.main_window.wait_select_single(230 contact_editor.fill_form(
321 "TextInputDetail",231 data.Contact(first_name='Sherlock', last_name='Holmes'))
322 objectName="firstName")
323 lastNameField = self.main_window.wait_select_single(
324 "TextInputDetail",
325 objectName="lastName")
326 self.type_on_field(firstNameField, "Sherlock")
327 self.type_on_field(lastNameField, "Holmes")
328232
329 # Home233 # Home
330 self.set_phone_number(0, "00 0000 0000", 0) 234 self.set_phone_number(0, "00 0000 0000", 0)
331 # Work235 # Work
332 self.set_phone_number(1, "11 1111 1111", 1)236 self.set_phone_number(1, "11 1111 1111", 1)
333 # Mobile237 # Mobile
@@ -355,7 +259,7 @@
355259
356 phones = {"00 0000 0000" : "Home",260 phones = {"00 0000 0000" : "Home",
357 "11 1111 1111" : "Work",261 "11 1111 1111" : "Work",
358 "22 2222 2222" : "Mobile", 262 "22 2222 2222" : "Mobile",
359 "33 3333 3333" : "Work Mobile",263 "33 3333 3333" : "Work Mobile",
360 "44 4444 4444" : "Other"}264 "44 4444 4444" : "Other"}
361265

Subscribers

People subscribed via source and target branches