protected function getContentEditLink($link, $title) {
    $node = $this->getCore()->loadNodeByName($title);

    /** @var \Behat\Mink\Element\DocumentElement $element */
    $element = $this->getSession()->getPage();

    $locator = ($link ? array('link', sprintf("'%s'", $link)) : array('link', "."));

    /** @var \Behat\Mink\Element\NodeElement[] $links */
    $links = $element->findAll('named', $locator);

    // Loop over all the links on the page and check for the node edit path.
    foreach ($links as $result) {
      $target = $result->getAttribute('href');
      if (strpos($target, 'node/' . $this->getCore()->getNodeId($node) . '/edit') !== FALSE) {
        return $result;
      }
    }
    return NULL;
  }