@Test(groups = "Enterprise-only") public void testClickButton() throws Exception { GroupsPage groupsPage = dashBoard.getNav().getGroupsPage(); groupsPage = groupsPage.clickBrowse().render(); NewGroupPage newGroupPage = groupsPage.navigateToNewGroupPage().render(); newGroupPage.createGroup(groupName, groupName, NewGroupPage.ActionButton.CREATE_GROUP).render(); groupsPage = drone.getCurrentPage().render(); DeleteGroupFromGroupPage deleteGroup = groupsPage.deleteGroup(groupName).render(); deleteGroup.clickButton(DeleteGroupFromGroupPage.Action.No); groupsPage = drone.getCurrentPage().render(); groupsPage.clickBrowse(); List<String> groups = groupsPage.getGroupList(); Assert.assertTrue(groups.contains(groupName)); deleteGroup = groupsPage.deleteGroup(groupName).render(); deleteGroup.clickButton(DeleteGroupFromGroupPage.Action.Yes).render(); groupsPage = drone.getCurrentPage().render(); Assert.assertFalse(groupsPage.isGroupPresent(groupName)); }
public HtmlPage clickButton(Action groupButton) { switch (groupButton) { case Yes: drone.findAndWait(By.cssSelector(DELETE_BUTTON)).click(); canResume(); return new GroupsPage(drone); case No: drone.findAndWait(By.cssSelector(CANCEL_BUTTON)).click(); canResume(); return new EditGroupPage(drone); } throw new PageException("Wrong Page"); }
DeleteGroupFromGroupPage extends SharePage { public HtmlPage clickButton(Action groupButton) { switch (groupButton) { case Yes: drone.findAndWait(By.cssSelector(DELETE_BUTTON)).click(); canResume(); return new GroupsPage(drone); case No: drone.findAndWait(By.cssSelector(CANCEL_BUTTON)).click(); canResume(); return new EditGroupPage(drone); } throw new PageException("Wrong Page"); } }
DeleteGroupFromGroupPage extends SharePage { public HtmlPage clickButton(Action groupButton) { switch (groupButton) { case Yes: drone.findAndWait(By.cssSelector(DELETE_BUTTON)).click(); canResume(); return new GroupsPage(drone); case No: drone.findAndWait(By.cssSelector(CANCEL_BUTTON)).click(); canResume(); return new EditGroupPage(drone); } throw new PageException("Wrong Page"); } DeleteGroupFromGroupPage(WebDrone drone); }
DeleteGroupFromGroupPage extends SharePage { public HtmlPage clickButton(Action groupButton) { switch (groupButton) { case Yes: drone.findAndWait(By.cssSelector(DELETE_BUTTON)).click(); canResume(); return new GroupsPage(drone); case No: drone.findAndWait(By.cssSelector(CANCEL_BUTTON)).click(); canResume(); return new EditGroupPage(drone); } throw new PageException("Wrong Page"); } DeleteGroupFromGroupPage(WebDrone drone); @SuppressWarnings("unchecked") @Override DeleteGroupFromGroupPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override DeleteGroupFromGroupPage render(); @SuppressWarnings("unchecked") @Override DeleteGroupFromGroupPage render(final long time); HtmlPage clickButton(Action groupButton); String getTitle(); }
DeleteGroupFromGroupPage extends SharePage { public HtmlPage clickButton(Action groupButton) { switch (groupButton) { case Yes: drone.findAndWait(By.cssSelector(DELETE_BUTTON)).click(); canResume(); return new GroupsPage(drone); case No: drone.findAndWait(By.cssSelector(CANCEL_BUTTON)).click(); canResume(); return new EditGroupPage(drone); } throw new PageException("Wrong Page"); } DeleteGroupFromGroupPage(WebDrone drone); @SuppressWarnings("unchecked") @Override DeleteGroupFromGroupPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override DeleteGroupFromGroupPage render(); @SuppressWarnings("unchecked") @Override DeleteGroupFromGroupPage render(final long time); HtmlPage clickButton(Action groupButton); String getTitle();  }