<ul id="roles-view-tabs" class="tabs">
<li class="active" id="roles-view-tabs-li-roles-grid">
- <a href="#roles-view">${$.i18n.prop('roles.grid.tab.title')}</a>
+ <a href="#roles-view" id="roles-view-tabs-a-roles-grid">${$.i18n.prop('roles.grid.tab.title')}</a>
</li>
<li id="roles-view-tabs-li-roles-edit">
<a href="#role-edit">${$.i18n.prop('edit')}</a>
<tr>
<td colspan="2">
<div class="pull-left">
- <button class="btn" data-bind="click: saveRoleDescription">${$.i18n.prop('save')}</button>
+ <button class="btn" id="role-edit-description-save" data-bind="click: saveRoleDescription">${$.i18n.prop('save')}</button>
</div>
</td>
</tr>
<tr>
{{each(j, columnDefinition) columns}}
{{var val = (typeof columnDefinition.rowText == 'function' ? columnDefinition.rowText(row) : row[columnDefinition.rowText])}}
- <td id="role-description-${val}">
+ <td id="role-${columnDefinition.rowText}-${row.name()}">
${val}
</td>
{{/each}}
- <td><a href="#" data-bind="click: function(){ window.redbackModel.rolesViewModel.editRole(row) }">Edit</a></td>
+ <td>
+ <a id="edit-role-${row.name()}" href="#" data-bind="click: function(){ window.redbackModel.rolesViewModel.editRole(row) }">${$.i18n.prop('edit')}</a>
+ </td>
</tr>
{{/each}}
</tbody>
<packaging>pom</packaging>
<name>Archiva Web :: Javascript Application Tests</name>
+ <properties>
+ <webappDirectory>${project.build.directory}/tomcat6x/webapps/archiva</webappDirectory>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
</dependencies>
<build>
<type>war</type>
</artifactItem>
</artifactItems>
- <outputDirectory>${project.build.directory}/tomcat6x/webapps/archiva</outputDirectory>
+ <outputDirectory>${webappDirectory}</outputDirectory>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
<path>/archiva</path>
<port>${container.test.port}</port>
<uriEncoding>UTF-8</uriEncoding>
- <warDirectory>${project.build.directory}/tomcat6x/webapps/archiva</warDirectory>
+ <warDirectory>${webappDirectory}</warDirectory>
<fork>true</fork>
<ignorePackaging>true</ignorePackaging>
<systemProperties>
--- /dev/null
+package org.apache.archiva.web.test;
+/*
+ * 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.
+ */
+
+import org.apache.archiva.web.test.parent.AbstractArchivaTest;
+import org.apache.commons.lang.StringUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @author Olivier Lamy
+ */
+@Test( groups = { "usermanagement" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
+public class RolesManagementTest
+ extends AbstractArchivaTest
+{
+ public void testReadRolesAndUpdateDescription()
+ throws Exception
+ {
+ clickLinkWithLocator( "menu-roles-list-a", true );
+ assertTextPresent( "Archiva System Administrator " );
+ Assert.assertTrue( StringUtils.isEmpty( getText( "role-description-Guest" ) ) );
+ clickLinkWithLocator( "edit-role-Guest" );
+ String desc = "The guest description";
+ setFieldValue( "role-edit-description", desc );
+ clickButtonWithLocator( "role-edit-description-save" );
+ clickLinkWithLocator( "roles-view-tabs-a-roles-grid" );
+ Assert.assertTrue( StringUtils.equals( desc, getText( "role-description-Guest" ) ) );
+ }
+}