Author: rhopp
Date: 2012-02-01 07:56:05 -0500 (Wed, 01 Feb 2012)
New Revision: 38365
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
Log:
Added Twistie control to SWTBotExt
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2012-02-01
10:05:38 UTC (rev 38364)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2012-02-01
12:56:05 UTC (rev 38365)
@@ -37,11 +37,13 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.Twistie;
import org.hamcrest.Matcher;
import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotHyperlinkExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotScaleExt;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotTwistie;
import org.jboss.tools.ui.bot.ext.widgets.SWTBotSection;
/**
@@ -195,6 +197,19 @@
"Could not find widget of type Section", ex);
}
}
+
+ @SuppressWarnings("unchecked")
+ public SWTBotTwistie twistieByLabel(String label){
+ List<Twistie> list = (List<Twistie>)widgets(widgetOfType(Twistie.class));
+ SWTBotTwistie twistieBot = null;
+ for (Twistie twistie : list) {
+ twistieBot = new SWTBotTwistie(twistie);
+ if (twistieBot.getLabelText().equals(label)) return twistieBot;
+ }
+ //SWTBotTwistie twistie = new
SWTBotTwistie((Twistie)widget(allOf(widgetOfType(Twistie.class),
WidgetMatcherFactory.withLabel(label))));
+ //twistie.getId();
+ throw new WidgetNotFoundException("Widget of type Twistie with label
\""+label+"\" was not found");
+ }
/**
* Waits for shell with given title.
Show replies by date