public void setTargetFromWidget() {
   String targetId = Utils.<String>getComponentOption(getRootElement(), "target").orNull();
   if (targetId != null) {
     target = browser.findElement(By.id(targetId));
   } else {
     target = getRootElement();
   }
 }
 /**
  * Dismisses currently displayed popup menu. If no popup menu is currently displayed an
  * exception is thrown.
  *
  * @throws IllegalStateException when no popup menu is displayed in the time of invoking
  */
 public void hide() {
   if (!getMenuPopup().isDisplayed()) {
     throw new IllegalStateException(
         "You are attemting to dismiss the "
             + getNameOfFragment()
             + ", however, no "
             + getNameOfFragment()
             + " is displayed at the moment!");
   }
   Utils.performUniversalBlur(browser);
   waitUntilIsNotVisible().perform();
 }
 public void testJointPoint() {
   updateDropDownMenuInvoker();
   getCurrentMenu().advanced().show(page.getTarget1());
   Locations l = Utils.getLocations(page.getFileMenu());
   testJointPoint(
       l.getWidth(),
       l.getHeight(),
       new ShowElementAndReturnAction() {
         @Override
         public WebElement perform() {
           getCurrentMenu().advanced().show(page.getTarget1());
           return getCurrentMenu().advanced().getMenuPopup();
         }
       });
 }
 @Test
 @Templates("plain")
 @UseWithField(field = "positioning", valuesFrom = FROM_ENUM, value = "")
 public void testJointPoint() {
   Locations l = Utils.getLocations(popupCalendar.getRootElement());
   testJointPoint(
       l.getWidth(),
       l.getHeight(),
       new ShowElementAndReturnAction() {
         @Override
         public WebElement perform() {
           return popupCalendar.openPopup().getRoot();
         }
       });
 }
 @Test(groups = "smoke")
 @Templates("plain")
 @RegressionTest("https://issues.jboss.org/browse/RF-10218")
 @UseWithField(field = "positioning", valuesFrom = FROM_ENUM, value = "")
 public void testJointPoint() {
   openMenu();
   Locations l = Utils.getLocations(group);
   testJointPoint(
       l.getWidth(),
       l.getHeight(),
       new ShowElementAndReturnAction() {
         @Override
         public WebElement perform() {
           openMenuAndSubMenu();
           return groupList;
         }
       });
 }
 @Override
 public boolean isVisible() {
   return Utils.isVisible(getMenuPopup());
 }
 public long getTimeoutForPopupMenuToBeVisible() {
   return _timeoutForPopupMenuToBeVisible == -1
       ? Utils.getWaitAjaxDefaultTimeout(browser)
       : _timeoutForPopupMenuToBeVisible;
 }
 public void setShowEventFromWidget() {
   Optional<String> event = Utils.getComponentOption(root, "showEvent");
   setShowEvent(new Event(event.or(getDefaultShowEvent().getEventName())));
 }
Beispiel #9
0
 /**
  * Asserts that elements locations and some other locations are equal with some allowed tolerance.
  */
 public static void tolerantAssertLocationsEquals(
     WebElement element, Locations l2, int xTolerance, int yTolerance, String message) {
   tolerantAssertLocationsEquals(Utils.getLocations(element), l2, xTolerance, yTolerance, message);
 }
 @Override
 protected GrapheneElement getBodyElement() {
   return (Utils.isVisible(bodyElement) ? bodyElement : emptyBodyElement);
 }
 public long getTimeoutForPanelIsSwitched() {
   return _timeoutForPanelIsSwitched == -1
       ? Utils.getWaitAjaxDefaultTimeout(browser)
       : _timeoutForPanelIsSwitched;
 }
 public long getTimeoutForNodeToBeSelected() {
   return _timeoutForNodeToBeSelected == -1
       ? Utils.getWaitAjaxDefaultTimeout(driver)
       : _timeoutForNodeToBeSelected;
 }
 public boolean isNoData() {
   return Utils.isVisible(noDataElement);
 }