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
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 from autopilot.matchers import Eventually
6 from autopilot.introspection import dbus
7
8+from address_book_app import data
9 from address_book_app.tests import AddressBookAppTestCase
10 from address_book_app.emulators import main_window
11
12@@ -32,12 +33,11 @@
13 list_page = self.main_window.get_contact_list_page()
14
15 # execute add new contact
16- self.main_window.open_toolbar().click_button("Add")
17- edit_page = self.main_window.get_contact_edit_page()
18+ contact_editor = self.main_window.go_to_add_contact()
19
20 # Check if the contact list disapear and contact editor appears
21 self.assertThat(list_page.visible, Eventually(Equals(False)))
22- self.assertThat(edit_page.visible, Eventually(Equals(True)))
23+ self.assertThat(contact_editor.visible, Eventually(Equals(True)))
24
25 # cancel new contact without save
26 self.main_window.cancel()
27@@ -51,8 +51,7 @@
28
29 def test_add_contact_without_name(self):
30 # execute add new contact
31- self.main_window.open_toolbar().click_button("Add")
32- edit_page = self.main_window.get_contact_edit_page()
33+ contact_editor = self.main_window.go_to_add_contact()
34
35 # Try to save a empty contact
36 acceptButton = self.main_window.get_button("accept")
37@@ -60,33 +59,23 @@
38 # Save button must be disabled
39 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))
40
41- firstNameField = self.main_window.wait_select_single(
42- "TextInputDetail",
43- objectName="firstName")
44- lastNameField = self.main_window.wait_select_single(
45- "TextInputDetail",
46- objectName="lastName")
47-
48- # fill fistName field
49- self.type_on_field(firstNameField, "Fulano")
50+ contact_editor.fill_form(data.Contact(first_name='Fulano'))
51
52 # Save button must be enabled
53 self.assertThat(acceptButton.enabled, Eventually(Equals(True)))
54
55- # clear firstName field
56- self.clear_text_on_field(firstNameField)
57+ contact_editor.fill_form(data.Contact(first_name=''))
58
59 # Save button must be disabled
60 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))
61
62- # fill lastName field
63- self.type_on_field(lastNameField, "de Tal")
64+ contact_editor.fill_form(data.Contact(last_name='de Tal'))
65
66 # Save button must be enabled
67 self.assertThat(acceptButton.enabled, Eventually(Equals(True)))
68
69 # clear lastName field
70- self.clear_text_on_field(lastNameField)
71+ contact_editor.fill_form(data.Contact(last_name=''))
72
73 # Save button must be disabled
74 self.assertThat(acceptButton.enabled, Eventually(Equals(False)))
75@@ -98,28 +87,18 @@
76 list_page = self.main_window.get_contact_list_page()
77
78 self.assertThat(list_page.visible, Eventually(Equals(False)))
79- self.assertThat(edit_page.visible, Eventually(Equals(True)))
80+ self.assertThat(contact_editor.visible, Eventually(Equals(True)))
81
82 # Check if the contact list still empty
83 list_view = self.main_window.get_contact_list_view()
84 self.assertThat(list_view.count, Eventually(Equals(0)))
85
86 def test_add_contact_with_full_name(self):
87+ test_contact = data.Contact(first_name='Fulano', last_name='de Tal')
88+
89 # execute add new contact
90- self.main_window.open_toolbar().click_button("Add")
91-
92- firstNameField = self.main_window.wait_select_single(
93- "TextInputDetail",
94- objectName="firstName")
95- lastNameField = self.main_window.wait_select_single(
96- "TextInputDetail",
97- objectName="lastName")
98-
99- # fill fistName field
100- self.type_on_field(firstNameField, "Fulano")
101-
102- # fill lastName field
103- self.type_on_field(lastNameField, "de Tal")
104+ contact_editor = self.main_window.go_to_add_contact()
105+ contact_editor.fill_form(test_contact)
106
107 # Save contact
108 self.main_window.save()
109@@ -133,15 +112,11 @@
110 self.assertThat(list_view.count, Eventually(Equals(1)))
111
112 def test_add_contact_with_first_name(self):
113+ test_contact = data.Contact(first_name='Fulano')
114+
115 # execute add new contact
116- self.main_window.open_toolbar().click_button("Add")
117-
118- firstNameField = self.main_window.wait_select_single(
119- "TextInputDetail",
120- objectName="firstName")
121-
122- # fill fistName field
123- self.type_on_field(firstNameField, "Fulano")
124+ contact_editor = self.main_window.go_to_add_contact()
125+ contact_editor.fill_form(test_contact)
126
127 # Save contact
128 self.main_window.save()
129@@ -151,15 +126,11 @@
130 self.assertThat(list_view.count, Eventually(Equals(1)))
131
132 def test_add_contact_with_last_name(self):
133+ test_contact = data.Contact(last_name='de Tal')
134+
135 # execute add new contact
136- self.main_window.open_toolbar().click_button("Add")
137-
138- lastNameField = self.main_window.wait_select_single(
139- "TextInputDetail",
140- objectName="lastName")
141-
142- # fill fistName field
143- self.type_on_field(lastNameField, "de Tal")
144+ contact_editor = self.main_window.go_to_add_contact()
145+ contact_editor.fill_form(test_contact)
146
147 # Save contact
148 self.main_window.save()
149@@ -169,24 +140,13 @@
150 self.assertThat(list_view.count, Eventually(Equals(1)))
151
152 def test_add_contact_with_name_and_phone(self):
153+ test_contact = data.Contact(
154+ first_name='Fulano', last_name='de Tal',
155+ phones=[data.Phone.make()])
156+
157 # execute add new contact
158- self.main_window.open_toolbar().click_button("Add")
159-
160- # fill name
161- firstNameField = self.main_window.wait_select_single(
162- "TextInputDetail",
163- objectName="firstName")
164- lastNameField = self.main_window.wait_select_single(
165- "TextInputDetail",
166- objectName="lastName")
167- self.type_on_field(firstNameField, "Fulano")
168- self.type_on_field(lastNameField, "de Tal")
169-
170- # fill phone number
171- phone_number_0 = self.main_window.wait_select_single(
172- "TextInputDetail",
173- objectName="phoneNumber_0")
174- self.type_on_field(phone_number_0, "55 81 8777 7755")
175+ contact_editor = self.main_window.go_to_add_contact()
176+ contact_editor.fill_form(test_contact)
177
178 # Save contact
179 self.main_window.save()
180@@ -196,58 +156,14 @@
181 self.assertThat(list_view.count, Eventually(Equals(1)))
182
183 def test_add_full_contact(self):
184+ test_contact = data.Contact.make_unique()
185+ # TODO implement the filling of professional details.
186+ # --elopio - 2014-03-01
187+ test_contact.professional_details = []
188+
189 # execute add new contact
190- self.main_window.open_toolbar().click_button("Add")
191-
192- # fill name
193- firstNameField = self.main_window.wait_select_single(
194- "TextInputDetail",
195- objectName="firstName")
196- lastNameField = self.main_window.wait_select_single(
197- "TextInputDetail",
198- objectName="lastName")
199- self.type_on_field(firstNameField, "Sherlock")
200- self.type_on_field(lastNameField, "Holmes")
201-
202- # fill phone number
203- phone_number_0 = self.main_window.wait_select_single(
204- "TextInputDetail",
205- objectName="phoneNumber_0")
206- self.type_on_field(phone_number_0, "81 8777 7755")
207-
208- # fill email
209- email_0 = self.main_window.wait_select_single(
210- "TextInputDetail",
211- objectName="emailAddress_0")
212- self.type_on_field(email_0, "holmes.sherlock.uk")
213-
214- # fill im
215- im_0 = self.main_window.wait_select_single(
216- "TextInputDetail",
217- objectName="imUri_0")
218- self.type_on_field(im_0, "sh.im.com.br")
219-
220- # fill address
221- street_0 = self.main_window.wait_select_single(
222- "TextInputDetail",
223- objectName="streetAddress_0")
224- self.type_on_field(street_0, "221B Baker Street")
225- locality_0 = self.main_window.wait_select_single(
226- "TextInputDetail",
227- objectName="localityAddress_0")
228- self.type_on_field(locality_0, "West End")
229- region_0 = self.main_window.wait_select_single(
230- "TextInputDetail",
231- objectName="regionAddress_0")
232- self.type_on_field(region_0, "London")
233- postcode_0 = self.main_window.wait_select_single(
234- "TextInputDetail",
235- objectName="postcodeAddress_0")
236- self.type_on_field(postcode_0, "7777")
237- country_0 = self.main_window.wait_select_single(
238- "TextInputDetail",
239- objectName="countryAddress_0")
240- self.type_on_field(country_0, "united kingdom")
241+ contact_editor = self.main_window.go_to_add_contact()
242+ contact_editor.fill_form(test_contact)
243
244 # Save contact
245 self.main_window.save()
246@@ -258,20 +174,14 @@
247
248 def test_email_label_save(self):
249 # execute add new contact
250- self.main_window.open_toolbar().click_button("Add")
251+ contact_editor = self.main_window.go_to_add_contact()
252
253 # fill name
254- firstNameField = self.main_window.wait_select_single(
255- "TextInputDetail",
256- objectName="firstName")
257- lastNameField = self.main_window.wait_select_single(
258- "TextInputDetail",
259- objectName="lastName")
260- self.type_on_field(firstNameField, "Sherlock")
261- self.type_on_field(lastNameField, "Holmes")
262+ contact_editor.fill_form(
263+ data.Contact(first_name='Sherlock', last_name='Holmes'))
264
265 # Home
266- self.set_email_address(0, "home@email.com", 0)
267+ self.set_email_address(0, "home@email.com", 0)
268 # Work
269 self.set_email_address(1, "work@email.com", 1)
270 # Other
271@@ -314,20 +224,14 @@
272
273 def test_phone_label_save(self):
274 # execute add new contact
275- self.main_window.open_toolbar().click_button("Add")
276+ contact_editor = self.main_window.go_to_add_contact()
277
278 # fill name
279- firstNameField = self.main_window.wait_select_single(
280- "TextInputDetail",
281- objectName="firstName")
282- lastNameField = self.main_window.wait_select_single(
283- "TextInputDetail",
284- objectName="lastName")
285- self.type_on_field(firstNameField, "Sherlock")
286- self.type_on_field(lastNameField, "Holmes")
287+ contact_editor.fill_form(
288+ data.Contact(first_name='Sherlock', last_name='Holmes'))
289
290 # Home
291- self.set_phone_number(0, "00 0000 0000", 0)
292+ self.set_phone_number(0, "00 0000 0000", 0)
293 # Work
294 self.set_phone_number(1, "11 1111 1111", 1)
295 # Mobile
296@@ -355,7 +259,7 @@
297
298 phones = {"00 0000 0000" : "Home",
299 "11 1111 1111" : "Work",
300- "22 2222 2222" : "Mobile",
301+ "22 2222 2222" : "Mobile",
302 "33 3333 3333" : "Work Mobile",
303 "44 4444 4444" : "Other"}
304

Subscribers

People subscribed via source and target branches