Author: rhopp
Date: 2012-02-21 05:39:54 -0500 (Tue, 21 Feb 2012)
New Revision: 38932
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java
Log:
Added Condition BrowserIsLoaded and some minor changes in IDELabel and JobList
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java 2012-02-21
10:39:54 UTC (rev 38932)
@@ -0,0 +1,50 @@
+package org.jboss.tools.ui.bot.ext.condition;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
+
+/**
+ * Returns false while the default page of given browser isn't loaded.
+ * Also closes "Security Warning" shell, if it opens during loading the page.
+ *
+ * @author rhopp
+ *
+ */
+
+public class BrowserIsLoaded implements ICondition {
+
+ SWTBot bot;
+ private SWTBotBrowserExt browser;
+
+ public BrowserIsLoaded(SWTBotBrowserExt browser){
+ super();
+ this.browser = browser;
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ //Trying whether the security window has appeared
+ try{
+ SWTBotShell shell = bot.shell("Security Warning");
+ shell.close();
+ }catch(WidgetNotFoundException wnfe){
+ }
+
+ return browser.isPageLoaded();
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+ browser.addProgressListenerToBrowser();
+ this.bot = bot;
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return null;
+ }
+
+}
Property changes on:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java 2012-02-21
10:08:35 UTC (rev 38931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotBrowserExt.java 2012-02-21
10:39:54 UTC (rev 38932)
@@ -246,4 +246,20 @@
"].value = \""+ text +"\";");
bot.sleep(Timing.time5S());
}
+
+ /**
+ * Useful when browser is runned with some page to load, because the ProgressListener
+ * isn't attached to the browserWidget, so this class can't recognize the
default
+ * page is loaded
+ */
+ public void addProgressListenerToBrowser(){
+ UIThreadRunnable.syncExec(new VoidResult() {
+
+ @Override
+ public void run() {
+ pl.setDone(false);
+ widget.addProgressListener(pl);
+ }
+ });
+ }
}
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2012-02-21
10:08:35 UTC (rev 38931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2012-02-21
10:39:54 UTC (rev 38932)
@@ -831,7 +831,7 @@
public static final String NEW_DYNAMIC_WEB_PROJECT = "New Dynamic Web
Project";
public static final String PROJECT_EXAMPLE = "Project Example";
public static final String NEW_JBOSS_PROJECT = "New JBoss Project";
- public static final String OPENSHIFT_APP_WIZARD = "OpenShift application
wizard";
+ public static final String OPENSHIFT_APP_WIZARD = "New OpenShift Express
Application";
}
public static class NewViewDialog{
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java 2012-02-21
10:08:35 UTC (rev 38931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java 2012-02-21
10:39:54 UTC (rev 38932)
@@ -16,5 +16,5 @@
public class JobLists {
public static String[] ignoredJobs = { "Process Console Input Job",
"Usage Data Event consumer",
- "Updating indexes","Reporting JBoss Developer Studio usage",
"Asking User to allow reporting" };
+ "Updating indexes","Reporting JBoss Developer Studio usage",
"Asking User to allow reporting", "Usage Data Event consumer" };
}
Show replies by date