SDK AP Emulator function for TextField should wait for object creation

Bug #1289616 reported by Nekhelesh Ramananthan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

It seems that the TextField helper emulator function does not wait for object creation before proceeding to write text in the textfield. Here is an example from the clock app AP code,

def _set_timer_name(self, name):
        """Set timer preset name

        :param name: timer preset name

        """
        name_label = self.wait_select_single(
            LabelDots, objectName='namePreset')
        name_label.write(name)
        if name_label.text != name:
            raise ClockEmulatorException('Failed to write the timer name.')

Here balloons and I have noticed that the test fails at this function if the following statement is not added,

        name_label.visible.wait_for(True)

So basically I have to manually ensure that the textfield is visible (or loaded) before proceeding to write into the textfield. This is something I would expect the SDK emulator to handle.

Tags: elopio qa-new
Leo Arias (elopio)
Changed in ubuntu-ui-toolkit:
status: New → Confirmed
tags: added: elopio qa-new
Revision history for this message
Leo Arias (elopio) wrote :

I've been thinking about this, and it's probably not the role of the custom proxy object to wait for things to be visible, because a text field will not know by itself the context it is in and the action that will make it visible. It can be that it's waiting for data to load, or it needs to be swiped into view. So the caller is the one that should take care of calling write once the UI is ready to receive the input.

What we can do to improve many many things at once is to define a click method on the base class. And that click method will check if the center of the component is visible and enabled. If it is not, then it will raise a nicer error telling the tester to either wait for everything to load or swipe into view.

Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Zoltan Balogh (bzoltan)
no longer affects: ubuntu-ui-toolkit
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.