@Test(groups = "Hybrid", dependsOnMethods = "isNoItemsFoundMessageDisplayed") public void isUserFound() { Assert.assertFalse(assignmentPage.isUserFound("RandomUserString")); Assert.assertTrue(assignmentPage.isUserFound(cloudUserName)); List<String> userNames = new ArrayList<String>(); userNames.add(cloudUserName); assignmentPage.selectReviewers(userNames).render(); }
public boolean isUserFound(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("UserName cannot be null"); } try { List<WebElement> users = retrieveUsers(userName); for (WebElement user : users) { if (user.findElement(By.cssSelector(".item-name")).getText().contains("(" + userName + ")")) { return true; } } } catch (PageException pe) { } return false; }
AssignmentPage extends SharePage { public boolean isUserFound(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("UserName cannot be null"); } try { List<WebElement> users = retrieveUsers(userName); for (WebElement user : users) { if (user.findElement(By.cssSelector(".item-name")).getText().contains("(" + userName + ")")) { return true; } } } catch (PageException pe) { } return false; } }
AssignmentPage extends SharePage { public boolean isUserFound(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("UserName cannot be null"); } try { List<WebElement> users = retrieveUsers(userName); for (WebElement user : users) { if (user.findElement(By.cssSelector(".item-name")).getText().contains("(" + userName + ")")) { return true; } } } catch (PageException pe) { } return false; } AssignmentPage(WebDrone drone); }
AssignmentPage extends SharePage { public boolean isUserFound(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("UserName cannot be null"); } try { List<WebElement> users = retrieveUsers(userName); for (WebElement user : users) { if (user.findElement(By.cssSelector(".item-name")).getText().contains("(" + userName + ")")) { return true; } } } catch (PageException pe) { } return false; } AssignmentPage(WebDrone drone); @SuppressWarnings("unchecked") @Override AssignmentPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override AssignmentPage render(); @SuppressWarnings("unchecked") @Override AssignmentPage render(final long time); void selectUsers(List<String> userNames); @Deprecated void selectUserWithRetry(String userName); boolean selectUser(String userName); HtmlPage selectReviewers(List<String> userNames); void selectAssignee(String userName); void selectOKButton(); List<WebElement> retrieveUsers(String userName); void searchForUser(String userName); boolean isNoItemsFoundMessageDisplayed(String userName); boolean isUserFound(String userName); boolean isEnterASearchTermMessageDisplayed(); void clearSearchField(); void selectSearchButton(); String getWarningMessage(); String getContent(); List<String> getUserList(String userName); boolean isAddIconPresent(String userName); boolean isUserSelected(String userName); void removeUser(String userName); void removeUsers(List<String> userNames); void selectCloseButton(); void selectCancelButton(); }
AssignmentPage extends SharePage { public boolean isUserFound(String userName) { if (StringUtils.isEmpty(userName)) { throw new IllegalArgumentException("UserName cannot be null"); } try { List<WebElement> users = retrieveUsers(userName); for (WebElement user : users) { if (user.findElement(By.cssSelector(".item-name")).getText().contains("(" + userName + ")")) { return true; } } } catch (PageException pe) { } return false; } AssignmentPage(WebDrone drone); @SuppressWarnings("unchecked") @Override AssignmentPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override AssignmentPage render(); @SuppressWarnings("unchecked") @Override AssignmentPage render(final long time); void selectUsers(List<String> userNames); @Deprecated void selectUserWithRetry(String userName); boolean selectUser(String userName); HtmlPage selectReviewers(List<String> userNames); void selectAssignee(String userName); void selectOKButton(); List<WebElement> retrieveUsers(String userName); void searchForUser(String userName); boolean isNoItemsFoundMessageDisplayed(String userName); boolean isUserFound(String userName); boolean isEnterASearchTermMessageDisplayed(); void clearSearchField(); void selectSearchButton(); String getWarningMessage(); String getContent(); List<String> getUserList(String userName); boolean isAddIconPresent(String userName); boolean isUserSelected(String userName); void removeUser(String userName); void removeUsers(List<String> userNames); void selectCloseButton(); void selectCancelButton();  }