]> source.dussan.org Git - archiva.git/commitdiff
enable tests that only work on firefox, conditional on the firefox profile
authorBrett Porter <brett@apache.org>
Fri, 12 Feb 2010 11:02:02 +0000 (11:02 +0000)
committerBrett Porter <brett@apache.org>
Fri, 12 Feb 2010 11:02:02 +0000 (11:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@909354 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-test/pom.xml
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java

index 060823d689c2765e5e150ae1976a9185aeff56f9..8c4be3177272bae4f0318d3571cfde3c739b7444 100644 (file)
         <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 if you use
+              the 'all command line parameters' mode.
+            -->
+            <property>
+              <name>suitename</name>
+              <value>${basedir}/src/test/testng/config/testng.xml</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>
                   <name>browser</name>
                   <value>${selenium.browser}</value>
                 </property>
-               <property>
+                           <property>
                   <name>baseUrl</name>
                   <value>${baseUrl}</value>
                 </property>
       </activation>
       <properties>
         <selenium.browser>*firefox</selenium.browser>
+        <excluded.groups />
       </properties>
     </profile>
     <profile>
       </activation>
       <properties>
         <selenium.browser>*iexplore</selenium.browser>
+        <excluded.groups>requiresUpload</excluded.groups>
       </properties>
     </profile>
     <profile>
       </activation>
       <properties>
         <selenium.browser>*safari</selenium.browser>
+        <excluded.groups>requiresUpload</excluded.groups>
       </properties>
     </profile>
     <profile>
       </activation>
       <properties>
         <selenium.browser>*custom ${browserPath}</selenium.browser>
+        <excluded.groups>requiresUpload</excluded.groups>
       </properties>
     </profile>
     <profile>
index 1f60076bc913fbe7de55257ba9d522fdbaebe340..4bed5f57e8f3476230773b61c14eb2eb42d4d11f 100644 (file)
@@ -83,7 +83,7 @@ public class ArtifactManagementTest
                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)
@@ -92,7 +92,7 @@ public class ArtifactManagementTest
        }
                
        //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)
@@ -100,7 +100,7 @@ public class ArtifactManagementTest
             assertTextPresent( "Overwriting released artifacts in repository '" + getRepositoryId() + "' is not allowed." );
        }
        
-    @Test( enabled = false )
+    @Test(groups = "requiresUpload")
        public void testDeleteArtifact()
        {
                //prep
index 0f3dcc6c45572fd70087a6cbf7749d07f516de2c..5cdc9b55e1856b9a0d6549fdd913a928744a8d0c 100644 (file)
@@ -69,7 +69,7 @@ public class AuditLogsReportTest
     
     // 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();        
@@ -90,7 +90,7 @@ public class AuditLogsReportTest
     
     // 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();        
@@ -111,7 +111,7 @@ public class AuditLogsReportTest
     
     // 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();        
@@ -129,7 +129,7 @@ public class AuditLogsReportTest
         assertTextPresent( "admin" );
     }
     
-    @Test (dependsOnMethods = { "testAddArtifactValidValues", "testUserWithRepoManagerInternalRole" }, enabled = false )
+    @Test (dependsOnMethods = { "testAddArtifactValidValues", "testUserWithRepoManagerInternalRole" }, groups = "requiresUpload")
     public void testViewAuditLogsViewAuditEventsForManageableRepositoriesOnly()
     {
         String groupId = getProperty( "SNAPSHOT_GROUPID" );
index c9c60ecce05ea90af676bf3782a03d1618c59e0b..92b69fa05cfdf78a577896825468cc6a93647695 100644 (file)
@@ -45,7 +45,7 @@ public class BrowseTest
        }
 
     // MRM-1278
-    @Test( enabled = false )
+    @Test(groups = {"requiresUpload"})
     public void testCorrectRepositoryInBrowse()
     {
         File artifact =