Author: ljelinko
Date: 2012-08-17 03:44:54 -0400 (Fri, 17 Aug 2012)
New Revision: 43084
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
Log:
Added wait for enabled menu item
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
===================================================================
---
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-17
07:44:34 UTC (rev 43083)
+++
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-17
07:44:54 UTC (rev 43084)
@@ -1,7 +1,11 @@
package org.jboss.tools.portlet.ui.bot.matcher.perspective;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.jboss.tools.ui.bot.ext.gen.IPerspective;
/**
@@ -21,6 +25,12 @@
@Override
public void perform() {
+ getBot().waitUntil(widgetIsEnabled(getBot().menu("Window")),
TaskDuration.NORMAL.getTimeout());
SWTBotFactory.getOpen().perspective(perspective);
}
+
+ @Override
+ public SWTBot getBot() {
+ return SWTBotFactory.getBot();
+ }
}
Show replies by date