@Test(groups="Enterprise-only", dependsOnMethods = "testAssignRole") public void testRemoveUser() throws Exception { siteMembersPage = siteMembersPage.removeUser(userName); Assert.assertNotNull(siteMembersPage); List<String> searchUsers = siteMembersPage.searchUser(userName); Assert.assertTrue(searchUsers.size() == 0); }
public SiteMembersPage removeUser(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("User Name is required."); } if (alfrescoVersion.isCloud()) { userName = userName.toLowerCase(); } try { WebElement element = drone.findAndWait(By.cssSelector("span[id$='_default-button-" + userName + "']>span>span>button")); String id = element.getAttribute("id"); element.click(); drone.waitUntilElementDeletedFromDom(By.id(id), maxPageLoadingTime); return new SiteMembersPage(getDrone()); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("User: \"" + userName + "\" can not be found in members list.", e); } } throw new PageException("User: \"" + userName + "\" can not be found in members list."); }
SiteMembersPage extends SharePage { public SiteMembersPage removeUser(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("User Name is required."); } if (alfrescoVersion.isCloud()) { userName = userName.toLowerCase(); } try { WebElement element = drone.findAndWait(By.cssSelector("span[id$='_default-button-" + userName + "']>span>span>button")); String id = element.getAttribute("id"); element.click(); drone.waitUntilElementDeletedFromDom(By.id(id), maxPageLoadingTime); return new SiteMembersPage(getDrone()); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("User: \"" + userName + "\" can not be found in members list.", e); } } throw new PageException("User: \"" + userName + "\" can not be found in members list."); } }
SiteMembersPage extends SharePage { public SiteMembersPage removeUser(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("User Name is required."); } if (alfrescoVersion.isCloud()) { userName = userName.toLowerCase(); } try { WebElement element = drone.findAndWait(By.cssSelector("span[id$='_default-button-" + userName + "']>span>span>button")); String id = element.getAttribute("id"); element.click(); drone.waitUntilElementDeletedFromDom(By.id(id), maxPageLoadingTime); return new SiteMembersPage(getDrone()); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("User: \"" + userName + "\" can not be found in members list.", e); } } throw new PageException("User: \"" + userName + "\" can not be found in members list."); } SiteMembersPage(WebDrone drone); }
SiteMembersPage extends SharePage { public SiteMembersPage removeUser(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("User Name is required."); } if (alfrescoVersion.isCloud()) { userName = userName.toLowerCase(); } try { WebElement element = drone.findAndWait(By.cssSelector("span[id$='_default-button-" + userName + "']>span>span>button")); String id = element.getAttribute("id"); element.click(); drone.waitUntilElementDeletedFromDom(By.id(id), maxPageLoadingTime); return new SiteMembersPage(getDrone()); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("User: \"" + userName + "\" can not be found in members list.", e); } } throw new PageException("User: \"" + userName + "\" can not be found in members list."); } SiteMembersPage(WebDrone drone); @SuppressWarnings("unchecked") @Override SiteMembersPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteMembersPage render(); @SuppressWarnings("unchecked") @Override SiteMembersPage render(final long time); SiteMembersPage renderWithUserSearchResults(final long time); SiteMembersPage renderWithUserSearchResults(); SiteMembersPage renderWithUserSearchResults(RenderTime timer); List<String> searchUser(String userName); SiteMembersPage assignRole(String userName, UserRole userRole); SiteMembersPage removeUser(String userName); boolean isUserCanBeRemoved(String userName, String siteName); InviteMembersPage selectInvitePeople(); PendingInvitesPage navigateToPendingInvites(); boolean isInviteLinkPresent(); boolean isPeopleLinkPresent(); boolean isGroupLinkPresent(); boolean isRemoveButtonPresent(String userName); SiteGroupsPage navigateToSiteGroups(); boolean isAssignRolePresent(String userName); boolean isUserHasRole(String userName, UserRole userRole); }
SiteMembersPage extends SharePage { public SiteMembersPage removeUser(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("User Name is required."); } if (alfrescoVersion.isCloud()) { userName = userName.toLowerCase(); } try { WebElement element = drone.findAndWait(By.cssSelector("span[id$='_default-button-" + userName + "']>span>span>button")); String id = element.getAttribute("id"); element.click(); drone.waitUntilElementDeletedFromDom(By.id(id), maxPageLoadingTime); return new SiteMembersPage(getDrone()); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("User: \"" + userName + "\" can not be found in members list.", e); } } throw new PageException("User: \"" + userName + "\" can not be found in members list."); } SiteMembersPage(WebDrone drone); @SuppressWarnings("unchecked") @Override SiteMembersPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteMembersPage render(); @SuppressWarnings("unchecked") @Override SiteMembersPage render(final long time); SiteMembersPage renderWithUserSearchResults(final long time); SiteMembersPage renderWithUserSearchResults(); SiteMembersPage renderWithUserSearchResults(RenderTime timer); List<String> searchUser(String userName); SiteMembersPage assignRole(String userName, UserRole userRole); SiteMembersPage removeUser(String userName); boolean isUserCanBeRemoved(String userName, String siteName); InviteMembersPage selectInvitePeople(); PendingInvitesPage navigateToPendingInvites(); boolean isInviteLinkPresent(); boolean isPeopleLinkPresent(); boolean isGroupLinkPresent(); boolean isRemoveButtonPresent(String userName); SiteGroupsPage navigateToSiteGroups(); boolean isAssignRolePresent(String userName); boolean isUserHasRole(String userName, UserRole userRole);  }