You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by br...@apache.org on 2010/03/04 03:00:16 UTC

svn commit: r918814 - in /archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test: ./ src/test/it-resources/appserver-base/conf/ src/test/resources/ src/test/testng/config/ src/test/testng/org/apache/archiva/web/test/ src/test/te...

Author: brett
Date: Thu Mar  4 02:00:16 2010
New Revision: 918814

URL: http://svn.apache.org/viewvc?rev=918814&view=rev
Log:
merge fixes to Selenium tests from trunk

Removed:
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/config/
Modified:
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/   (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/conf/archiva.xml
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/FindArtifactTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/UserRolesTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/listener/CaptureScreenShotsListener.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Mar  4 02:00:16 2010
@@ -0,0 +1,6 @@
+/archiva/branches/MRM-1025/archiva-modules/archiva-web/archiva-webapp-test:882046,882457,884741,885313-885314,892686,900344-915191
+/archiva/branches/MRM-541/archiva-modules/archiva-web/archiva-webapp-test:686983-687034
+/archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp-test:723609-726925
+/archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp-test:699795-705848
+/archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp-test:898632
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test:900342,909454-909456,915192-918810

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt Thu Mar  4 02:00:16 2010
@@ -13,7 +13,9 @@
 To remove the Cargo installations and re-download them next run, use:
   - mvn -Pclean-cargo clean
 
-For the default values in the scripts, to pass all the tests, you need to add an artifact in internal repository.
+Internet Explorer and Safari users must disable their popup blockers. Using *iexplore as
+the browser requires running as an Administrator on Windows 7/Vista, or alternatively you
+can use *iexploreproxy.
 
 Run Selenium tests in src/test/it with Maven and JUnit
   - mvn clean install -f junit-pom.xml

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/pom.xml?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/pom.xml (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/pom.xml Thu Mar  4 02:00:16 2010
@@ -148,9 +148,20 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <suiteXmlFiles>
-            <suiteXmlFile>src/test/testng/config/testng.xml</suiteXmlFile>
-          </suiteXmlFiles>
+          <properties>
+            <!--
+              Use this instead of suiteXmlFiles so that we can add the exclusion, as it is only accepted without suiteXmlFiles
+            -->
+            <property>
+              <name>listener</name>
+              <value>org.apache.archiva.web.test.listener.CaptureScreenShotsListener</value>
+            </property>
+            <property>
+              <name>excludegroups</name>
+              <!-- Exclude on all browsers but Firefox, as it is the only one that Selenium supports file uploads on -->
+              <value>${excluded.groups}</value>
+            </property>
+          </properties>
         </configuration>
         <executions>
           <execution>
@@ -165,7 +176,7 @@
                   <name>browser</name>
                   <value>${selenium.browser}</value>
                 </property>
-		<property>
+		            <property>
                   <name>baseUrl</name>
                   <value>${baseUrl}</value>
                 </property>
@@ -404,6 +415,7 @@
       </activation>
       <properties>
         <selenium.browser>*firefox</selenium.browser>
+        <excluded.groups />
       </properties>
     </profile>
     <profile>
@@ -416,6 +428,7 @@
       </activation>
       <properties>
         <selenium.browser>*iexplore</selenium.browser>
+        <excluded.groups>requiresUpload</excluded.groups>
       </properties>
     </profile>
     <profile>
@@ -428,6 +441,7 @@
       </activation>
       <properties>
         <selenium.browser>*safari</selenium.browser>
+        <excluded.groups>requiresUpload</excluded.groups>
       </properties>
     </profile>
     <profile>
@@ -440,6 +454,7 @@
       </activation>
       <properties>
         <selenium.browser>*custom ${browserPath}</selenium.browser>
+        <excluded.groups>requiresUpload</excluded.groups>
       </properties>
     </profile>
     <profile>

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/conf/archiva.xml
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/conf/archiva.xml?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/conf/archiva.xml (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/conf/archiva.xml Thu Mar  4 02:00:16 2010
@@ -1,3 +1,8 @@
 <configuration>
   <localRepository></localRepository>
+  <webapp>
+    <ui>
+      <appletFindEnabled>false</appletFindEnabled>
+    </ui>
+  </webapp>
 </configuration>

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties Thu Mar  4 02:00:16 2010
@@ -81,7 +81,7 @@
 SNAPSHOT_ARTIFACTID=archiva-test
 SNAPSHOT_VERSION=1.0-SNAPSHOT
 SNAPSHOT_PACKAGING=jar
-SNAPSHOT_ARTIFACTFILEPATH=test
+SNAPSHOT_ARTIFACTFILEPATH=src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar
 SNAPSHOT_REPOSITORYID=snapshots
 
 # REPOSITORIES

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java Thu Mar  4 02:00:16 2010
@@ -62,8 +62,8 @@
             String username = getProperty( "ADMIN_USERNAME" );
             String mail = getProperty( "ADMIN_EMAIL" );
             String password = getProperty( "ADMIN_PASSWORD" );
-            submitAdminData( fullname, mail, password );            
-            assertAuthenticatedPage( username );
+            submitAdminData( fullname, mail, password );
+            assertUserLoggedIn( username );
             submit();
             clickLinkWithText( "Logout" );
        }

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java Thu Mar  4 02:00:16 2010
@@ -83,24 +83,22 @@
 		assertTextPresent( "Please add a file to upload." );
 	}
 	
-    @Test( enabled = false )
+    @Test(groups = "requiresUpload")
 	public void testAddArtifactValidValues()
 	{
-		// TODO: disable test on non *chrome browsers, there is no way to do file uploads (SEL-63)
 		addArtifact( getGroupId() , "testAddArtifactValidValues", getVersion(), getPackaging() , getArtifactFilePath(), getRepositoryId() );
-		assertTextPresent( "Artifact 'test:test:1.0' was successfully deployed to repository 'internal'" );
+		assertTextPresent( "Artifact 'test:testAddArtifactValidValues:1.0' was successfully deployed to repository 'internal'" );
 	}
 		
 	//MRM-747
-    @Test( enabled = false )
+    @Test(groups = "requiresUpload")
 	public void testAddArtifactBlockRedeployments()
 	{
-            // TODO: disable test on non *chrome browsers, there is no way to do file uploads (SEL-63)
             addArtifact( getGroupId() , getArtifactId(), getVersion(), getPackaging() , getArtifactFilePath(), getRepositoryId() );
             assertTextPresent( "Overwriting released artifacts in repository '" + getRepositoryId() + "' is not allowed." );
 	}
 	
-    @Test( enabled = false )
+    @Test(groups = "requiresUpload")
 	public void testDeleteArtifact()
 	{
 		//prep

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java Thu Mar  4 02:00:16 2010
@@ -68,8 +68,7 @@
     }    
     
     // TODO: add test for adding via WebDAV
-    // TODO: disable if not running on *chrome
-    @Test (dependsOnMethods = { "testAddArtifactValidValues" }, enabled = false )
+    @Test (dependsOnMethods = { "testAddArtifactValidValues" }, groups = "requiresUpload")
     public void testViewAuditLogsDataFound()
     {
         goToAuditLogReports();        
@@ -82,15 +81,14 @@
         assertAuditLogsReportPage();
         assertTextPresent( "Results" );
         assertTextNotPresent( "No audit logs found." );
-        assertTextPresent( "test-1.0.jar" );
+        assertTextPresent( "testAddArtifactValidValues-1.0.jar" );
         assertTextPresent( "Uploaded File" );
         assertTextPresent( "internal" );
         assertTextPresent( "admin" );
     }
     
     // TODO: add test for adding via WebDAV
-    // TODO: disable if not running on *chrome
-    @Test (dependsOnMethods = { "testAddArtifactValidValues" }, enabled = false )
+    @Test (dependsOnMethods = { "testAddArtifactValidValues" }, groups = "requiresUpload")
     public void testViewAuditLogsOnlyArtifactIdIsSpecified()
     {
         goToAuditLogReports();        
@@ -101,17 +99,15 @@
         submit();
                 
         assertAuditLogsReportPage();
-        assertTextPresent( "Results" );
+        assertTextPresent( "If you specify an artifact ID, you must specify a group ID" );
+        assertTextNotPresent( "Results" );
         assertTextNotPresent( "No audit logs found." );
-        assertTextPresent( "test-1.0.jar" );
-        assertTextPresent( "Uploaded File" );
-        assertTextPresent( "internal" );
-        assertTextPresent( "admin" );
+        assertTextNotPresent( "testAddArtifactValidValues-1.0.jar" );
+        assertTextNotPresent( "Uploaded File" );
     }
     
     // TODO: add test for adding via WebDAV
-    // TODO: disable if not running on *chrome
-    @Test (dependsOnMethods = { "testAddArtifactValidValues" }, enabled = false )
+    @Test (dependsOnMethods = { "testAddArtifactValidValues" }, groups = "requiresUpload")
     public void testViewAuditLogsForAllRepositories()
     {
         goToAuditLogReports();        
@@ -123,13 +119,13 @@
         assertAuditLogsReportPage();
         assertTextPresent( "Results" );
         assertTextNotPresent( "No audit logs found." );
-        assertTextPresent( "test-1.0.jar" );
+        assertTextPresent( "testAddArtifactValidValues-1.0.jar" );
         assertTextPresent( "Uploaded File" );
         assertTextPresent( "internal" );
         assertTextPresent( "admin" );
     }
     
-    @Test (dependsOnMethods = { "testAddArtifactValidValues", "testUserWithRepoManagerInternalRole" }, enabled = false )
+    @Test (dependsOnMethods = { "testAddArtifactValidValues", "testUserWithRepoManagerInternalRole" }, groups = "requiresUpload")
     public void testViewAuditLogsViewAuditEventsForManageableRepositoriesOnly()
     {
         String groupId = getProperty( "SNAPSHOT_GROUPID" );
@@ -144,23 +140,23 @@
         
         clickLinkWithText( "Logout" );
                 
-        login( getProperty( "REPOMANAGER_INTERNAL_USERNAME" ), getUserRolePassword() );
-        goToAuditLogReports();        
+        login( getProperty( "REPOMANAGER_INTERNAL_USERNAME" ), getUserRoleNewPassword() );
+
+        goToAuditLogReports();
         assertAuditLogsReportPage();
-        
+
         selectValue( "repository", "all" );
         submit();
-        
+
         assertAuditLogsReportPage();
         assertTextPresent( "Results" );
         assertTextNotPresent( "No audit logs found." );
-        assertTextPresent( "test-1.0.jar" );
+        assertTextPresent( "testAddArtifactValidValues-1.0.jar" );
         assertTextPresent( "Uploaded File" );
         assertTextPresent( "internal" );
         assertTextPresent( "admin" );
-        
+
         assertTextNotPresent( artifactId + "-" + version + "." + packaging );
-        
         clickLinkWithText( "Logout" );
         login( getProperty( "ADMIN_USERNAME" ), getProperty( "ADMIN_PASSWORD" ) );
     }

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java Thu Mar  4 02:00:16 2010
@@ -45,13 +45,9 @@
 	}
 
     // MRM-1278
