@Test(dependsOnMethods = "testGetFolders") public void testSelectDestination() throws Exception { copyOrMoveContentPage = copyOrMoveContentPage.selectDestination(destinations.get(0)).render(); Assert.assertNotNull(copyOrMoveContentPage); }
public CopyOrMoveContentPage selectDestination(String destinationName) { if (StringUtils.isEmpty(destinationName)) { throw new IllegalArgumentException("Destination name is required"); } try { for (WebElement destination : drone.findAndWaitForElements(destinationListCss)) { if (destination.getText() != null) { if (destination.getText().equalsIgnoreCase(destinationName)) { destination.click(); if (destinationName.contains("Sites")) { drone.waitForElement(siteListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } else if ((destinationName.contains("Repository")) || (destinationName.contains("Shared Files")) || (destinationName.contains("My Files"))) { drone.waitForElement(folderPathElementId, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } return new CopyOrMoveContentPage(drone); } } } } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of destionation", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of destionations", e); } throw new PageOperationException("Unable to select Destination : " + destinationName); }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectDestination(String destinationName) { if (StringUtils.isEmpty(destinationName)) { throw new IllegalArgumentException("Destination name is required"); } try { for (WebElement destination : drone.findAndWaitForElements(destinationListCss)) { if (destination.getText() != null) { if (destination.getText().equalsIgnoreCase(destinationName)) { destination.click(); if (destinationName.contains("Sites")) { drone.waitForElement(siteListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } else if ((destinationName.contains("Repository")) || (destinationName.contains("Shared Files")) || (destinationName.contains("My Files"))) { drone.waitForElement(folderPathElementId, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } return new CopyOrMoveContentPage(drone); } } } } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of destionation", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of destionations", e); } throw new PageOperationException("Unable to select Destination : " + destinationName); } }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectDestination(String destinationName) { if (StringUtils.isEmpty(destinationName)) { throw new IllegalArgumentException("Destination name is required"); } try { for (WebElement destination : drone.findAndWaitForElements(destinationListCss)) { if (destination.getText() != null) { if (destination.getText().equalsIgnoreCase(destinationName)) { destination.click(); if (destinationName.contains("Sites")) { drone.waitForElement(siteListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } else if ((destinationName.contains("Repository")) || (destinationName.contains("Shared Files")) || (destinationName.contains("My Files"))) { drone.waitForElement(folderPathElementId, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } return new CopyOrMoveContentPage(drone); } } } } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of destionation", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of destionations", e); } throw new PageOperationException("Unable to select Destination : " + destinationName); } CopyOrMoveContentPage(WebDrone drone); }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectDestination(String destinationName) { if (StringUtils.isEmpty(destinationName)) { throw new IllegalArgumentException("Destination name is required"); } try { for (WebElement destination : drone.findAndWaitForElements(destinationListCss)) { if (destination.getText() != null) { if (destination.getText().equalsIgnoreCase(destinationName)) { destination.click(); if (destinationName.contains("Sites")) { drone.waitForElement(siteListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } else if ((destinationName.contains("Repository")) || (destinationName.contains("Shared Files")) || (destinationName.contains("My Files"))) { drone.waitForElement(folderPathElementId, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } return new CopyOrMoveContentPage(drone); } } } } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of destionation", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of destionations", e); } throw new PageOperationException("Unable to select Destination : " + destinationName); } CopyOrMoveContentPage(WebDrone drone); @SuppressWarnings("unchecked") @Override CopyOrMoveContentPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override CopyOrMoveContentPage render(long time); @SuppressWarnings("unchecked") @Override CopyOrMoveContentPage render(); String getDialogTitle(); List<String> getDestinations(); List<String> getSites(); List<String> getFolders(); boolean isOkButtonPresent(); boolean isCancelButtonPresent(); HtmlPage selectOkButton(); HtmlPage selectCancelButton(); void selectCloseButton(); CopyOrMoveContentPage selectDestination(String destinationName); CopyOrMoveContentPage selectSite(String siteName); CopyOrMoveContentPage selectPath(String... folderPath); }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectDestination(String destinationName) { if (StringUtils.isEmpty(destinationName)) { throw new IllegalArgumentException("Destination name is required"); } try { for (WebElement destination : drone.findAndWaitForElements(destinationListCss)) { if (destination.getText() != null) { if (destination.getText().equalsIgnoreCase(destinationName)) { destination.click(); if (destinationName.contains("Sites")) { drone.waitForElement(siteListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } else if ((destinationName.contains("Repository")) || (destinationName.contains("Shared Files")) || (destinationName.contains("My Files"))) { drone.waitForElement(folderPathElementId, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); } return new CopyOrMoveContentPage(drone); } } } } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of destionation", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of destionations", e); } throw new PageOperationException("Unable to select Destination : " + destinationName); } CopyOrMoveContentPage(WebDrone drone); @SuppressWarnings("unchecked") @Override CopyOrMoveContentPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override CopyOrMoveContentPage render(long time); @SuppressWarnings("unchecked") @Override CopyOrMoveContentPage render(); String getDialogTitle(); List<String> getDestinations(); List<String> getSites(); List<String> getFolders(); boolean isOkButtonPresent(); boolean isCancelButtonPresent(); HtmlPage selectOkButton(); HtmlPage selectCancelButton(); void selectCloseButton(); CopyOrMoveContentPage selectDestination(String destinationName); CopyOrMoveContentPage selectSite(String siteName); CopyOrMoveContentPage selectPath(String... folderPath);  }