Skip to content

Commit

Permalink
Remove unneeded yui code
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Dec 10, 2024
1 parent 9a70e52 commit 113b1ee
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions src/main/java/org/jenkinsci/test/acceptance/po/Control.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
};

Expand All @@ -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')] | "
Expand Down

0 comments on commit 113b1ee

Please sign in to comment.