-    @Test( enabled = false )
+    @Test(groups = {"requiresUpload"})
     public void testCorrectRepositoryInBrowse()
     {
-        File artifact =
-            new File( getBasedir(),
-                      "/src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar" );                     
-                
         String releasesRepo = getProperty( "RELEASES_REPOSITORY" );
         
         // create releases repository first
@@ -64,10 +60,10 @@
         
         String snapshotsRepo = getProperty( "SNAPSHOTS_REPOSITORY" );
 
+        String path = "src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar";
         // TODO: do this differently as uploading doesn't work on browsers other than *chrome (below as well)
         // upload a snapshot artifact to repository 'releases'        
-        addArtifact( "archiva", "archiva-webapp", "1.0-SNAPSHOT", "jar", artifact.getPath(),
-                     releasesRepo );
+        addArtifact( "archiva", "archiva-webapp", "1.0-SNAPSHOT", "jar", path, releasesRepo );
         assertTextPresent( "Artifact 'archiva:archiva-webapp:1.0-SNAPSHOT' was successfully deployed to repository '" + releasesRepo + "'" );
 
         goToBrowsePage();
@@ -77,8 +73,7 @@
         assertArtifactInfoPage( "1.0-SNAPSHOT/", releasesRepo, "archiva", "archiva-webapp", "1.0-SNAPSHOT", "jar" );
 
         // upload a snapshot artifact to repository 'snapshots'        
-        addArtifact( "continuum", "continuum-core", "1.0-SNAPSHOT", "jar", artifact.getPath(),
-                     snapshotsRepo );
+        addArtifact( "continuum", "continuum-core", "1.0-SNAPSHOT", "jar", path, snapshotsRepo );
         assertTextPresent( "Artifact 'continuum:continuum-core:1.0-SNAPSHOT' was successfully deployed to repository '" + snapshotsRepo + "'" );
 
         goToBrowsePage();

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/FindArtifactTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/FindArtifactTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/FindArtifactTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/FindArtifactTest.java Thu Mar  4 02:00:16 2010
@@ -40,4 +40,6 @@
 		clickButtonWithValue( "Search" );
 		assertTextPresent( "No results found" );
 	}
