@Test(expectedExceptions=UnsupportedOperationException.class) public void elementRenderWithNullRenderTimeObject() { SharePage page = new DashBoardPage(drone); page.elementRender(null, getVisibleRenderElement(By.cssSelector("bla")) ); }
public void elementRender(RenderTime renderTime, RenderElement... elements) { if (renderTime == null) { throw new UnsupportedOperationException("RenderTime is required"); } if (elements == null || elements.length < 1) { throw new UnsupportedOperationException("RenderElements are required"); } for (RenderElement element : elements) { try { renderTime.start(); long waitSeconds = TimeUnit.MILLISECONDS.toSeconds(renderTime.timeLeft()); element.render(drone, waitSeconds); } catch (TimeoutException e) { logger.error("Not able to render the element : " + element.getLocator().toString(), e); throw new PageRenderTimeException("element not rendered in time."); } finally { renderTime.end(element.getLocator().toString()); } } }
SharePage extends Page { public void elementRender(RenderTime renderTime, RenderElement... elements) { if (renderTime == null) { throw new UnsupportedOperationException("RenderTime is required"); } if (elements == null || elements.length < 1) { throw new UnsupportedOperationException("RenderElements are required"); } for (RenderElement element : elements) { try { renderTime.start(); long waitSeconds = TimeUnit.MILLISECONDS.toSeconds(renderTime.timeLeft()); element.render(drone, waitSeconds); } catch (TimeoutException e) { logger.error("Not able to render the element : " + element.getLocator().toString(), e); throw new PageRenderTimeException("element not rendered in time."); } finally { renderTime.end(element.getLocator().toString()); } } } }
SharePage extends Page { public void elementRender(RenderTime renderTime, RenderElement... elements) { if (renderTime == null) { throw new UnsupportedOperationException("RenderTime is required"); } if (elements == null || elements.length < 1) { throw new UnsupportedOperationException("RenderElements are required"); } for (RenderElement element : elements) { try { renderTime.start(); long waitSeconds = TimeUnit.MILLISECONDS.toSeconds(renderTime.timeLeft()); element.render(drone, waitSeconds); } catch (TimeoutException e) { logger.error("Not able to render the element : " + element.getLocator().toString(), e); throw new PageRenderTimeException("element not rendered in time."); } finally { renderTime.end(element.getLocator().toString()); } } } protected  SharePage(WebDrone drone); }
SharePage extends Page { public void elementRender(RenderTime renderTime, RenderElement... elements) { if (renderTime == null) { throw new UnsupportedOperationException("RenderTime is required"); } if (elements == null || elements.length < 1) { throw new UnsupportedOperationException("RenderElements are required"); } for (RenderElement element : elements) { try { renderTime.start(); long waitSeconds = TimeUnit.MILLISECONDS.toSeconds(renderTime.timeLeft()); element.render(drone, waitSeconds); } catch (TimeoutException e) { logger.error("Not able to render the element : " + element.getLocator().toString(), e); throw new PageRenderTimeException("element not rendered in time."); } finally { renderTime.end(element.getLocator().toString()); } } } protected  SharePage(WebDrone drone); void basicRender(RenderTime timer); boolean isLogoPresent(); String getPageTitle(); boolean isTitlePresent(final String title); boolean panelExists(String panelName); LoginPage getLogin(); Navigation getNav(); SearchBox getSearch(); WebElement findButton(final String button, List<WebElement> elements); void disableFileUploadFlash(); void setSingleMode(); boolean isLoggedIn(); String getCopyRight(); void webElementRender(RenderTime renderTime); void elementRender(RenderTime renderTime, RenderElement... elements); void waitForFile(final long time, String pathname); void waitForFile(String pathname); String getElementText(By locator); void setAlfrescoVersion(AlfrescoVersion alfrescoVersion); long getPopupRendertime(); void setPopupRendertime(long popupRendertime); void setElementWaitInSeconds(long elementWaitInSeconds); static String getSiteShortName(String siteName); RenderElement getActionMessageElement(ElementState state); String getValidationMessage(By locator); String getValidationMessage(WebElement webElement); SharePage waitUntilAlert(); SharePage waitUntilAlert(long seconds); void selectOption(By by, String text); void inputFromKeyborad(Keys inputs); FootersPage getFooter(); String getLicenseHolder(); String getCopyRightDetails(); String getColor(By locator, boolean background); AboutPopUp openAboutPopUp(); String getTopLogoUrl(); String getFooterLogoUrl(); }
SharePage extends Page { public void elementRender(RenderTime renderTime, RenderElement... elements) { if (renderTime == null) { throw new UnsupportedOperationException("RenderTime is required"); } if (elements == null || elements.length < 1) { throw new UnsupportedOperationException("RenderElements are required"); } for (RenderElement element : elements) { try { renderTime.start(); long waitSeconds = TimeUnit.MILLISECONDS.toSeconds(renderTime.timeLeft()); element.render(drone, waitSeconds); } catch (TimeoutException e) { logger.error("Not able to render the element : " + element.getLocator().toString(), e); throw new PageRenderTimeException("element not rendered in time."); } finally { renderTime.end(element.getLocator().toString()); } } } protected  SharePage(WebDrone drone); void basicRender(RenderTime timer); boolean isLogoPresent(); String getPageTitle(); boolean isTitlePresent(final String title); boolean panelExists(String panelName); LoginPage getLogin(); Navigation getNav(); SearchBox getSearch(); WebElement findButton(final String button, List<WebElement> elements); void disableFileUploadFlash(); void setSingleMode(); boolean isLoggedIn(); String getCopyRight(); void webElementRender(RenderTime renderTime); void elementRender(RenderTime renderTime, RenderElement... elements); void waitForFile(final long time, String pathname); void waitForFile(String pathname); String getElementText(By locator); void setAlfrescoVersion(AlfrescoVersion alfrescoVersion); long getPopupRendertime(); void setPopupRendertime(long popupRendertime); void setElementWaitInSeconds(long elementWaitInSeconds); static String getSiteShortName(String siteName); RenderElement getActionMessageElement(ElementState state); String getValidationMessage(By locator); String getValidationMessage(WebElement webElement); SharePage waitUntilAlert(); SharePage waitUntilAlert(long seconds); void selectOption(By by, String text); void inputFromKeyborad(Keys inputs); FootersPage getFooter(); String getLicenseHolder(); String getCopyRightDetails(); String getColor(By locator, boolean background); AboutPopUp openAboutPopUp(); String getTopLogoUrl(); String getFooterLogoUrl();  }