]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1164] Improve the Selenium tests
authorWendy Smoak <wsmoak@apache.org>
Tue, 12 May 2009 00:35:39 +0000 (00:35 +0000)
committerWendy Smoak <wsmoak@apache.org>
Tue, 12 May 2009 00:35:39 +0000 (00:35 +0000)
Submitted by: Marecor Baclay

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@773741 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/LoginTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactReportsTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractBrowseTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSearchTest.java
archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml

index 9c384fa03373904db7dbc19316148f06a92f009c..82e90928e4776bc563bb122670311acc27191723 100644 (file)
@@ -15,12 +15,19 @@ SELENIUM_BROWSER=*firefox
 # Search
 SEARCH_BAD_ARTIFACT=asdf
 # Existing Artifact
-ARTIFACT_GROUPID=test
-ARTIFACT_ARTIFACTID=test
+ARTIFACT_GROUPID=org.apache.maven.archiva.web.test
+ARTIFACT_ARTIFACTID=artifact-a
 ARTIFACT_VERSION=1.0
 ARTIFACT_PACKAGING=jar
 
 # Reports
 REPOSITORY_NAME=internal
 START_DATE=04/01/2009
-END_DATE=04/30/2009
\ No newline at end of file
+END_DATE=04/30/2009
+
+# User Management
+GUEST_USERNAME=guest_user
+GUEST_FULLNAME=Guest User
+GUEST_EMAIL=guest_user@localhost.localdomain
+GUEST_PASSWORD=guest12
+GUEST_PASSWORD1=guest123
\ No newline at end of file
index dca7c03d68d92351527342e1428ebb4556ddf67f..1ae6345f83f26865f73b8f9e43c91e200a6bbdcf 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.archiva.web.test;
  */
 
 import org.apache.archiva.web.test.parent.AbstractArchivaTest;
-import org.testng.Assert;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeSuite;
 import org.testng.annotations.BeforeTest;
@@ -30,16 +29,14 @@ import org.testng.annotations.Test;
 public class ArchivaAdminTest 
        extends AbstractArchivaTest
 {
-       @BeforeSuite
+    @BeforeSuite
     public void initializeContinuum()
         throws Exception
     {
         super.open();
-        System.out.println( "open" );
         getSelenium().open( baseUrl );
-        System.out.println( "URL" );
         String title = getSelenium().getTitle();
-        if ( title.equals( "Create Admin User" ) )
+        if ( title.equals( "Apache Archiva \\ Create Admin User" ) )
         {
             assertCreateAdmin();
             String fullname = p.getProperty( "ADMIN_FULLNAME" );
@@ -47,8 +44,6 @@ public class ArchivaAdminTest
             String mail = p.getProperty( "ADMIN_EMAIL" );
             String password = p.getProperty( "ADMIN_PASSWORD" );
             submitAdminData( fullname, mail, password );            
-            assertLoginPage();
-            submitUserData( username, password, false, true );
             assertAuthenticatedPage( username );
             submit();
             clickLinkWithText( "Logout" );
@@ -62,11 +57,13 @@ public class ArchivaAdminTest
     {
         super.open();
     }
+
+    
     public void displayLandingPage()
     {
-        getSelenium().open( baseUrl + "index.action" );
+        getSelenium().open( baseUrl );
         getSelenium().waitForPageToLoad( maxWaitTimeInMs );
-        Assert.assertEquals( "Apache Archiva \\ Quick Search", getSelenium().getTitle() );
+        assertPage( "Apache Archiva \\ Quick Search" );
     }
 
     @Override
index 72fa33d910a4fbd4025663f11a01b14d14eb2c12..bf27b808eb75532cc0bb6f450b1d4b6b1b629fa2 100644 (file)
@@ -42,4 +42,4 @@ public class BrowseTest
                assertTextPresent( "Artifacts" );
        }
 
-}
+}
\ No newline at end of file
index 334e2b9821eb28464b7ef996c1fc8295d46b137b..704086f9ba733935e0dc87bf7d0a7790308dc6e2 100644 (file)
@@ -100,4 +100,4 @@ public class ReportsTest
                //TODO As of the creation of the tests, GroupId is not a required field in showing the reports of repository health. GroupId should be required I think.
        }
        
-}
+}
\ No newline at end of file
index 0ac08e94142353d024a0759c0c665c0156b57908..ea4359ae06b025630608ef51de94985d966a9176 100644 (file)
@@ -25,7 +25,7 @@ public abstract class AbstractArchivaTest
 
        public void assertCreateAdmin()
        {
-                       assertPage( "Create Admin User" );
+                       assertPage( "Apache Archiva \\ Create Admin User" );
                        assertTextPresent( "Username" );
                assertFieldValue( "admin", "user.username" );
                        assertTextPresent( "Full Name*" );
@@ -42,7 +42,7 @@ public abstract class AbstractArchivaTest
        public void submitAdminData( String fullname, String email, String password )
        {
                setFieldValue( "user.fullName", fullname );
-               setFieldValue( "user.emaim", email );
+               setFieldValue( "user.email", email );
                setFieldValue( "user.password", password );
                        setFieldValue( "user.confirmPassword", password );
                submit();
index 279f073cf1627e0db805ee9498220d8993a13b04..f31f5dc7ee983de8a1c85360ebff4fa1c643cd29 100644 (file)
@@ -54,4 +54,4 @@ public abstract class AbstractSearchTest
         getSelenium().type( "dom=document.forms[1].elements[0]", artifactId );
         clickButtonWithValue( "Search" );
     }
-}
+}
\ No newline at end of file
index faa2847b63f69d743855ba38bf39a96e8dde5641..3b73486b64c6487815f86e8c704685928ea13a20 100644 (file)
     <dependency>
       <groupId>org.openqa.selenium.client-drivers</groupId>
       <artifactId>selenium-java-client-driver</artifactId>
-      <version>0.8.1</version>
+      <version>1.0-SNAPSHOT</version>
       <scope>test</scope>
+      <exclusions>
+       <exclusion>
+         <groupId>commons-logging</groupId>
+         <artifactId>commons-logging</artifactId>
+       </exclusion>
+      </exclusions>
     </dependency>
 
     <!-- Dependency for MavenConnectionTest -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>selenium-maven-plugin</artifactId>
-        <version>1.0-beta-1</version>
+        <version>1.0-rc-1</version>
         <executions>
           <execution>
             <id>start-selenium</id>
                       <fileset dir="src/test/${container.name}" />
                     </copy>
                     <copy
-                      todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.26/apache-tomcat-5.5.26/common/lib">
+                      todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.27/apache-tomcat-5.5.27/common/lib">
                       <fileset dir="${project.build.directory}/providedDependencies">
                         <include name="**/*.jar" />
                       </fileset>
       </activation>
       <properties>
         <container.name>tomcat5x</container.name>
-        <container.url>http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.26/bin/apache-tomcat-5.5.26.zip</container.url>
+        <container.url>http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.zip</container.url>
       </properties>
     </profile>
     <profile>