Author: mes
Date: 2010-11-02 13:05:05 -0700 (Tue, 02 Nov 2010)
New Revision: 22684

Added:
   cytoscape/trunk/acceptance-testing/
   cytoscape/trunk/acceptance-testing/README
   cytoscape/trunk/acceptance-testing/pom.xml
   cytoscape/trunk/acceptance-testing/src/
   cytoscape/trunk/acceptance-testing/src/test/
   cytoscape/trunk/acceptance-testing/src/test/java/
   cytoscape/trunk/acceptance-testing/src/test/java/cytoscape/
   cytoscape/trunk/acceptance-testing/src/test/java/cytoscape/acceptance/
   
cytoscape/trunk/acceptance-testing/src/test/java/cytoscape/acceptance/FirstGUITest.java
Log:
first steps in automated acceptance testing

Added: cytoscape/trunk/acceptance-testing/README
===================================================================
--- cytoscape/trunk/acceptance-testing/README                           (rev 0)
+++ cytoscape/trunk/acceptance-testing/README   2010-11-02 20:05:05 UTC (rev 
22684)
@@ -0,0 +1,4 @@
+The intent of this directory is to contain a comprehensive set of
+AUTOMATED acceptance tests for Cytoscape.  The tests should run
+the full Cytoscape application and exercise as much core functionality
+as possible.

Added: cytoscape/trunk/acceptance-testing/pom.xml
===================================================================
--- cytoscape/trunk/acceptance-testing/pom.xml                          (rev 0)
+++ cytoscape/trunk/acceptance-testing/pom.xml  2010-11-02 20:05:05 UTC (rev 
22684)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>cytoscape</groupId>
+    <artifactId>parent</artifactId>
+    <version>2.8.0-beta3-SNAPSHOT</version>
+  </parent>
+
+  <groupId>cytoscape</groupId>
+  <artifactId>acceptance-testing</artifactId>
+  <packaging>jar</packaging>
+  <name>Cytoscape Acceptance Tests</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.easytesting</groupId>
+      <artifactId>fest-swing</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>cytoscape</groupId>
+      <artifactId>application</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.8.1</version>
+    </dependency>
+  </dependencies>
+
+</project>
+

Added: 
cytoscape/trunk/acceptance-testing/src/test/java/cytoscape/acceptance/FirstGUITest.java
===================================================================
--- 
cytoscape/trunk/acceptance-testing/src/test/java/cytoscape/acceptance/FirstGUITest.java
                             (rev 0)
+++ 
cytoscape/trunk/acceptance-testing/src/test/java/cytoscape/acceptance/FirstGUITest.java
     2010-11-02 20:05:05 UTC (rev 22684)
@@ -0,0 +1,67 @@
+package cytoscape.acceptance;
+
+import org.junit.Test; 
+import org.junit.Before; 
+import org.junit.After; 
+import org.fest.swing.fixture.FrameFixture;
+import org.fest.swing.edt.*;
+import org.fest.swing.timing.*;
+import org.fest.swing.core.matcher.*;
+
+import cytoscape.CyMain;
+import cytoscape.Cytoscape;
+import cytoscape.view.CytoscapeDesktop;
+
+public class FirstGUITest {
+
+       private FrameFixture desktop;
+
+       public FirstGUITest() {
+               FailOnThreadViolationRepaintManager.install();
+       }
+
+       @Before public void setUp() {
+               CytoscapeDesktop frame = GuiActionRunner.execute(new 
GuiQuery<CytoscapeDesktop>() {
+                       protected CytoscapeDesktop executeInEDT() {
+                               try {
+                               String[] args = new String[]{"-p","plugins"};
+                               new CyMain(args);  
+                               return Cytoscape.getDesktop();
+                               } catch (Exception e) {
+                                       e.printStackTrace();
+                                       return null;
+                               }
+                       }
+               });
+               desktop = new FrameFixture(frame);
+               desktop.show(); // shows the frame to test
+       }
+
+       @After 
+       public void tearDown() {
+               desktop.cleanUp();
+       }
+
+       /**
+        * Since starting Cytoscape takes a while, it's probably best
+        * to run many different tests as a single test case.  To maintain
+        * sanity, please add additional tests as separate method calls
+        * within this test case.
+        */
+       @Test 
+       public void runTests() {
+               openAndClosePluginManager(); 
+       }
+
+
+       private void openAndClosePluginManager() {
+               desktop.menuItemWithPath("Plugins","Manage Plugins")
+                      .click();
+               Pause.pause(5000);
+               desktop.dialog(DialogMatcher.withTitle("Manage Plugins"))
+                      .show()
+                      .button(JButtonMatcher.withText("Close"))
+                      .click();
+       }
+}
+

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to