+
+    // TODO: test using file upload on Firefox versions that support getAsBinary (ie, no applet)
 }

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/UserRolesTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/UserRolesTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/UserRolesTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/UserRolesTest.java Thu Mar  4 02:00:16 2010
@@ -34,8 +34,8 @@
 		
 		createUser( username, fullname, getUserEmail(), getUserRolePassword(), true);
 		deleteUser( username, fullname, getUserEmail() );
-		clickLinkWithText( "Logout" );
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	@Test (dependsOnMethods = { "testBasicAddDeleteUser" } )
@@ -49,20 +49,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	@Test (dependsOnMethods = { "testUserWithGuestRole" } )
@@ -76,20 +76,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	@Test (dependsOnMethods = { "testUserWithRegisteredUserRole" } )
@@ -103,20 +103,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	@Test (dependsOnMethods = { "testUserWithSysAdminUserRole" } )
@@ -130,20 +130,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	@Test (dependsOnMethods = { "testUserWithUserAdminUserRole" } )
@@ -157,20 +157,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 
 	@Test (dependsOnMethods = { "testUserWithGlobalRepoManagerRole" } )
@@ -184,20 +184,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	@Test (dependsOnMethods = { "testUserWithGlobalRepoObserverRole" } )
@@ -211,20 +211,20 @@
 		clickLinkWithText( "Edit Roles" );
 		checkResourceRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
 	
 	/*@Test (dependsOnMethods = { "testUserWithRepoManagerInternalRole" } )
@@ -265,46 +265,46 @@
 		clickLinkWithText( "Edit Roles" );
 		checkResourceRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
+
+        logout();
+        login(username, getUserRolePassword());
 		changePassword( getUserRolePassword(), getUserRoleNewPassword());
 		
 		// this section will be removed if issue from redback after changing password will be fixed.
 		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
+        logout();
+        //assertTextPresent("You are already logged in.");
 		
 		login(username, getUserRoleNewPassword());
 		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
+        logout();
+        login( getAdminUsername() , getAdminPassword() );
 	}
-	
-	/*@Test (dependsOnMethods = { "testUserWithRepoObserverInternalRole" } )
-	public void testUserWithRepoObserverSnapshotsRole()
-	{
-		username = getProperty( "REPOOBSERVER_SNAPSHOTS_USERNAME" );
-		fullname = getProperty( "REPOOBSERVER_SNAPSHOTS_FULLNAME" );
-		
-		createUser(username, fullname, getUserEmail(), getUserRolePassword(), true);
-		clickLinkWithText( username );
-		clickLinkWithText( "Edit Roles" );
-		checkResourceRoleWithValue( fullname );
-		clickButtonWithValue( "Submit" );
-		
-		clickLinkWithText("Logout");
-		login(username, getUserRolePassword());
-		changePassword( getUserRolePassword(), getUserRoleNewPassword());
-		
-		// this section will be removed if issue from redback after changing password will be fixed.
-		getSelenium().goBack();
-		clickLinkWithText("Logout");
-		//assertTextPresent("You are already logged in.");
-		
-		login(username, getUserRoleNewPassword());
-		assertLeftNavMenuWithRole( fullname );
-		clickLinkWithText("Logout");
-		login( getAdminUsername() , getAdminPassword() );
-	}*/
+
+    /*@Test (dependsOnMethods = { "testUserWithRepoObserverInternalRole" } )
+     public void testUserWithRepoObserverSnapshotsRole()
+     {
+         username = getProperty( "REPOOBSERVER_SNAPSHOTS_USERNAME" );
+         fullname = getProperty( "REPOOBSERVER_SNAPSHOTS_FULLNAME" );
+
+         createUser(username, fullname, getUserEmail(), getUserRolePassword(), true);
+         clickLinkWithText( username );
+         clickLinkWithText( "Edit Roles" );
+         checkResourceRoleWithValue( fullname );
+         clickButtonWithValue( "Submit" );
+
+         clickLinkWithText("Logout");
+         login(username, getUserRolePassword());
+         changePassword( getUserRolePassword(), getUserRoleNewPassword());
+
+         // this section will be removed if issue from redback after changing password will be fixed.
+         getSelenium().goBack();
+         clickLinkWithText("Logout");
+         //assertTextPresent("You are already logged in.");
+
+         login(username, getUserRoleNewPassword());
+         assertLeftNavMenuWithRole( fullname );
+         clickLinkWithText("Logout");
+         login( getAdminUsername() , getAdminPassword() );
+     }*/
 }

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/listener/CaptureScreenShotsListener.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/listener/CaptureScreenShotsListener.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/listener/CaptureScreenShotsListener.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/listener/CaptureScreenShotsListener.java Thu Mar  4 02:00:16 2010
@@ -75,7 +75,7 @@
         {
             selenium.windowMaximize();
             File fileName = new File( targetPath, fileBaseName + ".png" );
-            selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "" );
+            selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "background=#FFFFFF" );
         }
         catch ( RuntimeException e )
         {

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java Thu Mar  4 02:00:16 2010
@@ -1,6 +1,7 @@
 package org.apache.archiva.web.test.parent;
 
 import java.io.File;
+import java.io.IOException;
 
 import org.apache.archiva.web.test.XPathExpressionUtil;
 
@@ -117,8 +118,8 @@
 		submit();
         	if ( success )
         	{
-        	    	assertAuthenticatedPage( username );
-        	}
+                assertUserLoggedIn( username );
+            }
         	else
         	{
         	    assertLoginPage();
@@ -141,18 +142,8 @@
         	assertTextPresent( "Need an Account? Register!" );
         	assertTextPresent( "Forgot your Password? Request a password reset." );
 	}
