diff --git a/src/main/java/org/jenkinsci/test/acceptance/po/Control.java b/src/main/java/org/jenkinsci/test/acceptance/po/Control.java index a85c22f54..28e218033 100644 --- a/src/main/java/org/jenkinsci/test/acceptance/po/Control.java +++ b/src/main/java/org/jenkinsci/test/acceptance/po/Control.java @@ -215,25 +215,8 @@ public void selectDropdownMenu(String displayName) { @Override protected WebElement find(String caption) { WebElement menuButton = resolve(); - try { - WebElement menu = findElement(menuButton, by.xpath("..")); - return findElement(menu, by.button(caption)); - } catch (NoSuchElementException e) { - // With enough implementations registered the one we are looking for might - // require scrolling in menu to become visible. This dirty hack stretch - // yui menu so that all the items are visible. - executeScript("YAHOO.util.Dom.batch(" - + " document.querySelector('.yui-menu-body-scrolled')," - + " function (el) {" - + " el.style.height = 'auto';" - + " YAHOO.util.Dom.removeClass(el, 'yui-menu-body-scrolled');" - + " }" - + ");"); - // we can not use `Select` as these are YUI menus and we need to wait for it to be visible - WebElement menu = - findElement(menuButton, by.xpath("ancestor::*[contains(@class,'yui-menu-button')]/..")); - return findElement(menu, by.link(caption)); - } + WebElement menu = findElement(menuButton, by.xpath("..")); + return findElement(menu, by.button(caption)); } }; @@ -250,17 +233,6 @@ public void selectDropdownMenuAlt(Class type) { protected WebElement find(String caption) { WebElement menuButton = resolve(); - // With enough implementations registered the one we are looking for might - // require scrolling in menu to become visible. This dirty hack stretch - // yui menu so that all the items are visible. - executeScript("YAHOO.util.Dom.batch(" - + " document.querySelector('.yui-menu-body-scrolled')," - + " function (el) {" - + " el.style.height = 'auto';" - + " YAHOO.util.Dom.removeClass(el, 'yui-menu-body-scrolled');" - + " }" - + ");"); - Select context = new Select(findElement( menuButton, by.xpath("ancestor-or-self::*[contains(@class,'setting-input dropdownList')] | "