public function iWaitUntilToolbarDropdownMenuIsVisible($item)
{
$this->spin(function (RawMinkContext $context) use($item) {
$page = $context->getSession()->getPage();
$element = $page->find('css', '.toolbar-dropdown-menu');
if (null === $element) {
throw new ElementNotFoundException($this->getSession(), null, 'css', '.toolbar-dropdown-menu');
}
if (!$element->isVisible()) {
return false;
}
$item = $element->find('css', 'li[data-id=' . $item . ']');
if (null === $item) {
throw new ElementNotFoundException($this->getSession(), null, 'css', 'li[data-id=' . $item . ']');
}
$item->click();
return true;
});
}