All component behaviors in Pivot are invoked by public APIs. So, from
your examples, you could do:
button.requestFocus();
button.press();
listView.setSelectedIndex(0);
menuItem.press();
textInput.setText("foo");
We don't currently allow a caller to simulate mouse clicks via a Pivot
API, though you might be able to do so from the DisplayHost.
An automated testing framework for Pivot would certainly be valuable,
though I personally don't see it as a high priority in the short term.
However, you are more than welcome to pursue it if it is something
that interests you.
On Sep 23, 2009, at 3:34 AM, Sandro Martini wrote:
Hi to all,
an idea to discuss with all the team ... what do you think on the
ability for Pivot Applications / Applets to be scripted from the
outside world ?
I'm thinking on something like Macros in Office and other programs ...
for example the ability to sent pivot the same events that usually are
sent inside the application/applet with keyboard and mouse. Like set
focus to an element, select an element in a list or in a menu, set
text in a field, etc ... and maybe also simulate mouse clicks at some
positions.
This could be very useful for automatic testing, there are some
applications that works in this way (i think FEST but I'm not sure it
works in this way :-) , or others). And also for testing performances
of applications without (real) user interaction.
In browser we can script if with Javascript, from the Browser, ok ...
but i don't know if we can do all these things.
And for Applications ?
My trouble here is to verify the infrastructure needed for this, if
it's already in Pivot, or if something has to be added/modified (if we
think it's useful).
Then, a test / tutorial could be interesting.
Add in JIRA (for the 1.5) ?
Comments ?
Thanks,
Sandro