/** * go to previous page via pressing PageUp. * * @return */ public DocsSlideShowFromViewerPage pageUp() { log.info("pressing PageDown to go to next page."); if (driver.isChrome()) { body.sendKeys(Keys.PAGE_UP); } else { slideShowContainer.sendKeys(Keys.PAGE_UP); } slideShowContainer.waitPresence(); return this; }
/** * is specific page displayed in current view. * * @param pageNumber * @return */ public boolean isPageDisplayed(int pageNumber) { log.info("judge whether page " + pageNumber + " is displayed in current page."); if (pageNumber == 1) { currentImage.setLocatorArgument(""); } else { currentImage.setLocatorArgument(String.valueOf(pageNumber - 1)); } currentImage.waitPresence(); return currentImage.isPresent(); }
/** * focus on DocsViewerPage. * * @param name * @return */ public DocsSlideShowFromViewerPage focus(String name) { log.info("Go to IBM Docs slide show page from viewer page"); driver.switchToWindow(name); driver.manage().window().setPosition(new Point(0, 0)); driver.manage().window().setSize(new Dimension(1024, 768)); slideShowContainer.waitPresence(); // Give docs some time to make its ui stable driver.sleep(3); return this; }
/** * go to next page via clicking. * * @return */ public DocsSlideShowFromViewerPage click() { log.info("mouse clicking to go to next page."); slideShowContainer.click(); slideShowContainer.waitPresence(); return this; }
/** @return */ public boolean isLastPageDisplayed() { log.info("judge whether the last page displayed."); return slideEndShow.isPresent(); }