この回答https://stackoverflow.com/a/17217598に基づいて、私はそれを理解し、click()をmouseOver()に置き換えました。
これが私のFeatureContextコードです:
/**
* @When /^I hover over the element "([^"]*)"$/
*/
public function iHoverOverTheElement($locator)
{
$session = $this->getSession(); // get the mink session
$element = $session->getPage()->find('css', $locator); // runs the actual query and returns the element
// errors must not pass silently
if (null === $element) {
throw new \InvalidArgumentException(sprintf('Could not evaluate CSS selector: "%s"', $locator));
}
// ok, let's hover it
$element->mouseOver();
}
使用するときに css セレクターを渡す必要があるため、使用法は次のようになります。
...
When I hover over the element ".about"
...