-
Notifications
You must be signed in to change notification settings - Fork 245
Selenium bump #2137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Selenium bump #2137
Conversation
var eYCoord = arguments[0]; | ||
var eXCoord = arguments[1]; | ||
var id = arguments[2]; | ||
var footer = document.getElementsByTagName("footer"); | ||
var sticker = document.getElementById("bottom-sticker"); | ||
|
||
// Scroll to the element. It will appear at the top edge of the screen. | ||
// We subtract a bit so as to accommodate fixed position banners at the top | ||
// (e.g. breadcrumbs, tabbars etc), making sure they are not hiding the element. | ||
window.scrollTo(eXCoord - 100, eYCoord - 200); | ||
if(sticker == null || !sticker.contains(document.getElementById(id)) || footer.length != 1){ | ||
return true; | ||
} | ||
else{ | ||
//it is sticker button and it is moved up (footer does not overlap) | ||
return (footer[0].getBoundingClientRect().top >= sticker.getBoundingClientRect().bottom) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if needed we can still resurrect the JS code in native selenium code to compute the bounds / offset and handle the breadcrumbs.
a54437c
to
208bfbc
Compare
Seems simpler to use e.g.
which will automatically place it in the middle of the viewport without the need for advanced numerical calculations. In any case I don't think the scroller is at fault, as I have tried a number of scroller implementations and none of them affect the result. Rather, I think the problem is that we are trying to click on the wrong element. |
simpler but see https://github.com/jenkinsci/acceptance-test-harness/pull/2140/files#r2287417572 as I believe the javascript scroll is async and we can return whilst still scrolling. |
6c9847d
to
c036760
Compare
Observed issues when setiing up matrix auth iwithout the custom scroller that adding a second user to the table would not always work as the button was not clickable as the dialog was still in the process of being dismissed. After this change the flake was no longer observed.
(cherry picked from commit 4578196)
Remove custom JS to handle scrolling and let selenium do its thing. Selenium hadnles scrolling elements nativly before clicking / sending text etc as part of the WebDriver spec. https://www.w3.org/TR/webdriver2/#element-click > The Element Click command scrolls into view the element if it is not already pointer-interactable, and clicks its in-view center point.
the timeouts where added in the driver
(cherry picked from commit f595c7e)
firefoxOptions.setImplicitWaitTimeout(Duration.ofSeconds(IMPLICIT_WAIT_TIMEOUT)); | ||
firefoxOptions.setPageLoadTimeout(Duration.ofSeconds(PAGE_LOAD_TIMEOUT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not needed, but noticed in the exceptions the driver had 0
as the page load timeout. just trying this to rule anything out.
@@ -203,6 +210,22 @@ private ChromeOptions buildChromeOptions(TestName testName) throws IOException { | |||
return chromeOptions; | |||
} | |||
|
|||
private SafariOptions buildSafariOptions(TestName testName) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
untested, I have no mac.
noticed that we don't set any custom things for safari.
replacing scroller.js with native selenium code. #2136 (comment)
fixes #2129 (maybe!)
Testing done
Submitter checklist