Author: ljelinko
Date: 2012-08-17 07:17:05 -0400 (Fri, 17 Aug 2012)
New Revision: 43091
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
Log:
Added code for activation of shell
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
===================================================================
---
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-17
11:14:44 UTC (rev 43090)
+++
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-17
11:17:05 UTC (rev 43091)
@@ -37,6 +37,7 @@
@Override
public void perform() {
+ activateWorkbenchShell();
log.info("Opening wizard");
log.info("All shells: ");
for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
@@ -46,6 +47,19 @@
new SWTBotNewObjectWizard().open(name, getGroupPath());
}
+ private void activateWorkbenchShell(){
+ SWTBotShell[] shells = getBot().shells();
+ if (shells.length == 1){
+ log.info("Only one shell present, assuming it's workbench and
activating");
+ shells[0].activate();
+ } else {
+ log.info("More than one shell present");
+ for (SWTBotShell shell : shells){
+ log.info(shell.getText());
+ }
+ }
+ }
+
private String[] getGroupPath() {
if (category == null){
return new String[0];