@Test(groups = "Enterprise-only") public void testselectAction() throws Exception { UserSearchPage userPage = dashBoard.getNav().getUsersPage().render(); NewUserPage newPage = userPage.selectNewUser().render(); String userinfo = "user" + System.currentTimeMillis() + "@test.com"; newPage.createEnterpriseUserWithGroup(userinfo, userinfo, userinfo, userinfo, userinfo, groupName); GroupsPage page = dashBoard.getNav().getGroupsPage(); page = page.clickBrowse().render(); GroupsPage groupspage = page.selectGroup(groupName).render(); RemoveUserFromGroupPage removeUserFromGroupPage = groupspage.removeUser(userinfo).render(); removeUserFromGroupPage.selectAction(Action.No).render(); List<UserProfile> userProfiles = groupspage.getMembersList(); for (UserProfile userProfile : userProfiles) { if (userinfo.equals(userProfile.getfName())) { Assert.assertTrue(userProfile.getUsername().contains(userinfo)); break; } } RemoveUserFromGroupPage removeuserFromGroupPage = groupspage.removeUser(userinfo).render(); removeuserFromGroupPage.selectAction(Action.Yes).render(); List<UserProfile> userprofiles = groupspage.getMembersList(); for (UserProfile userprofile : userprofiles) { if (userinfo.equals(userprofile.getfName())) { Assert.assertFalse(userprofile.getUsername().contains(userinfo)); break; } } }
public HtmlPage selectAction(Action action) { try { List<WebElement> buttons = drone.findAll(By.cssSelector(".button-group span span button")); for (WebElement button : buttons) { if (action.name().equals(button.getText())) { button.click(); canResume(); return FactorySharePage.resolvePage(drone); } } } catch (NoSuchElementException nse) { throw new PageOperationException("not present in this page", nse); } throw new PageOperationException("not present in this page"); }
RemoveUserFromGroupPage extends SharePage { public HtmlPage selectAction(Action action) { try { List<WebElement> buttons = drone.findAll(By.cssSelector(".button-group span span button")); for (WebElement button : buttons) { if (action.name().equals(button.getText())) { button.click(); canResume(); return FactorySharePage.resolvePage(drone); } } } catch (NoSuchElementException nse) { throw new PageOperationException("not present in this page", nse); } throw new PageOperationException("not present in this page"); } }
RemoveUserFromGroupPage extends SharePage { public HtmlPage selectAction(Action action) { try { List<WebElement> buttons = drone.findAll(By.cssSelector(".button-group span span button")); for (WebElement button : buttons) { if (action.name().equals(button.getText())) { button.click(); canResume(); return FactorySharePage.resolvePage(drone); } } } catch (NoSuchElementException nse) { throw new PageOperationException("not present in this page", nse); } throw new PageOperationException("not present in this page"); } RemoveUserFromGroupPage(WebDrone drone); }
RemoveUserFromGroupPage extends SharePage { public HtmlPage selectAction(Action action) { try { List<WebElement> buttons = drone.findAll(By.cssSelector(".button-group span span button")); for (WebElement button : buttons) { if (action.name().equals(button.getText())) { button.click(); canResume(); return FactorySharePage.resolvePage(drone); } } } catch (NoSuchElementException nse) { throw new PageOperationException("not present in this page", nse); } throw new PageOperationException("not present in this page"); } RemoveUserFromGroupPage(WebDrone drone); @SuppressWarnings("unchecked") @Override RemoveUserFromGroupPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override RemoveUserFromGroupPage render(); @SuppressWarnings("unchecked") @Override RemoveUserFromGroupPage render(final long time); HtmlPage selectAction(Action action); String getTitle(); }
RemoveUserFromGroupPage extends SharePage { public HtmlPage selectAction(Action action) { try { List<WebElement> buttons = drone.findAll(By.cssSelector(".button-group span span button")); for (WebElement button : buttons) { if (action.name().equals(button.getText())) { button.click(); canResume(); return FactorySharePage.resolvePage(drone); } } } catch (NoSuchElementException nse) { throw new PageOperationException("not present in this page", nse); } throw new PageOperationException("not present in this page"); } RemoveUserFromGroupPage(WebDrone drone); @SuppressWarnings("unchecked") @Override RemoveUserFromGroupPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override RemoveUserFromGroupPage render(); @SuppressWarnings("unchecked") @Override RemoveUserFromGroupPage render(final long time); HtmlPage selectAction(Action action); String getTitle();  }