SDK AP Emulator function for TextField should wait for object creation
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_
"""Set timer preset name
:param name: timer preset name
"""
name_label = self.wait_
if name_label.text != name:
raise ClockEmulatorEx
Here balloons and I have noticed that the test fails at this function if the following statement is not added,
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.
Changed in ubuntu-ui-toolkit: | |
status: | New → Confirmed |
tags: | added: elopio qa-new |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | New → Confirmed |
no longer affects: | ubuntu-ui-toolkit |
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.