assertTextPresent( "Artifact 'delete:delete:1.0' was successfully deleted from repository 'internal'" );
}
- @Test( alwaysRun = true )
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactNoGroupId()
{
deleteArtifact( " ", "delete", "1.0", "internal" );
assertTextPresent( "You must enter a groupId." );
}
- @Test( alwaysRun = true )
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactNoArtifactId()
{
deleteArtifact( "delete", " ", "1.0", "internal" );
assertTextPresent( "You must enter an artifactId." );
}
- @Test( alwaysRun = true)
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactNoVersion()
{
deleteArtifact( "delete", "delete", " ", "internal" );
assertTextPresent( "You must enter a version." );
}
- @Test( alwaysRun = true)
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactInvalidVersion()
{
deleteArtifact( "delete", "delete", "asdf", "internal" );
}
// HTML select should have the proper value, else it will cause a selenium error: Option with label 'customValue' not found
- @Test( alwaysRun = true)
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactInvalidValues()
{
deleteArtifact( "<> \\/~+[ ]'\"", "<> \\/~+[ ]'\"", "<>", "internal" );
"Artifact id must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
}
- @Test( alwaysRun = true)
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactInvalidGroupId()
{
deleteArtifact( "<> \\/~+[ ]'\"", "delete", "1.0", "internal" );
"Group id must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
}
- @Test( alwaysRun = true)
+ @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } )
public void testDeleteArtifactInvalidArtifactId()
{
deleteArtifact( "delete", "<> \\/~+[ ]'\"", "1.0", "internal" );
package org.apache.archiva.web.test.parent;
+import org.apache.archiva.web.test.XPathExpressionUtil;
+
import java.io.File;
import java.io.IOException;
-import org.apache.archiva.web.test.XPathExpressionUtil;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
public void goToLoginPage()
{
getSelenium().open( baseUrl );
- clickLinkWithLocator( "loginLink" );
+ // are we already logged in ?
+ if ( isElementPresent( "logoutLink" ) )
+ {
+ // so logout
+ clickLinkWithLocator( "logoutLink" );
+ clickLinkWithLocator( "loginLink" );
+ }
+ else if ( isElementPresent( "loginLink" ) )
+ {
+ clickLinkWithLocator( "loginLink" );
+ }
assertLoginPage();
}
"Guest,Registered User,System Administrator,User Administrator,Global Repository Observer,Global Repository Manager,Repository Observer,Repository Manager,internal";
String[] arrayRole = userRoles.split( "," );
for ( String userroles : arrayRole )
+ {
assertTextPresent( userroles );
+ }
}
public void assertDeleteUserPage( String username )
public void assertUserRoleCheckBoxPresent( String value )
{
getSelenium().isElementPresent(
- "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"
- + value + "']" );
+ "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='" + value
+ + "']" );
}
public void assertResourceRolesCheckBoxPresent( String value )
{
assertUserRoleCheckBoxPresent( value );
getSelenium().click(
- "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"
- + value + "']" );
+ "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='" + value
+ + "']" );
}
public void checkResourceRoleWithValue( String value )
"Find Artifact,Browse,Reports,User Management,User Roles,Appearance,Upload Artifact,Delete Artifact,Repository Groups,Repositories,Proxy Connectors,Legacy Support,Network Proxies,Repository Scanning";
String[] arrayMenu = navMenu.split( "," );
for ( String navmenu : arrayMenu )
+ {
assertLinkPresent( navmenu );
+ }
}
}
"Appearance,Organization Details,The logo in the top right of the screen is controlled by the following settings.,Organization Information,Name,URL,Logo URL";
String[] arrayAppearance = appearance.split( "," );
for ( String appear : arrayAppearance )
+ {
assertTextPresent( appear );
+ }
assertLinkPresent( "Edit" );
assertLinkPresent( "Change your appearance" );
}
public void goToHomePage()
{
- getSelenium().open( "");
+ getSelenium().open( "" );
}
+
// Upload Artifact
public void goToAddArtifactPage()
{
setFieldValue( "repository.id", identifier );
setFieldValue( "repository.name", name );
setFieldValue( "repository.location", directory );
- setFieldValue( "repository.indexDir", indexDirectory );
+ setFieldValue( "repository.indexDirectory", indexDirectory );
selectValue( "repository.layout", type );
- setFieldValue( "repository.refreshCronExpression", cron );
+ setFieldValue( "repository.cronExpression", cron );
setFieldValue( "repository.daysOlder", daysOlder );
setFieldValue( "repository.retentionCount", retentionCount );
// TODO
public void assertNetworkProxiesPage()
{
- assertPage( "Apache Archiva \\ Administration - Network Proxies" );
+ assertPage( "Apache Archiva \\ Administration - Network Proxies" );
assertTextPresent( "Administration - Network Proxies" );
assertTextPresent( "Network Proxies" );
assertLinkPresent( "Add Network Proxy" );
}
- public void addNetworkProxy( String identifier, String protocol, String hostname, String port, String username, String password )
+ public void addNetworkProxy( String identifier, String protocol, String hostname, String port, String username,
+ String password )
{
//goToNetworkProxiesPage();
clickLinkWithText( "Add Network Proxy" );
assertAddNetworkProxy();
- setFieldValue( "proxy.id" , identifier );
- setFieldValue( "proxy.protocol" , protocol );
- setFieldValue( "proxy.host" , hostname );
- setFieldValue( "proxy.port" , port );
- setFieldValue( "proxy.username" , username );
- setFieldValue( "proxy.password" , password );
+ setFieldValue( "proxy.id", identifier );
+ setFieldValue( "proxy.protocol", protocol );
+ setFieldValue( "proxy.host", hostname );
+ setFieldValue( "proxy.port", port );
+ setFieldValue( "proxy.username", username );
+ setFieldValue( "proxy.password", password );
clickButtonWithValue( "Save Network Proxy" );
}
public void assertLegacySupportPage()
{
- assertPage( "Apache Archiva \\ Administration - Legacy Support" );
- assertTextPresent( "Administration - Legacy Artifact Path Resolution" );
- assertTextPresent( "Path Mappings" );
- assertLinkPresent( "Add" );
+ assertPage( "Apache Archiva \\ Administration - Legacy Support" );
+ assertTextPresent( "Administration - Legacy Artifact Path Resolution" );
+ assertTextPresent( "Path Mappings" );
+ assertLinkPresent( "Add" );
}
- public void addLegacyArtifactPath( String path, String groupId, String artifactId, String version, String classifier, String type)
+ public void addLegacyArtifactPath( String path, String groupId, String artifactId, String version,
+ String classifier, String type )
{
assertAddLegacyArtifactPathPage();
- setFieldValue( "legacyArtifactPath.path" , path );
- setFieldValue( "groupId" , groupId );
- setFieldValue( "artifactId" , artifactId );
- setFieldValue( "version" , version );
- setFieldValue( "classifier" , classifier );
- setFieldValue( "type" , type );
+ setFieldValue( "legacyArtifactPath.path", path );
+ setFieldValue( "groupId", groupId );
+ setFieldValue( "artifactId", artifactId );
+ setFieldValue( "version", version );
+ setFieldValue( "classifier", classifier );
+ setFieldValue( "type", type );
clickButtonWithValue( "Add Legacy Artifact Path" );
}
{
assertPage( "Apache Archiva \\ Admin: Add Legacy Artifact Path" );
assertTextPresent( "Admin: Add Legacy Artifact Path" );
- assertTextPresent( "Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary." );
- String element = "addLegacyArtifactPath_legacyArtifactPath_path,addLegacyArtifactPath_groupId,addLegacyArtifactPath_artifactId,addLegacyArtifactPath_version,addLegacyArtifactPath_classifier,addLegacyArtifactPath_type";
+ assertTextPresent(
+ "Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary." );
+ String element =
+ "addLegacyArtifactPath_legacyArtifactPath_path,addLegacyArtifactPath_groupId,addLegacyArtifactPath_artifactId,addLegacyArtifactPath_version,addLegacyArtifactPath_classifier,addLegacyArtifactPath_type";
String[] arrayElement = element.split( "," );
for ( String arrayelement : arrayElement )
- assertElementPresent( arrayelement );
+ {
+ assertElementPresent( arrayelement );
+ }
assertButtonWithValuePresent( "Add Legacy Artifact Path" );
}
setFieldValue( "repository.id", identifier );
setFieldValue( "repository.name", name );
setFieldValue( "repository.location", directory );
- setFieldValue( "repository.indexDir", indexDirectory );
+ setFieldValue( "repository.indexDirectory", indexDirectory );
selectValue( "repository.layout", type );
- setFieldValue( "repository.refreshCronExpression", cron );
+ setFieldValue( "repository.cronExpression", cron );
setFieldValue( "repository.daysOlder", daysOlder );
setFieldValue( "repository.retentionCount", retentionCount );
checkField( "stageNeeded" );