-	
-	public void assertAuthenticatedPage( String username )
-	{
-		assertTextPresent( "Current User" );
-		assertTextPresent( "Edit Details" );
-		assertTextPresent( "Logout" );
-		assertTextNotPresent( "Login" );
-		assertTextPresent( username );
-	}
-	
-	
-	//User Management
+
+    //User Management
 	public void goToUserManagementPage()
 	{
 		clickLinkWithText( "User Management" );
@@ -277,6 +268,10 @@
 
             submitLoginPage( username, password, false, valid, assertReturnPage );
         }
+        if ( valid )
+        {
+            assertUserLoggedIn( username );
+        }
     }
     
     public void submitLoginPage( String username, String password )
@@ -303,10 +298,7 @@
 
         if ( validUsernamePassword )
         {
-            assertTextPresent( "Current User:" );
-            assertTextPresent( username );
-            assertLinkPresent( "Edit Details" );
-            assertLinkPresent( "Logout" );
+            assertUserLoggedIn( username );
         }
         else
         {
@@ -320,8 +312,17 @@
             }
         }
     }
-    
-	 // User Roles
+
+    protected void assertUserLoggedIn( String username )
+    {
+        assertTextPresent( "Current User:" );
+        assertTextPresent( username );
+        assertLinkPresent( "Edit Details" );
+        assertLinkPresent( "Logout" );
+        assertTextNotPresent( "Login" );
+    }
+
+    // User Roles
 	public void assertUserRoleCheckBoxPresent(String value) 
 	{
 		getSelenium()	.isElementPresent("xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"	+ value + "']");
@@ -417,11 +418,9 @@
 		assertPage( "Apache Archiva \\ Find Artifact" );
 		assertTextPresent( "Find Artifact" );
 		assertTextPresent( "Search for:" );
-		assertElementPresent( "f" );
 		assertTextPresent( "Checksum:" );
 		assertElementPresent( "q" );
 		assertButtonWithValuePresent( "Search" );
-		assertTextPresent( "This allows you to search the repository using the checksum of an artifact that you are trying to identify. You can either specify the checksum to look for directly, or scan a local artifact file." );
 	}
 	
 	//Appearance
