directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1797575 - /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
Date Sun, 04 Jun 2017 11:32:52 GMT
Author: seelmann
Date: Sun Jun  4 11:32:52 2017
New Revision: 1797575

URL: http://svn.apache.org/viewvc?rev=1797575&view=rev
Log:
Improve menu traversal, avoid 5 second delay

Modified:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java?rev=1797575&r1=1797574&r2=1797575&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
Sun Jun  4 11:32:52 2017
@@ -24,11 +24,11 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
 import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
 import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
 import org.eclipse.swtbot.swt.finder.results.VoidResult;
 import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
 import org.eclipse.ui.IViewReference;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
@@ -196,15 +196,16 @@ public class StudioBot
 
     public NewWizardBot openNewWizard()
     {
-        try
+        SWTBotMenu file = new SWTBot().menu( "File" );
+        if ( file.menuItems().contains( "New" ) )
         {
-            // In IDE
-            new SWTBot().menu( "File" ).menu( "New" ).menu( "Other..." ).click();
+            // In RCP application
+            file.menu( "New" ).menu( "Other..." ).click();
         }
-        catch ( WidgetNotFoundException wnfe )
+        else
         {
-            // In RCP application
-            new SWTBot().menu( "File" ).menu( "New..." ).click();
+            // In IDE
+            file.menu( "New..." ).click();
         }
         return new NewWizardBot();
     }



Mime
View raw message