Bug 5239: Implemented proper wait when adding roles or permissions to a

user / removed Thread.sleep that is now obsolete
This commit is contained in:
Steffen Schaefer committed 2020-08-12 14:40:05 +02:00
1 parent 1efe7be458
commit fb6fda6bd4
3 files changed
+2 -10

No files matched your search

@@ -48,6 +48,7 @@ public class UserRoleDefinitionPanelPO extends PageArea {
public void addRole(String rolename, String groupname, String username) {
enterNewRoleValues(rolename, groupname, username);
clickAddButtonOrThrow();
waitUntil(() -> findRole(rolename + ":" + groupname + ":" + username) != null);
}
public void enterNewRoleValues(String rolename, String groupname, String username) {
@@ -43,6 +43,7 @@ public class WildcardPermissionPanelPO extends PageArea {
public void addPermission(String permissionName) {
enterNewPermissionValue(permissionName);
clickAddButtonOrThrow();
waitUntil(() -> findPermission(permissionName) != null);
}
public void enterNewPermissionValue(String permissionName) {
@@ -53,16 +53,6 @@ public class TestNegativeAcls extends AbstractSeleniumTest {
// user1 may only add other users' tenants to an ACL if this group is readable
// adding permission USER_GROUP:READ:* just makes all groups readable to user 1
userManagementPanel.grantPermissionToUser(USER1_NAME, USER_GROUP_READ_PERMISSION);
// FIXME hack to wait until the permission is saved -> please implement proper wait
// at the moment, user management panel loses selection when saving a permission
// this in fact prevents to wait for the permission to appear in the permission CellTable
// after the UI is changed to keep selection, we could easily implement this using a FluentWait
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
@Test