Author: jlukas(a)redhat.com
Date: 2011-07-18 12:27:41 -0400 (Mon, 18 Jul 2011)
New Revision: 33024
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WsWizardBase.java
Log:
guard tests against lost focus
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java 2011-07-18
16:02:15 UTC (rev 33023)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java 2011-07-18
16:27:41 UTC (rev 33024)
@@ -42,11 +42,13 @@
}
public WebServiceWizard setServiceType(Service_Type type) {
+ setFocus();
bot().comboBoxWithLabel("Web service
type:").setSelection(type.getDescription());
return this;
}
public Service_Type getServiceType() {
+ setFocus();
String s = bot().comboBoxWithLabel("Web service type:").getText();
return s.startsWith("Bottom up") ? Service_Type.BOTTOM_UP :
Service_Type.TOP_DOWN;
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WsWizardBase.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WsWizardBase.java 2011-07-18
16:02:15 UTC (rev 33023)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WsWizardBase.java 2011-07-18
16:27:41 UTC (rev 33024)
@@ -43,8 +43,9 @@
}
public WsWizardBase setSource(String s) {
+ setFocus();
SWTBotCombo c = bot().comboBoxWithLabel(getSourceComboLabel());
- c.typeText(s);
+ c.setText(s);
return this;
}
@@ -61,6 +62,7 @@
protected abstract String getSourceComboLabel();
protected WsWizardBase setServerRuntime(String name, int idx) {
+ setFocus();
findLink("Server runtime:").get(idx).click();
SWTBotShell sh = bot().activeShell();
SWTBotTree tree = sh.bot().treeInGroup("Server runtime:");
@@ -71,6 +73,8 @@
}
protected WsWizardBase setWebServiceRuntime(String name, int idx) {
+ setFocus();
+ sleep(100);
findLink("Web service runtime:").get(idx).click();
sleep(100);
SWTBotShell sh = bot().activeShell();
@@ -83,6 +87,8 @@
}
protected WsWizardBase setTargetProject(String label, String name) {
+ setFocus();
+ sleep(100);
findLink(label).get(0).click();
SWTBotShell sh = bot().activeShell();
SWTBotCombo c = sh.bot().comboBoxWithLabel(label);
@@ -111,6 +117,7 @@
//second panel
public WsWizardBase setPackageName(String pkg) {
+ setFocus();
bot().textWithLabel("Package name").typeText(pkg);
return this;
}
@@ -120,6 +127,7 @@
}
private List<SWTBotHyperlinkExt> findLink(String text) {
+ setFocus();
List<? extends Hyperlink> widgets =
bot().widgets(WidgetMatcherFactory.widgetOfType(Hyperlink.class));
List<SWTBotHyperlinkExt> ret = new ArrayList<SWTBotHyperlinkExt>();
for (Hyperlink h : widgets) {
@@ -131,6 +139,7 @@
}
private SWTBotScaleExt scale(int i) {
+ setFocus();
List<? extends Scale> widgets =
bot().widgets(WidgetMatcherFactory.widgetOfType(Scale.class));
List<SWTBotScaleExt> ret = new ArrayList<SWTBotScaleExt>();
for (Scale s : widgets) {
Show replies by date