I'm testing a complex corporate website with Geb and beginning to test on a
wide range of browsers.
The .click() method is starting to fail in some tests because some elements
in some browsers are off-screen.
So I'm investigating a scroll method that takes a Geb selector like:
static content = {
singlesButton(cache: false) { $('#ai-singles') }
...
}
and send its position on the screen to a Javascript snippet that scrolls to
it, e.g.
// finds the offset of el from the body or html element
var _x = 0;
var _y = 0;
while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) )
{
_x += el.offsetLeft - el.scrollLeft + el.clientLeft;
_y += el.offsetTop - el.scrollTop + el.clientTop;
el = el.offsetParent;
}
window.scrollTo(_y, _x)
My question is: how do I take a Geb page selector and find its DOM object
so I can pass that into Javascript?
Thanks,
Nick
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/b1858236-d038-44c6-ade3-22c543a63dc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.