fixed UI tests broken by KEYCLOAK-1431

This commit is contained in:
Tomas Kyjovsky 2015-06-11 14:15:05 +02:00
parent 30359b51fa
commit 08f2b0dea9
3 changed files with 89 additions and 90 deletions

View file

@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.keycloak.testsuite.ui.fragment; package org.keycloak.testsuite.ui.fragment;
import org.jboss.arquillian.drone.api.annotation.Drone; import org.jboss.arquillian.drone.api.annotation.Drone;
@ -133,8 +132,10 @@ public class Navigation {
openPage(themesLink, "Settings"); openPage(themesLink, "Settings");
} }
public void roleMappings() { public void roleMappings(String username) {
openPage(usersRoleMappings, "User"); String usernameCapitalized = Character.toUpperCase(username.charAt(0))
+ username.substring(1);
openPage(usersRoleMappings, usernameCapitalized);
} }
public void addRealm() { public void addRealm() {

View file

@ -3,7 +3,6 @@
* To change this template file, choose Tools | Templates * To change this template file, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
package org.keycloak.testsuite.ui.test.role; package org.keycloak.testsuite.ui.test.role;
import org.jboss.arquillian.graphene.findby.FindByJQuery; import org.jboss.arquillian.graphene.findby.FindByJQuery;
@ -21,7 +20,6 @@ import org.keycloak.testsuite.ui.page.settings.user.UserPage;
import static org.openqa.selenium.By.id; import static org.openqa.selenium.By.id;
import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.Select;
/** /**
* *
* @author Petr Mensik * @author Petr Mensik
@ -83,7 +81,7 @@ public class AddNewRoleTest extends AbstractKeyCloakTest<RolesPage> {
navigation.users(); navigation.users();
userPage.showAllUsers(); userPage.showAllUsers();
userPage.goToUser("admin"); userPage.goToUser("admin");
navigation.roleMappings(); navigation.roleMappings("Admin");
Select rolesSelect = new Select(driver.findElement(id("available"))); Select rolesSelect = new Select(driver.findElement(id("available")));
assertEquals("User role should be present in admin role mapping", assertEquals("User role should be present in admin role mapping",
role.getName(), rolesSelect.getOptions().get(0).getText()); role.getName(), rolesSelect.getOptions().get(0).getText());

View file

@ -40,7 +40,7 @@ public class RoleMappingsTest extends AbstractKeyCloakTest<RoleMappingsPage> {
navigation.users(); navigation.users();
userPage.findUser(testUsername); userPage.findUser(testUsername);
driver.findElement(linkText(testUsername)).click(); driver.findElement(linkText(testUsername)).click();
navigation.roleMappings(); navigation.roleMappings(testUsername);
page.addAvailableRole("create-realm"); page.addAvailableRole("create-realm");
assertTrue(flashMessage.getText(), flashMessage.isSuccess()); assertTrue(flashMessage.getText(), flashMessage.isSuccess());
@ -58,7 +58,7 @@ public class RoleMappingsTest extends AbstractKeyCloakTest<RoleMappingsPage> {
navigation.users(); navigation.users();
userPage.findUser(testUsername); userPage.findUser(testUsername);
driver.findElement(linkText(testUsername)).click(); driver.findElement(linkText(testUsername)).click();
navigation.roleMappings(); navigation.roleMappings(testUsername);
page.addAvailableRole("create-realm"); page.addAvailableRole("create-realm");
assertTrue(flashMessage.getText(), flashMessage.isSuccess()); assertTrue(flashMessage.getText(), flashMessage.isSuccess());