@Test(dependsOnMethods = "testSelectDestinationWithNull") public void testSelectSite() throws Exception { copyOrMoveContentPage = copyOrMoveContentPage.selectSite(siteName1).render(); Assert.assertNotNull(copyOrMoveContentPage); }
public CopyOrMoveContentPage selectSite(String siteName) { if (StringUtils.isEmpty(siteName)) { throw new IllegalArgumentException("Site name is required"); } try { for (WebElement site : drone.findAndWaitForElements(siteListCss)) { if (site.getText() != null) { if (site.getText().equalsIgnoreCase(siteName)) { site.click(); drone.waitForElement(defaultDocumentsFolderCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForElement(folderItemsListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return new CopyOrMoveContentPage(drone); } } } throw new PageOperationException("Unable to find the site: " + siteName); } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of site", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of sites", e); } throw new PageOperationException("Unable to select site."); }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectSite(String siteName) { if (StringUtils.isEmpty(siteName)) { throw new IllegalArgumentException("Site name is required"); } try { for (WebElement site : drone.findAndWaitForElements(siteListCss)) { if (site.getText() != null) { if (site.getText().equalsIgnoreCase(siteName)) { site.click(); drone.waitForElement(defaultDocumentsFolderCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForElement(folderItemsListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return new CopyOrMoveContentPage(drone); } } } throw new PageOperationException("Unable to find the site: " + siteName); } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of site", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of sites", e); } throw new PageOperationException("Unable to select site."); } }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectSite(String siteName) { if (StringUtils.isEmpty(siteName)) { throw new IllegalArgumentException("Site name is required"); } try { for (WebElement site : drone.findAndWaitForElements(siteListCss)) { if (site.getText() != null) { if (site.getText().equalsIgnoreCase(siteName)) { site.click(); drone.waitForElement(defaultDocumentsFolderCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForElement(folderItemsListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return new CopyOrMoveContentPage(drone); } } } throw new PageOperationException("Unable to find the site: " + siteName); } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of site", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of sites", e); } throw new PageOperationException("Unable to select site."); } CopyOrMoveContentPage(WebDrone drone); }
CopyOrMoveContentPage extends ShareDialogue { public CopyOrMoveContentPage selectSite(String siteName) { if (StringUtils.isEmpty(siteName)) { throw new IllegalArgumentException("Site name is required"); } try { for (WebElement site : drone.findAndWaitForElements(siteListCss)) { if (site.getText() != null) { if (site.getText().equalsIgnoreCase(siteName)) { site.click(); drone.waitForElement(defaultDocumentsFolderCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForElement(folderItemsListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return new CopyOrMoveContentPage(drone); } } } throw new PageOperationException("Unable to find the site: " + siteName); } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of site", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of sites", e); } throw new PageOperationException("Unable to select site."); } 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 selectSite(String siteName) { if (StringUtils.isEmpty(siteName)) { throw new IllegalArgumentException("Site name is required"); } try { for (WebElement site : drone.findAndWaitForElements(siteListCss)) { if (site.getText() != null) { if (site.getText().equalsIgnoreCase(siteName)) { site.click(); drone.waitForElement(defaultDocumentsFolderCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForElement(folderItemsListCss, SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); return new CopyOrMoveContentPage(drone); } } } throw new PageOperationException("Unable to find the site: " + siteName); } catch (NoSuchElementException ne) { logger.error("Unable to find the inner text of site", ne); } catch (TimeoutException e) { logger.error("Unable to get the list of sites", e); } throw new PageOperationException("Unable to select site."); } 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);  }