From 8c73fab8f784fc603ba7675b1e86f96a7e08acbb Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:07:13 +0000 Subject: [PATCH] Remove unneeded yui scrolling (#1861) --- .../jenkinsci/test/acceptance/po/Control.java | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) 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')] | "