expandNode delays [message #468499] |
Wed, 05 August 2009 13:02  |
Eclipse User |
|
|
|
I have some problems with expandNode needing more time to complete in the
following statement before the select(String) is executed. I've tried
adding in the extra .select().click(), but it still sometimes fails.
bot.tree().expandNode("C").select("C Project").click();
I suppose I could split it up and add an arbitrary wait(1000) after the
expandNode(String), but it seems to me it might be better if
SWTBotTreeItem#expandNode(String) could have some way to determine that
the expansion has completed.
Maybe if the expandNode("String") and select("String") implemented a
waitUntilWidgetAppears, similar to what has already been done for
SWTWorkbenchBot#viewByTitle(String), then we could count on whatever is
the global timeout delay for it to fail, and wouldn't have to put in a
bunch of arbitrary waits(1000) statements.
If we can't do the waitUntilWidgetAppears, maybe we could add in a
SWTBotTreeItem#wait(long) implementation that returns SWTBotTreeItem so we
can do the waits without breaking up the statements, like below.
bot.tree().expandNode("C").wait(1000).select("C Project").click();
|
|
|
Re: expandNode delays [message #472330 is a reply to message #468499] |
Wed, 05 August 2009 15:36   |
Eclipse User |
|
|
|
While looking at the expandNode problem, I tried out the recursive
expandNode
bot.tree().expandNode("C1",true).expandNode("Debug").select();
I tried to expand recursively the project explorer view tree for the small
Hello World Mingw C stationery project. I came back after lunch and it
was still executing the statement above in the test. I don't know if
there are circular references in that tree, or if it just has a bunch of
data.
Maybe we should have a version, expandNode(String, boolean, int depth),to
limit the recursion depth.
Anyway, this form is dangerous, but I can see the use for some recursive
form.
I'm also curious why there is no recursive form of expandNode for
SWTBotTreeItem.
|
|
|
Re: expandNode delays [message #477133 is a reply to message #472330] |
Wed, 05 August 2009 23:38   |
Eclipse User |
|
|
|
It is quite possible that the UI thread froze up. Would you have any
logs at the time this happened. I doubt a hello world program would have
so much content in it that it is still scratching its head after you
come from lunch.
--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
On 6/8/09 01:06, Jay Norwood wrote:
> While looking at the expandNode problem, I tried out the recursive
> expandNode
>
> bot.tree().expandNode("C1",true).expandNode("Debug").select();
>
> I tried to expand recursively the project explorer view tree for the
> small Hello World Mingw C stationery project. I came back after lunch
> and it was still executing the statement above in the test. I don't know
> if there are circular references in that tree, or if it just has a bunch
> of data.
>
> Maybe we should have a version, expandNode(String, boolean, int
> depth),to limit the recursion depth.
> Anyway, this form is dangerous, but I can see the use for some recursive
> form.
>
> I'm also curious why there is no recursive form of expandNode for
> SWTBotTreeItem.
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: expandNode delays [message #479411 is a reply to message #479133] |
Mon, 10 August 2009 18:04  |
Eclipse User |
|
|
|
One additional improvement to the recursive expand is to turn off the
playback delay duringthe expand, since otherwise the playback delay gets
executed for every node that expands during the recursion, and can get
very long. I've included this in the latest proposal in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286055
public SWTBotTreeItem run() {
SWTBotTreeItem item;
long oldDelay = SWTBotPreferences.PLAYBACK_DELAY;
SWTBotPreferences.PLAYBACK_DELAY = 0;
try {
item = getTreeItem(nodeText);
item.widget.getParent().setRedraw(false);
expandNode(item);
item.widget.getParent().setRedraw(true);
} catch (WidgetNotFoundException e) {
throw new RuntimeException(e);
}
SWTBotPreferences.PLAYBACK_DELAY = oldDelay;
return item;
}
|
|
|
Powered by
FUDForum. Page generated in 0.06298 seconds