Commit 0c3d4672 authored by Aurelien Pupier's avatar Aurelien Pupier
Browse files

BS-6749: add more logs and try unselecting tree before reselecting and

expanding in order to avoid possible cache issue
parent daafbe67
......@@ -15,6 +15,7 @@
package org.bonitasoft.studio.util.test.conditions;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
public class SelectNodeUnder implements ICondition {
......@@ -30,7 +31,8 @@ public class SelectNodeUnder implements ICondition {
}
public boolean test() throws Exception {
System.out.println("SelectNodeUnder.test");
System.out.println("SelectNodeUnder.test" + parentNode + " --> " + subNodeLabel);
bot.tree().unselect();
bot.tree().select(parentNode).expandNode(parentNode).select(subNodeLabel);
return bot.tree().selectionCount() > 0;
}
......@@ -40,6 +42,11 @@ public class SelectNodeUnder implements ICondition {
}
public String getFailureMessage() {
return "Cannot select tree item " + parentNode + " --> " + subNodeLabel;
final StringBuilder sb = new StringBuilder();
final SWTBotTreeItem[] allItems = bot.tree().getAllItems();
for (final SWTBotTreeItem swtBotTreeItem : allItems) {
sb.append(swtBotTreeItem.getText()).append("///");
}
return "Cannot select tree item " + parentNode + " --> " + subNodeLabel + " in :\n" + sb.toString();
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment