use of org.keycloak.representations.idm.authorization.ScopeRepresentation in project keycloak by keycloak.
the class ScopeManagementTest method createScope.
private ScopeRepresentation createScope() {
ScopeRepresentation expected = new ScopeRepresentation();
expected.setName("Test Scope");
expected.setDisplayName("Test Scope Display Name");
authorizationPage.authorizationTabs().scopes().create(expected);
assertAlertSuccess();
assertScope(expected);
return expected;
}
use of org.keycloak.representations.idm.authorization.ScopeRepresentation in project keycloak by keycloak.
the class ResourceForm method populate.
public void populate(ResourceRepresentation expected) {
while (true) {
try {
WebElement e = driver.findElement(By.xpath("//button[@data-ng-click='deleteUri($index)']"));
e.click();
} catch (NoSuchElementException e) {
break;
}
}
UIUtils.setTextInputValue(name, expected.getName());
UIUtils.setTextInputValue(displayName, expected.getDisplayName());
UIUtils.setTextInputValue(type, expected.getType());
for (String uri : expected.getUris()) {
UIUtils.setTextInputValue(newUri, uri);
addUriButton.click();
}
UIUtils.setTextInputValue(iconUri, expected.getIconUri());
Set<ScopeRepresentation> scopes = expected.getScopes();
for (ScopeRepresentation scope : scopes) {
scopesInput.select(scope.getName());
}
Set<ScopeRepresentation> selection = scopesInput.getSelected();
for (ScopeRepresentation selected : selection) {
boolean isSelected = false;
for (ScopeRepresentation scope : scopes) {
if (selected.getName().equals(scope.getName())) {
isSelected = true;
break;
}
}
if (!isSelected) {
scopesInput.unSelect(selected.getName(), driver);
}
}
save();
}
use of org.keycloak.representations.idm.authorization.ScopeRepresentation in project keycloak by keycloak.
the class ScopeForm method toRepresentation.
public ScopeRepresentation toRepresentation() {
ScopeRepresentation representation = new ScopeRepresentation();
representation.setName(UIUtils.getTextInputValue(name));
representation.setDisplayName(UIUtils.getTextInputValue(displayName));
representation.setIconUri(UIUtils.getTextInputValue(iconUri));
return representation;
}
use of org.keycloak.representations.idm.authorization.ScopeRepresentation in project keycloak by keycloak.
the class Scopes method deleteFromList.
public void deleteFromList(String name) {
for (WebElement row : scopes().rows()) {
ScopeRepresentation actual = scopes().toRepresentation(row);
if (actual.getName().equalsIgnoreCase(name)) {
WebElement td = row.findElements(tagName("td")).get(2);
td.findElement(By.className("dropdown-toggle")).click();
WebElement actions = td.findElement(By.className("dropdown-menu"));
actions.findElement(By.linkText("Delete")).click();
modalDialog.confirmDeletion();
}
}
}
use of org.keycloak.representations.idm.authorization.ScopeRepresentation in project keycloak by keycloak.
the class Scopes method name.
public Scope name(String name) {
for (WebElement row : scopes().rows()) {
ScopeRepresentation actual = scopes().toRepresentation(row);
if (actual.getName().equalsIgnoreCase(name)) {
clickLink(row.findElements(tagName("a")).get(0));
WaitUtils.waitForPageToLoad();
return scope;
}
}
return null;
}
Aggregations