KEYCLOAK-17619 - Fix DefaultRolesTest

This commit is contained in:
Alfredo Boullosa 2021-03-30 13:03:14 +02:00 committed by Pavel Drozd
parent d9ebbe4958
commit 2f0f99c204
2 changed files with 8 additions and 1 deletions

View file

@ -32,6 +32,8 @@ public class RoleCompositeRoles extends Form {
protected Select availableRealmRolesSelect;
@FindBy(id = "assigned")
protected Select assignedRealmRolesSelect;
@FindBy(id = "realm-composite")
protected Select effectiveRealmRolesSelect;
@FindBy(id = "clients")
protected Select clientSelect;
@ -160,6 +162,11 @@ public class RoleCompositeRoles extends Form {
return UIUtils.selectContainsOption(assignedRealmRolesSelect, role);
}
public boolean isEffectiveRole(String role) {
waitUntilElement(By.id("realm-composite")).is().present();
return UIUtils.selectContainsOption(effectiveRealmRolesSelect, role);
}
public boolean isAssignedClientRole(String role) {
waitUntilElement(By.id("assigned")).is().present();
return UIUtils.selectContainsOption(assignedClientRolesSelect, role);

View file

@ -57,7 +57,7 @@ public class DefaultRolesTest extends AbstractRolesTest {
users.table().clickUser(newUser.getUsername());
userPage.tabs().roleMappings();
assertTrue(userRolesPage.form().isAssignedRole(defaultRoleName));
assertTrue(userRolesPage.form().isEffectiveRole(defaultRoleName));
}
public RolesResource rolesResource() {