@Test(groups = "Enterprise4.2", dependsOnMethods = "selectTaskDoneButtonTest") public void selectRejectButtonTest() throws Exception { SiteUtil.createSite(drone, modSiteName, "Moderated"); SiteDashboardPage sitePage = drone.getCurrentPage().render(); assertTrue(sitePage.isSiteTitle(modSiteName), "Site Dashboad page should be opened for - " + modSiteName); ShareUtil.logout(drone); DashBoardPage dash = loginAs(otherUser, "password"); siteFinder = dash.getNav().selectSearchForSites().render(); siteFinder = siteFinder.searchForSite(modSiteName).render(); siteFinder = SiteUtil.siteSearchRetry(drone, siteFinder, modSiteName); siteFinder.requestToJoinSite(modSiteName).render(); ShareUtil.logout(drone); dash = loginAs(testUserName, "password"); myTasksPage = dash.getNav().selectMyTasks().render(); pageUnderTest = myTasksPage.navigateToEditTaskPage("Request to join "+modSiteName+" site").render(); returnedPage = pageUnderTest.selectRejectButton().render(); assertTrue(returnedPage instanceof MyTasksPage, "The return page should be an instance of MyTasksPage page"); ShareUtil.logout(drone); }
public HtmlPage selectRejectButton() { try { WebElement rejectButton = drone.findAndWait(REJECT.by); String id = rejectButton.getAttribute("id"); drone.mouseOverOnElement(rejectButton); rejectButton.click(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return FactorySharePage.resolvePage(drone); } catch (NoSuchElementException nse) { throw new PageOperationException("Unable to find Reject button", nse); } }
EditTaskPage extends SharePage { public HtmlPage selectRejectButton() { try { WebElement rejectButton = drone.findAndWait(REJECT.by); String id = rejectButton.getAttribute("id"); drone.mouseOverOnElement(rejectButton); rejectButton.click(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return FactorySharePage.resolvePage(drone); } catch (NoSuchElementException nse) { throw new PageOperationException("Unable to find Reject button", nse); } } }
EditTaskPage extends SharePage { public HtmlPage selectRejectButton() { try { WebElement rejectButton = drone.findAndWait(REJECT.by); String id = rejectButton.getAttribute("id"); drone.mouseOverOnElement(rejectButton); rejectButton.click(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return FactorySharePage.resolvePage(drone); } catch (NoSuchElementException nse) { throw new PageOperationException("Unable to find Reject button", nse); } } EditTaskPage(WebDrone drone); }
EditTaskPage extends SharePage { public HtmlPage selectRejectButton() { try { WebElement rejectButton = drone.findAndWait(REJECT.by); String id = rejectButton.getAttribute("id"); drone.mouseOverOnElement(rejectButton); rejectButton.click(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return FactorySharePage.resolvePage(drone); } catch (NoSuchElementException nse) { throw new PageOperationException("Unable to find Reject button", nse); } } EditTaskPage(WebDrone drone); @SuppressWarnings("unchecked") @Override EditTaskPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override EditTaskPage render(); @SuppressWarnings("unchecked") @Override EditTaskPage render(final long time); HtmlPage selectStatusDropDown(TaskStatus status); TaskStatus getSelectedStatusFromDropDown(); HtmlPage selectTaskDoneButton(); HtmlPage selectRejectButton(); HtmlPage selectApproveButton(); HtmlPage selectSaveButton(); void enterComment(String comment); TaskInfo getTaskDetailsInfo(); List<TaskItem> getTaskItems(); List<TaskItem> getTaskItem(String fileName); List<TaskStatus> getStatusOptions(); HtmlPage selectCancelButton(); boolean isReAssignButtonDisplayed(); HtmlPage selectAcceptButton(); boolean isButtonsDisplayed(Button button); void selectItem(String fileName, String siteName); SelectContentPage clickAddItems(); ReassignPage clickReassign(); MyTasksPage selectReassign(String userName); EditTaskPage selectClaim(); boolean isCommentTextAreaDisplayed(); String readCommentFromCommentTextArea(); }
EditTaskPage extends SharePage { public HtmlPage selectRejectButton() { try { WebElement rejectButton = drone.findAndWait(REJECT.by); String id = rejectButton.getAttribute("id"); drone.mouseOverOnElement(rejectButton); rejectButton.click(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return FactorySharePage.resolvePage(drone); } catch (NoSuchElementException nse) { throw new PageOperationException("Unable to find Reject button", nse); } } EditTaskPage(WebDrone drone); @SuppressWarnings("unchecked") @Override EditTaskPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override EditTaskPage render(); @SuppressWarnings("unchecked") @Override EditTaskPage render(final long time); HtmlPage selectStatusDropDown(TaskStatus status); TaskStatus getSelectedStatusFromDropDown(); HtmlPage selectTaskDoneButton(); HtmlPage selectRejectButton(); HtmlPage selectApproveButton(); HtmlPage selectSaveButton(); void enterComment(String comment); TaskInfo getTaskDetailsInfo(); List<TaskItem> getTaskItems(); List<TaskItem> getTaskItem(String fileName); List<TaskStatus> getStatusOptions(); HtmlPage selectCancelButton(); boolean isReAssignButtonDisplayed(); HtmlPage selectAcceptButton(); boolean isButtonsDisplayed(Button button); void selectItem(String fileName, String siteName); SelectContentPage clickAddItems(); ReassignPage clickReassign(); MyTasksPage selectReassign(String userName); EditTaskPage selectClaim(); boolean isCommentTextAreaDisplayed(); String readCommentFromCommentTextArea();  }