]> source.dussan.org Git - archiva.git/commitdiff
a few repository test workflow + update selenium
authorskygo <skygo@unknown>
Wed, 5 Mar 2014 01:07:27 +0000 (01:07 +0000)
committerskygo <skygo@unknown>
Wed, 5 Mar 2014 01:07:27 +0000 (01:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1574275 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-test/pom.xml
archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java [new file with mode: 0644]

index e9be5d987ed0450476cf124194a849d378813d4f..f5d5580732b6169bc4ca1d0ab70cf40469c2bdf8 100644 (file)
@@ -36,7 +36,8 @@
     <maxWaitTimeInMs>10000</maxWaitTimeInMs>
 
     <seleniumPluginVersion>2.3</seleniumPluginVersion>
-    <selenium-server.version>2.37.1</selenium-server.version>
+    <selenium-server.version>2.40.0</selenium-server.version>
+    <fluentlenium.version>0.9.2</fluentlenium.version>
   </properties>
 
   <dependencies>
@@ -84,7 +85,7 @@
     <dependency>
       <groupId>org.fluentlenium</groupId>
       <artifactId>fluentlenium-festassert</artifactId>
-      <version>0.9.1</version>
+      <version>${fluentlenium.version}</version>
       <scope>test</scope>
     </dependency>
 
@@ -96,7 +97,7 @@
     <dependency>
       <groupId>org.fluentlenium</groupId>
       <artifactId>fluentlenium-core</artifactId>
-      <version>0.9.1</version>
+      <version>${fluentlenium.version}</version>
       <scope>test</scope>
     </dependency>
 
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
new file mode 100644 (file)
index 0000000..7bdca22
--- /dev/null
@@ -0,0 +1,83 @@
+package org.apache.archiva.web.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.web.test.parent.AbstractArchivaTest;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Based on LoginTest of Emmanuel Venisse test.
+ *
+ * @author skygo
+ *
+ */
+
+
+public class RepositoryAdminTest
+    extends AbstractArchivaTest
+{
+
+    @Test
+    public void testManagedRepository()
+    {
+        login( getAdminUsername(), getAdminPassword() );
+        clickLinkWithLocator( "menu-repositories-list-a", true );
+        
+        // add custom repo
+        assertTextPresent( "Repositories Administration " );
+        clickLinkWithXPath( "//a[@href='#remote-repositories-content']", true );
+        
+        clickLinkWithXPath( "//a[@href='#remote-repository-edit']", true );
+        
+        setFieldValue( "id", "myrepoid" );        
+        setFieldValue( "name", "My repo name" );        
+        setFieldValue( "url", "http://www.repo.org" );
+        
+        clickButtonWithLocator( "remote-repository-save-button", true );
+       
+        clickLinkWithLocator( "menu-proxy-connectors-list-a", true );
+        
+        // proxy connect
+        assertTextPresent( "Proxy Connectors" );
+        assertTextPresent( "central" );
+        assertTextNotPresent( "myrepoid" );
+        clickButtonWithLocator( "proxy-connectors-view-tabs-a-edit", true );
+        getSelenium().select( "sourceRepoId", "internal" );
+        getSelenium().select( "targetRepoId", "myrepoid" );
+        clickButtonWithLocator( "proxy-connector-btn-save", true);
+        assertTextPresent( "central" );
+        assertTextPresent( "myrepoid" );
+        clickLinkWithXPath( "//i[contains(concat(' ',normalize-space(@class),' '),' icon-resize-vertical ')]/../..", true );
+        assertTextPresent( "internal" );
+        // order test
+        Assert.assertTrue( "First repo is myrepo",getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[1]" ).contains( "myrepoid" ));
+        Assert.assertTrue( "Second repo is central",getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[2]" ).contains( "central" ));
+             
+        // works until this point
+        /*getSelenium().mouseDown( "xpath=//div[@id='proxy-connector-edit-order-div']/div[1]" );
+        getSelenium().mouseMove( "xpath=//div[@id='proxy-connector-edit-order-div']/div[2]" );
+        getSelenium().mouseUp( "xpath=//div[@id='proxy-connector-edit-order-div']/div[last()]" );
+        Assert.assertTrue( "Second repo is myrepo", getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[2]" ).contains( "myrepoid" ));
+        Assert.assertTrue( "First repo is central", getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[1]" ).contains( "central" ));
+        */
+    }
+    
+}
\ No newline at end of file