@Test public void testDefaultGroups() { ProjectPermissionPageTab projectPermissionPage = jira.gotoLoginPage().loginAsSysAdmin(ProjectPermissionPageTab.class, PROJECT_HSP); assertEquals("Default Permission Scheme", projectPermissionPage.getSchemeName()); assertEquals( "This is the default Permission Scheme. Any new projects that are created will be assigned this scheme", projectPermissionPage.getSchemeDescription()); final List<PermissionGroup> permissionGroups = projectPermissionPage.getPermissionGroups(); assertEquals(6, permissionGroups.size()); assertTrue(projectPermissionPage.isSchemeLinked()); final EditPermissionScheme editPermissionScheme = projectPermissionPage.gotoScheme(); projectPermissionPage = editPermissionScheme.back(ProjectPermissionPageTab.class, PROJECT_HSP); assertEquals("Default Permission Scheme", projectPermissionPage.getSchemeName()); assertEquals( "This is the default Permission Scheme. Any new projects that are created will be assigned this scheme", projectPermissionPage.getSchemeDescription()); assertTrue(projectPermissionPage.isSchemeChangeAvailable()); final SelectPermissionScheme selectPermissionScheme = projectPermissionPage.gotoSelectScheme(); selectPermissionScheme.setSchemeByName("Empty Scheme"); selectPermissionScheme.submit(); projectPermissionPage = jira.visit(ProjectPermissionPageTab.class, PROJECT_HSP); assertEquals("Empty Scheme", projectPermissionPage.getSchemeName()); assertEquals("", projectPermissionPage.getSchemeDescription()); }
@Test public void testProjectAdmin() { final ProjectPermissionPageTab projectPermissionPage = jira.gotoLoginPage() .login("project_admin", "project_admin", ProjectPermissionPageTab.class, PROJECT_HSP); assertEquals("Default Permission Scheme", projectPermissionPage.getSchemeName()); assertEquals( "This is the default Permission Scheme. Any new projects that are created will be assigned this scheme", projectPermissionPage.getSchemeDescription()); final List<PermissionGroup> permissionGroups = projectPermissionPage.getPermissionGroups(); assertEquals(6, permissionGroups.size()); // Assert the cog actions aren't present assertFalse(projectPermissionPage.isSchemeLinked()); assertFalse(projectPermissionPage.isSchemeChangeAvailable()); final ProjectSharedBy sharedBy = projectPermissionPage.getSharedBy(); assertFalse(sharedBy.isPresent()); }
@Test public void testNoPermissions() { final ProjectPermissionPageTab projectPermissionPage = jira.gotoLoginPage().loginAsSysAdmin(ProjectPermissionPageTab.class, "MKY"); assertEquals("Empty Scheme", projectPermissionPage.getSchemeName()); assertEquals("", projectPermissionPage.getSchemeDescription()); final List<PermissionGroup> permissionGroups = projectPermissionPage.getPermissionGroups(); assertEquals(6, permissionGroups.size()); for (PermissionGroup permissionGroup : permissionGroups) { final List<Permission> permissions = permissionGroup.getPermissions(); for (Permission permission : permissions) { assertTrue(permission.getEntities().isEmpty()); } } final ProjectSharedBy sharedBy = projectPermissionPage.getSharedBy(); assertFalse(sharedBy.isPresent()); }