After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578644 - Provide a means to wait for an event from an object
Provide a means to wait for an event from an object
Status: RESOLVED FIXED
Product: LDTP
Classification: Other
Component: ldtp
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: Nagappan Alagappan
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2009-04-10 18:01 UTC by Willie Walker
Modified: 2011-02-05 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Willie Walker 2009-04-10 18:01:35 UTC
There is a waittillguiexist method that allows a test to wait until a GUI exists.  However, there are times where I'd like to wait until a specific object has focus or a caret has moved or a checkbox has changed state or an item in a table has been selected before moving on.  The typical usage pattern is to perform an action to make something change in the API (e.g., Press the <Tab> key to navigate somewhere) and then wait for the change to happen (e.g., a new text area gets focus as a result of the <Tab>).

These give me the opportunity to verify things have occurred in the UI and to also programmatically consult with external processes (e.g., the Orca screen reader) for things that they may have done in response to this event.

The "Macaroon" package that Eitan Isaacson wrote is something we use in the Orca regression test harness for this kind of thing:

http://svn.gnome.org/svn/accerciser/trunk/macaroon/

Macaroon allows you to express the wait operation via convenience methods such as the following:

WaitForFocus(acc_role=pyatspi.ROLE_TEXT)
WaitForWindowActivate("Panes",None)

But, it also allows you to wait for specific events:

WaitAction("object:state-changed:checked",
           None,
           None,
           pyatspi.ROLE_CHECK_BOX,
           5000)

It would be great if we could have similar mechanisms in LDTP to do this.  I believe the macaroon model is different from LDTP, however, so I wouldn't expect the mechanisms to be the same.

Thanks!
Comment 1 Nagappan Alagappan 2011-02-05 00:48:23 UTC
This is fixed with hasstate API:

hasstate(self, window_name, object_name, state, guiTimeOut = 0)

Please reopen, if the expected behavior is different.

Thanks