GNOME Bugzilla – Bug 578644
Provide a means to wait for an event from an object
Last modified: 2011-02-05 00:48:23 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!
This is fixed with hasstate API: hasstate(self, window_name, object_name, state, guiTimeOut = 0) Please reopen, if the expected behavior is different. Thanks