MDL-66979 behat: Scroll nodes into view before hover
The W3C Specification does not require that a NodeElement be in the current viewport before triggering a mouseOver. As a result the mouseOver will generate an Exception because the element is not in the viewport, and the X/Y co-ordinates are invalid. To handle this the node is scrolled into view.
This commit is contained in:
@@ -346,9 +346,9 @@ class behat_general extends behat_base {
|
||||
* @param string $selectortype The type of what we look for
|
||||
*/
|
||||
public function i_hover($element, $selectortype) {
|
||||
|
||||
// Gets the node based on the requested selector type and locator.
|
||||
$node = $this->get_selected_node($selectortype, $element);
|
||||
$this->execute_js_on_node($node, '{{ELEMENT}}.scrollIntoView();');
|
||||
$node->mouseOver();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user