Hi! I didn't know TextField emulator existed, thanks for that. The component I am trying to interact with, is not a TextField, its a custom component used only in messaging-app I believe.
>
> 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.
I am not sure about the sleep, I did not add it, it was already there and is in a few other places as well, I will not remove since there was probably a reason for that.
>
> 29 + def type_contact_phone_num(self, num_or_contact, select=False):
>
> You need to explain that select argument in a docstring.
Added.
>
> 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?
It was already there. Now that I poked through the app, the only way to lose focus in that field is by focusing the 'message' box, there is no other button in this page. We can go with that but I am not sure.
>
> 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.
Done, thanks.
>
> The test you added is nice, thanks for that.
> 19 text_entry = self.get_ newmessage_ textarea( ) device. click_object( text_entry) focus.wait_ for(True) field(text_ entry) type(str( message) , delay=0.2) single( ubuntuuitoolkit .TextField, objectName='...') write(' ...')
> 20 - self.pointing_
> 21 - text_entry.
> 22 - time.sleep(.3)
> 23 + self._focus_
> 24 self.keyboard.
>
> Replace this with something like
> text_field = self.select_
> text_field.
Hi! I didn't know TextField emulator existed, thanks for that. The component I am trying to interact with, is not a TextField, its a custom component used only in messaging-app I believe.
>
> 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.
I am not sure about the sleep, I did not add it, it was already there and is in a few other places as well, I will not remove since there was probably a reason for that.
> phone_num( self, num_or_contact, select=False):
> 29 + def type_contact_
>
> You need to explain that select argument in a docstring.
Added.
> press_and_ release( "Enter" )
> 45 + self.keyboard.
>
> Pressing Enter is something that you can't do from the phone, as a real user.
> Is there a button to click instead?
It was already there. Now that I poked through the app, the only way to lose focus in that field is by focusing the 'message' box, there is no other button in this page. We can go with that but I am not sure. contact_ from_list( self, name): root_instance( ).select_ single( istView' ) list.wait_ select_ single( b>{}</b> '.format( name)) device. click_object( list_item) stView and add a method
>
> 50 + def select_
> 51 + """Select the given contact from the list
> 52 +
> 53 + :parameter name: name of the contact
> 54 + """
> 55 +
> 56 + contact_list = self.get_
> 57 + 'ContactSimpleL
> 58 + list_item = contact_
> 59 + 'Label', text='<
> 60 + self.pointing_
>
> 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 ContactSimpleLi
> select_contact there.
>
> Let me know if you need any kind of help with this.
Done, thanks.
>
> The test you added is nice, thanks for that.
Thanks!