I am using nightwatch for e2etesting my app. One of the tests fails because it cannot scroll to the element that it is testing I suspect. Question do I need to scroll or is ther
In addition an example I used as page object command (be_expand) where my selector was an xpath already used in a element (@be_click):
be_expand() {
this.api.execute(function(xpath) {
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
var res = getElementByXpath(xpath);
res.scrollIntoView(true);
}, [this.elements.be_click.selector]);
this.assert.visible('@be_click');
this.click('@be_click');
return this;
}