public void assertUserRolesPage()
{
- assertPage( "Apache Archiva \\ [Admin] User Edit" );
- assertTextPresent( "[Admin] User Roles" );
- assertTextPresent( "Username" );
- assertTextPresent( "Full Name" );
+ //assertPage( "Apache Archiva \\ [Admin] User Edit" );
+ //[Admin] RĂ´les de l'utilisateur
+
+ assertTextPresent( "[Admin] User Roles", "[Admin] R\u00F4les de l'utilisateur" );
+ assertTextPresent( "Username", "Nom d'utilisateur" );
+ assertTextPresent( "Full Name", "Nom complet" );
String userRoles =
"Guest,Registered User,System Administrator,User Administrator,Global Repository Observer,Global Repository Manager,Repository Observer,Repository Manager,internal";
String[] arrayRole = userRoles.split( "," );
public void assertDeleteUserPage( String username )
{
- assertPage( "Apache Archiva \\ [Admin] User Delete" ); // TODO
- assertTextPresent( "[Admin] User Delete" );
+ assertTextPresent( "[Admin] User Delete", "[Admin] Suppression de l'utilisateur", "L'utilisateur suivant va \u00EAtre supprim\u00E9:" );
assertTextPresent( "The following user will be deleted:" );
- assertTextPresent( "Username: " + username );
- assertButtonWithValuePresent( "Delete User" );
+ assertTextPresent( "Username: " + username , "Nom d'utilisateur:" + username);
+ assertButtonWithIdPresent( "userDeleteSubmit" );
}
public void createUser( String userName, String fullName, String email, String password, boolean valid )
{
// login( getAdminUsername() , getAdminPassword() );
getSelenium().open( "/archiva/security/userlist.action" );
- clickButtonWithValue( "Create New User" );
+ clickButtonWithLocator( "userCreateButton", true );
+ //clickButtonWithValue( "Create New User" );
assertCreateUserPage();
setFieldValue( "user.username", userName );
setFieldValue( "user.fullName", fullName );
submit();
assertUserRolesPage();
- clickButtonWithValue( "Submit" );
+
+ //clickButtonWithValue( "Submit" );
+ clickButtonWithName( "submitRolesButton", true );
if ( valid )
{
public void assertCreateUserPage()
{
- assertPage( "Apache Archiva \\ [Admin] User Create" );
- assertTextPresent( "[Admin] User Create" );
- assertTextPresent( "Username*:" );
+ //assertPage( "Apache Archiva \\ [Admin] User Create" );
+ //assertTextPresent( "[Admin] User Create" );
+ assertTextPresent( "Username*:", "Nom d'utilisateur*:" );
assertElementPresent( "user.username" );
- assertTextPresent( "Full Name*:" );
+ assertTextPresent( "Full Name*:", "Nom complet*:" );
assertElementPresent( "user.fullName" );
- assertTextPresent( "Email Address*:" );
+ assertTextPresent( "Email Address*:", "Adresse email*:" );
assertElementPresent( "user.email" );
- assertTextPresent( "Password*:" );
+ assertTextPresent( "Password*:", "Mot de passe*:" );
assertElementPresent( "user.password" );
- assertTextPresent( "Confirm Password*:" );
+ assertTextPresent( "Confirm Password*:", "Confirmer le mot de passe*" );
assertElementPresent( "user.confirmPassword" );
- assertButtonWithValuePresent( "Create User" );
+ //assertButtonWithValuePresent( "Create User" );
+ //assertButtonWithIdPresent( "userCreateSubmit" );
+ assertElementNotPresent( "userCreateSubmit" );
}
public void assertLeftNavMenuWithRole( String role )
Assert.assertTrue( getSelenium().isTextPresent( text ), "'" + text + "' isn't present." );
}
+ /**
+ * one of text args must be in the page so use en and fr text (olamy use en locale :-) )
+ *
+ * @param texts
+ */
+ public void assertTextPresent( String... texts )
+ {
+ boolean present = false;
+ StringBuilder sb = new StringBuilder();
+ for ( String text : texts )
+ {
+ present = present || getSelenium().isTextPresent( text );
+ sb.append( " " + text + " " );
+ }
+ Assert.assertTrue( present, "'one of the following test " + sb.toString() + "' isn't present." );
+ }
+
public void assertTextNotPresent( String text )
{
Assert.assertFalse( getSelenium().isTextPresent( text ), "'" + text + "' is present." );
return isElementPresent( "//button[@id='" + text + "']" ) || isElementPresent( "//input[@id='" + text + "']" );
}
+ public void clickButtonWithName( String text, boolean wait )
+ {
+ clickLinkWithXPath( "//input[@name='" + text + "']", wait );
+ }
+
public void clickButtonWithValue( String text )
{
clickButtonWithValue( text, true );