无法关注 link | Behat/Mink

Not able to follow link | Behat/Mink

我无法使用 Behat/Mink 单击链接。 <span> 标签中有所需的文本,所以这可能是原因吗? 这是我的 *.feature 文件的一部分:

Scenario: Tryin' to make it freakin' workin' yo!
Given I am on "/home/"
And I follow "Test"
Then I should be on "/test/"

这是我试图关注的页面的一部分:

<li id="ApplicationItem_test" class=" " data-placement="right" rel="popover" data-offset="-6" data-content="" data-original-title="test">                            
  <a href="/app/tests/e76ee2a8d9094e11b6bb9c928c5d61e3/" data-subscription-id="e76ee2a8-d909-4e11-b6bb-9c928c5d61e3">                                
    <i class="picon-money-icon-16"></i>
    <span class="expand-element">test
    </span>                                    
    <div id="nodeCounter_c592e0ce62c849fab427fc9f2a04b557" style="display:inline-block">
    </div>                            </a>                    
</li>                            
<script type="text/javascript">
  var node = { id: '#nodeCounter_c592e0ce62c849fab427fc9f2a04b557', action: '/app/tests/e76ee2a8d9094e11b6bb9c928c5d61e3/GetSidebarActionCount' };
  Access.SideBar.nodesWithCounters.push(node);
</script>

这是我遇到的错误:

And I follow "Test"
FeatureContext::clickLink()
Link with id|title|alt|text "Test" not found. (Behat\Mink\Exception\ElementNotFoundException)

已尝试在互联网上找到的所有可能的 CSS 选择器功能。我还想知道我是否不应该在这里使用 Behat 的 Selenium 扩展(因为 JS?)

所以答案是:我没有在正确的页面上。 基本上场景应该是独立的——这意味着我之前的会话被烧毁了,我错过了之前的一些步骤(例如登录。)