You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2016/11/02 15:07:10 UTC

svn commit: r1767701 - /sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ui/sightly/SightlyAutocompletionTest.java

Author: rombert
Date: Wed Nov  2 15:07:10 2016
New Revision: 1767701

URL: http://svn.apache.org/viewvc?rev=1767701&view=rev
Log:
SLING-6231 - Sightly SWTBot tests are unstable 

SightlyAutocompletionTest - once we get the package explorer view use a
specific SWTBot instance for it, rather than the global one. This seems
to increase stability for me - no failures in 5 test runs ( mvn clean
verify ).

Modified:
    sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ui/sightly/SightlyAutocompletionTest.java

Modified: sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ui/sightly/SightlyAutocompletionTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ui/sightly/SightlyAutocompletionTest.java?rev=1767701&r1=1767700&r2=1767701&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ui/sightly/SightlyAutocompletionTest.java (original)
+++ sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ui/sightly/SightlyAutocompletionTest.java Wed Nov  2 15:07:10 2016
@@ -30,7 +30,9 @@ import org.eclipse.core.runtime.Path;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
 import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -101,13 +103,17 @@ public class SightlyAutocompletionTest {
             
             // create basic html file
             project.createOrUpdateFile(Path.fromOSString("jcr_root/index.html"), new ByteArrayInputStream("".getBytes()));
+
             Thread.sleep(1000); // TODO - wait for project to be registered in the UI
             
             // ensure that we get the tree from the project explorer
-            bot.viewByTitle("Project Explorer").setFocus();
+            SWTBotView projectExplorer = bot.viewByTitle("Project Explorer");
+            projectExplorer.setFocus();
             
+            SWTBotTree explorerTree = projectExplorer.bot().tree();
+
             // open editor
-            SWTBotTreeItem projectItem = bot.tree().expandNode(contentProject.getName());
+            SWTBotTreeItem projectItem = explorerTree.expandNode(contentProject.getName());
             // it seems that two 'jcr_root' nodes confuse SWTBot so we expand and navigate manually
             SWTBotTreeItem folderNode = projectItem.getItems()[0].expand();
             folderNode.getItems()[0].select().doubleClick();