[Merge] lp:~canonical-platform-qa/messaging-app/test_helper_to_send_sms_from_suggested_contact_list into lp:messaging-app

Leo Arias leo.arias at canonical.com
Wed Jul 23 18:54:38 UTC 2014


Review: Needs Fixing

19	text_entry = self.get_newmessage_textarea()
20	- self.pointing_device.click_object(text_entry)
21	- text_entry.focus.wait_for(True)
22	- time.sleep(.3)
23	+ self._focus_field(text_entry)
24	self.keyboard.type(str(message), delay=0.2)

Replace this with something like
text_field = self.select_single(ubuntuuitoolkit.TextField, objectName='...')
text_field.write('...')

It will take care of clicking and waiting for it to be focused. It won't sleep the extra .3. Why is that needed? If it's not, just remove it. If it is, you can overwrite the write method, but please comment with the reason.

29	+ def type_contact_phone_num(self, num_or_contact, select=False):

You need to explain that select argument in a docstring.

45	+ self.keyboard.press_and_release("Enter")

Pressing Enter is something that you can't do from the phone, as a real user. Is there a button to click instead?

50	+ def select_contact_from_list(self, name):
51	+ """Select the given contact from the list
52	+
53	+ :parameter name: name of the contact
54	+ """
55	+
56	+ contact_list = self.get_root_instance().select_single(
57	+ 'ContactSimpleListView')
58	+ list_item = contact_list.wait_select_single(
59	+ 'Label', text='<b>{}</b>'.format(name))
60	+ self.pointing_device.click_object(list_item)

This needs to be improved to follow closely the page object pattern.
First, the method shouldn't be in main_view. It should be on the component that executes the action. That's the new chat page, right?

Then, the you can make an object for ContactSimpleListView and add a method select_contact there.

Let me know if you need any kind of help with this.

The test you added is nice, thanks for that.
-- 
https://code.launchpad.net/~canonical-platform-qa/messaging-app/test_helper_to_send_sms_from_suggested_contact_list/+merge/227817
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~canonical-platform-qa/messaging-app/test_helper_to_send_sms_from_suggested_contact_list into lp:messaging-app.



More information about the Ubuntu-reviews mailing list