/** * Applies a specific action to an element * * @param NodeElement $element Element to act on * @param string $action Action, which may be one of 'hover', 'double click', 'right click', or 'left click' * The default 'click' behaves the same as left click */ protected function interactWithElement($element, $action = 'click') { switch ($action) { case 'hover': $element->mouseOver(); break; case 'double click': $element->doubleClick(); break; case 'right click': $element->rightClick(); break; case 'left click': case 'click': default: $element->click(); break; } }
public function testMouseOver() { $node = new NodeElement('some-element', $this->session); $this->driver->expects($this->once())->method('mouseOver')->with('some-element'); $node->mouseOver(); }