Skip to content

Commit

Permalink
try with waitUntil in mail example
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 23, 2022
1 parent b09c7d6 commit 738ba90
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.forms.finder.SWTFormsBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -33,7 +34,18 @@ public static void beforeClass() throws Exception {

@Test
public void testExampleMail() {
bot.tree().getTreeItem("lorenzo@foobar").expand().getNode("Inbox").select();
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
System.out.println("*** expanding mail tree...");
bot.tree().getTreeItem("lorenzo@foobar").expand().getNode("Inbox").select();
return true;
}
@Override
public String getFailureMessage() {
return "Could not find tree";
}
});
bot.table().select(0);
SWTFormsBot formbot = new SWTFormsBot(bot.viewByTitle("Mail Message View").getWidget());
formbot.label("From");
Expand Down

0 comments on commit 738ba90

Please sign in to comment.