@Test(groups = "Enterprise-only", dependsOnMethods = "testsSearchUser") public void testClickAddUserButton() throws Exception { GroupsPage groupsPage = dashBoard.getNav().getGroupsPage(); groupsPage.clickBrowse(); drone.getCurrentPage().render(); groupsPage.selectGroup(groupName); AddUserGroupPage addUser = groupsPage.selectAddUser().render(); addUser.searchUser(user); addUser.clickAddUserButton(); groupsPage = drone.getCurrentPage().render(); groupsPage.clickBrowse(); groupsPage.selectGroup(groupName).render(); drone.getCurrentPage().render(); List<String> users = groupsPage.getUserList(); Assert.assertTrue(users.contains(user + " " + user + " (" + user + ")"), "Added user isn't displayed in a group"); }
public void clickAddUserButton() { try { WebElement addUserButton = drone.findAndWait(By.cssSelector(ADD_BUTTON)); if (addUserButton.isEnabled()) { addUserButton.click(); waitUntilAlert(); } else { throw new PageOperationException("Add User button is disabled"); } } catch (TimeoutException e) { throw new PageOperationException("Not found element is : " + ADD_BUTTON, e); } }
AddUserGroupPage extends ShareDialogue { public void clickAddUserButton() { try { WebElement addUserButton = drone.findAndWait(By.cssSelector(ADD_BUTTON)); if (addUserButton.isEnabled()) { addUserButton.click(); waitUntilAlert(); } else { throw new PageOperationException("Add User button is disabled"); } } catch (TimeoutException e) { throw new PageOperationException("Not found element is : " + ADD_BUTTON, e); } } }
AddUserGroupPage extends ShareDialogue { public void clickAddUserButton() { try { WebElement addUserButton = drone.findAndWait(By.cssSelector(ADD_BUTTON)); if (addUserButton.isEnabled()) { addUserButton.click(); waitUntilAlert(); } else { throw new PageOperationException("Add User button is disabled"); } } catch (TimeoutException e) { throw new PageOperationException("Not found element is : " + ADD_BUTTON, e); } } AddUserGroupPage(WebDrone drone); }
AddUserGroupPage extends ShareDialogue { public void clickAddUserButton() { try { WebElement addUserButton = drone.findAndWait(By.cssSelector(ADD_BUTTON)); if (addUserButton.isEnabled()) { addUserButton.click(); waitUntilAlert(); } else { throw new PageOperationException("Add User button is disabled"); } } catch (TimeoutException e) { throw new PageOperationException("Not found element is : " + ADD_BUTTON, e); } } AddUserGroupPage(WebDrone drone); @SuppressWarnings("unchecked") @Override AddUserGroupPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override AddUserGroupPage render(); @SuppressWarnings("unchecked") @Override AddUserGroupPage render(final long time); boolean isSearchButtonEnabled(); boolean isSearchFieldEnabled(); void clickAddUserButton(); AddUserGroupPage searchUser(String userName); HtmlPage clickClose(); }
AddUserGroupPage extends ShareDialogue { public void clickAddUserButton() { try { WebElement addUserButton = drone.findAndWait(By.cssSelector(ADD_BUTTON)); if (addUserButton.isEnabled()) { addUserButton.click(); waitUntilAlert(); } else { throw new PageOperationException("Add User button is disabled"); } } catch (TimeoutException e) { throw new PageOperationException("Not found element is : " + ADD_BUTTON, e); } } AddUserGroupPage(WebDrone drone); @SuppressWarnings("unchecked") @Override AddUserGroupPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override AddUserGroupPage render(); @SuppressWarnings("unchecked") @Override AddUserGroupPage render(final long time); boolean isSearchButtonEnabled(); boolean isSearchFieldEnabled(); void clickAddUserButton(); AddUserGroupPage searchUser(String userName); HtmlPage clickClose();  }