Repository navigation
feat(core): Add hover-selector and wait-after-hover configuration options - #2333
Open
yearn-otto wants to merge 2 commits into
Open
yearn-otto wants to merge 2 commits into
yearn-otto wants to merge 2 commits into
Conversation
MediaMarco
reviewed
Nov 17, 2026
MediaMarco
left a comment
Member
There was a problem hiding this comment.
All other wait times in the config are specified in seconds. Also, the unit is not part of the name of other config values. Could we adjust this for consistency reasons?
yearn-otto
force-pushed
the
feature/hover-element
branch
from
November 18, 2026 08:12
5b9e3e8 to
093f38a
Compare
…ling Rename hover-element/hover-wait to hover-selector/wait-after-hover to match the existing option names. Hover after the WebKit scrollbar handling, measure the page height after hovering and move the pointer back to 0,0 after the screenshots of a page. Distinguish missing elements from failed hovers and don't log twice in strict mode. Add GraalVM reachability metadata, example config, HISTORY entry, documented limitations, more unit tests and a Chrome acceptance test.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for hovering over an element via Selenium WebDriver's native Actions API before the screenshots of a page are taken.
Simulating a mouse hover via custom JavaScript (
dispatchEvent) does not trigger CSS:hoverstates, because browsers only apply:hoverfor real input/pointer events. This feature usesActions.moveToElement().perform(), which sends input events through the browser itself (also in headless mode).New configuration options
hover-selector(String, CSS selector): Selector of the element to hover over. If multiple elements match, the first one is hovered.wait-after-hover(Float, seconds, default0, valid values 0 to 20): Time to wait after hovering, so CSS transitions/animations can finish. There is no wait if the hover failed.Behavior
javascript,style,remove-selectors, the scroll to the top of the page and the WebKit scrollbar handling (so the layout doesn't shift away from the pointer).fail-if-selectors-not-found: true, the run fails instead, with separate messages for a missing element and a failed hover.Known limitations (documented)
:hoverto the element under the pointer (verified in headless Chrome), so the hover is only reliable in the first screenshot.max-scroll-heightcan limit the screenshots to the top of the page.:hoverstyles.Other changes
cliandcli-lambdacontains the new getters and builder methods.JobConfig.exampleConfig()and the examples indocs/CONFIGURATION.mdcontainhover-selector.docs/CONFIGURATION.md: new sections for both options,fail-if-selectors-not-foundmentions the hover.HISTORY.mdentry.Verification
BrowserTest: hover, null/empty/blank selectors, wait after hover (and no wait after a failed hover), lenient and strict handling of missing elements and failed hovers, order in the screenshot flow (scroll to top → hover → page height → screenshots → pointer reset), pointer reset.UrlConfigTest: JSON/YAML deserialization.ConfigMergerTest: merge precedence.JobConfigValidatorTest:wait-after-hoverrange.JLineupCLIAcceptanceTest.shouldHoverOverSelectorAndResetPointerForNextPage: real headless Chrome run. A box turns red on hover with a transition; the 'after' page is a static red copy, so the comparison only passes if the hover and the wait worked. A second page with a hoverable box scrolled under the old pointer position must not be hovered.