Author: vpakan(a)redhat.com
Date: 2011-08-18 12:11:49 -0400 (Thu, 18 Aug 2011)
New Revision: 34058
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
Log:
Fixes for Mac Os
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2011-08-18
16:02:36 UTC (rev 34057)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2011-08-18
16:11:49 UTC (rev 34058)
@@ -300,6 +300,8 @@
*/
public static void runProjectOnServer(SWTWorkbenchBot bot, String projectName){
+ bot.shells()[0].activate();
+
SWTBotTree packageExplorerTree = eclipse.showView(ViewType.PACKAGE_EXPLORER).tree();
packageExplorerTree.setFocus();
@@ -595,4 +597,11 @@
return SWTJBTExt.selectTextInSourcePane(bot, editorTitle, textToSelect,
selectionOffset, selectionLength, 0);
}
+ /**
+ * Returns true when test is running on Mac OS
+ * @return
+ */
+ public static boolean isRunningOnMacOs(){
+ return Platform.getOS().equalsIgnoreCase("macosx");
+ }
}
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2011-08-18
16:02:36 UTC (rev 34057)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2011-08-18
16:11:49 UTC (rev 34058)
@@ -5,6 +5,7 @@
import java.util.Iterator;
import org.apache.log4j.Logger;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
@@ -141,8 +142,13 @@
* @return
*/
public SWTBot preferenceOpen(IPreference pref) {
- bot.menu("Window").menu("Preferences").click();
- SWTBotShell shell = bot.shell("Preferences");
+ if (SWTJBTExt.isRunningOnMacOs()){
+ bot.shells()[0].pressShortcut(SWT.COMMAND, ',');
+ }
+ else{
+ bot.menu("Window").menu("Preferences").click();
+ }
+ SWTBotShell shell = bot.shell("Preferences");
shell.activate();
selectTreeNode(pref);
return shell.bot();
Show replies by date