@@ -495,7 +494,25 @@
             checkField( "generatePom" );
         }
 
-        setFieldValue( "artifact", artifactFilePath );
+        String path;
+        if ( artifactFilePath != null && artifactFilePath.trim().length() > 0 )
+        {
+            File f = new File( artifactFilePath );
+            try
+            {
+                path = f.getCanonicalPath();
+            }
+            catch ( IOException e )
+            {
+                path = f.getAbsolutePath();
+            }
+        }
+        else
+        {
+            path = artifactFilePath;
+        }
+
+        setFieldValue( "artifact", path );
         setFieldValue( "repositoryId", repositoryId );
 
         clickButtonWithValue( "Submit" );
@@ -534,4 +551,13 @@
     	//TODO	
     	clickButtonWithValue( "Add Repository" );
     }
+
+    protected void logout()
+    {
+        clickLinkWithText("Logout");
+        assertTextNotPresent( "Current User:" );
+        assertLinkNotPresent( "Edit Details" );
+        assertLinkNotPresent( "Logout" );
+        assertLinkPresent( "Login" );
+    }
 }

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java Thu Mar  4 02:00:16 2010
@@ -1,8 +1,6 @@
 package org.apache.archiva.web.test.parent;
 
-import java.io.File;
-
-public abstract class AbstractArtifactManagementTest 
+public abstract class AbstractArtifactManagementTest
 	extends AbstractArchivaTest
 {
 	
@@ -32,9 +30,7 @@
 	
 	public String getArtifactFilePath()
 	{
-		File f = new File( "" );
-		String artifactFilePath = f.getAbsolutePath();
-		return artifactFilePath + "/src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar" ;
+		return "src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar";
 	}
 	
 	public String getRepositoryId()
@@ -45,6 +41,7 @@
 	
 	public void goToDeleteArtifactPage()
 	{
+        login( getProperty( "ADMIN_USERNAME" ), getProperty( "ADMIN_PASSWORD" ) );
 		clickLinkWithText( "Delete Artifact" );
 		assertDeleteArtifactPage();
 	}

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java?rev=918814&r1=918813&r2=918814&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java (original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java Thu Mar  4 02:00:16 2010
@@ -26,14 +26,13 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Map.Entry;
-
-import org.apache.commons.io.IOUtils;
-import org.testng.Assert;
+import java.util.Properties;
 
 import com.thoughtworks.selenium.DefaultSelenium;
 import com.thoughtworks.selenium.Selenium;
+import org.apache.commons.io.IOUtils;
+import org.testng.Assert;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -176,7 +175,7 @@
 	
 	public void assertLinkPresent( String text )
 	{
-	   Assert.assertTrue( isElementPresent( "link=" + text ), "The link '" + text + "' isî't present." );
+	   Assert.assertTrue( isElementPresent( "link=" + text ), "The link '" + text + "' isn't present." );
 	}
 	
 	public void assertLinkNotPresent( String text )