<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>
<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>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<!--
-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.
--->
-
-<suite name="ArchivaTest" verbose="1">
- <listeners>
- <listener class-name="org.apache.archiva.web.test.listener.CaptureScreenShotsListener"/>
- </listeners>
-
- <test name="AdminTest" enabled="true">
- <groups>
- <run>
- <include name="about" />
- <include name= "login" />
- <include name= "userroles" />
- <include name= "reposcan" />
- <include name= "artifactmanagement" />
- <include name= "search" />
- <include name= "auditlogsreport" />
- <include name= "browse" />
- <include name= "reports" />
- <include name= "virtualrepository" />
- <include name= "networkproxies" />
- <include name= "repository" />
- <include name= "appearance" />
- <include name= "findartifact" />
- <include name= "legacysupport" />
- <include name= "database" />
- </run>
- </groups>
- <packages>
- <package name="org.apache.archiva.web.test" />
- </packages>
- </test>
-</suite>
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
}
// 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();
}
// 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();
}
// 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();
assertTextPresent( "admin" );
}
- @Test (dependsOnMethods = { "testAddArtifactValidValues", "testUserWithRepoManagerInternalRole" }, enabled = false )
+ @Test (dependsOnMethods = { "testAddArtifactValidValues", "testUserWithRepoManagerInternalRole" }, groups = "requiresUpload")
public void testViewAuditLogsViewAuditEventsForManageableRepositoriesOnly()
{
String groupId = getProperty( "SNAPSHOT_GROUPID" );
}
// 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
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();
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();
{
selenium.windowMaximize();
File fileName = new File( targetPath, fileBaseName + ".png" );
- selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "" );
+ selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "background=#FFFFFF" );
}
catch ( RuntimeException e )
{
package org.apache.archiva.web.test.parent;
import java.io.File;
+import java.io.IOException;
import org.apache.archiva.web.test.XPathExpressionUtil;
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" );
package org.apache.archiva.web.test.parent;
-import java.io.File;
-
-public abstract class AbstractArtifactManagementTest
+public abstract class AbstractArtifactManagementTest
extends AbstractArchivaTest
{
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()