]
Lukáš Fryč updated ARQGRA-417:
------------------------------
Fix Version/s: 2.1-Tracking
Support for automatic scrolling to element before its usage
-----------------------------------------------------------
Key: ARQGRA-417
URL:
https://issues.jboss.org/browse/ARQGRA-417
Project: Arquillian Graphene
Issue Type: Feature Request
Components: core
Affects Versions: 2.0.1.Final
Reporter: Juraj Húska
Priority: Minor
Fix For: 2.1-Tracking
It would be nice if Graphene supports automatic scrolling of browser window to
{{WebElement}} / Page Fragment before its is used.
It can be useful for interactions with various popups web components: contextMenu,
tooltip, ...
Those components can not be interacted correctly when they are not in the viewport, and
thus one needs to scroll to them manually in his test.
It is often problem in CI environment, where tests run on screens with lower resolution
(smaller part of the page fit the browser window, and lot of elements are not in the
viewport).
My naive implementation of this would look like:
* intercept all calls to {{WebElements}} and PageFragments root elements
* in the interceptor method get the location of the element by: {{Point location =
element.getLocation();}}
* a then scroll to it: {{jsExecutor.executeScript("window.scrollTo("" +
location.getX() +", " + location.getY() + ")");}}