@Test(dependsOnMethods = "navigateSiteDashboard") public void selectMember() throws Exception { SiteMembersDashlet dashlet = siteDashBoard.getDashlet("site-members").render(); AlfrescoVersion version = drone.getProperties().getVersion(); String name = version.isCloud() ? loginName : "Administrator"; SiteMember siteMember = dashlet.selectMember(name); Assert.assertEquals(siteMember.getRole(), UserRole.MANAGER); SharePage page = siteMember.getShareLink().click().render(); assertNotNull(page); Assert.assertTrue(page.getPageTitle().contains("Profile")); }
public synchronized SiteMember selectMember(String emailId) { if (emailId == null) { throw new IllegalArgumentException("Name value of link is required"); } try { List<WebElement> userRowList = dashlet.findElements(By.cssSelector("div.person")); SiteMember siteMember = new SiteMember(); for (WebElement userRow : userRowList) { WebElement link = userRow.findElement(By.cssSelector("h3>a")); if (link.getText().contains(emailId) || ("admin".equals(emailId) && link.getText().equals("Administrator"))) { siteMember.setShareLink(new ShareLink(link, drone)); siteMember.setRole(UserRole.getUserRoleforName(userRow.findElement(By.cssSelector("div")).getText())); return siteMember; } } } catch(NoSuchElementException nse) { logger.error("Unabled to find the member css.", nse); } throw new PageOperationException("Could not find site member for name - " + emailId); }
SiteMembersDashlet extends AbstractDashlet implements Dashlet { public synchronized SiteMember selectMember(String emailId) { if (emailId == null) { throw new IllegalArgumentException("Name value of link is required"); } try { List<WebElement> userRowList = dashlet.findElements(By.cssSelector("div.person")); SiteMember siteMember = new SiteMember(); for (WebElement userRow : userRowList) { WebElement link = userRow.findElement(By.cssSelector("h3>a")); if (link.getText().contains(emailId) || ("admin".equals(emailId) && link.getText().equals("Administrator"))) { siteMember.setShareLink(new ShareLink(link, drone)); siteMember.setRole(UserRole.getUserRoleforName(userRow.findElement(By.cssSelector("div")).getText())); return siteMember; } } } catch(NoSuchElementException nse) { logger.error("Unabled to find the member css.", nse); } throw new PageOperationException("Could not find site member for name - " + emailId); } }
SiteMembersDashlet extends AbstractDashlet implements Dashlet { public synchronized SiteMember selectMember(String emailId) { if (emailId == null) { throw new IllegalArgumentException("Name value of link is required"); } try { List<WebElement> userRowList = dashlet.findElements(By.cssSelector("div.person")); SiteMember siteMember = new SiteMember(); for (WebElement userRow : userRowList) { WebElement link = userRow.findElement(By.cssSelector("h3>a")); if (link.getText().contains(emailId) || ("admin".equals(emailId) && link.getText().equals("Administrator"))) { siteMember.setShareLink(new ShareLink(link, drone)); siteMember.setRole(UserRole.getUserRoleforName(userRow.findElement(By.cssSelector("div")).getText())); return siteMember; } } } catch(NoSuchElementException nse) { logger.error("Unabled to find the member css.", nse); } throw new PageOperationException("Could not find site member for name - " + emailId); } protected  SiteMembersDashlet(WebDrone drone); }
SiteMembersDashlet extends AbstractDashlet implements Dashlet { public synchronized SiteMember selectMember(String emailId) { if (emailId == null) { throw new IllegalArgumentException("Name value of link is required"); } try { List<WebElement> userRowList = dashlet.findElements(By.cssSelector("div.person")); SiteMember siteMember = new SiteMember(); for (WebElement userRow : userRowList) { WebElement link = userRow.findElement(By.cssSelector("h3>a")); if (link.getText().contains(emailId) || ("admin".equals(emailId) && link.getText().equals("Administrator"))) { siteMember.setShareLink(new ShareLink(link, drone)); siteMember.setRole(UserRole.getUserRoleforName(userRow.findElement(By.cssSelector("div")).getText())); return siteMember; } } } catch(NoSuchElementException nse) { logger.error("Unabled to find the member css.", nse); } throw new PageOperationException("Could not find site member for name - " + emailId); } protected  SiteMembersDashlet(WebDrone drone); @SuppressWarnings("unchecked") SiteMembersDashlet render(); @SuppressWarnings("unchecked") @Override SiteMembersDashlet render(final long time); synchronized List<ShareLink> getMembers(); @SuppressWarnings("unchecked") synchronized SiteMembersDashlet render(RenderTime timer); synchronized SiteMember selectMember(String emailId); boolean isInviteLinkDisplayed(); boolean isAllMembersLinkDisplayed(); SiteMembersPage clickAllMembers(); SharePage clickOnUser(String userName); }
SiteMembersDashlet extends AbstractDashlet implements Dashlet { public synchronized SiteMember selectMember(String emailId) { if (emailId == null) { throw new IllegalArgumentException("Name value of link is required"); } try { List<WebElement> userRowList = dashlet.findElements(By.cssSelector("div.person")); SiteMember siteMember = new SiteMember(); for (WebElement userRow : userRowList) { WebElement link = userRow.findElement(By.cssSelector("h3>a")); if (link.getText().contains(emailId) || ("admin".equals(emailId) && link.getText().equals("Administrator"))) { siteMember.setShareLink(new ShareLink(link, drone)); siteMember.setRole(UserRole.getUserRoleforName(userRow.findElement(By.cssSelector("div")).getText())); return siteMember; } } } catch(NoSuchElementException nse) { logger.error("Unabled to find the member css.", nse); } throw new PageOperationException("Could not find site member for name - " + emailId); } protected  SiteMembersDashlet(WebDrone drone); @SuppressWarnings("unchecked") SiteMembersDashlet render(); @SuppressWarnings("unchecked") @Override SiteMembersDashlet render(final long time); synchronized List<ShareLink> getMembers(); @SuppressWarnings("unchecked") synchronized SiteMembersDashlet render(RenderTime timer); synchronized SiteMember selectMember(String emailId); boolean isInviteLinkDisplayed(); boolean isAllMembersLinkDisplayed(); SiteMembersPage clickAllMembers(); SharePage clickOnUser(String userName);  }