以下代码的执行:
<?php
class InheritedFeatureContext extends Behat\MinkExtension\Context\MinkContext
{
/**
*Simulates hovering over a link
*
* @When /^I mouse over "([^"]*)"$/
*/
public function iMouseOver($link)
{
$this->getSession()->getPage()->findLink($link)->mouseOver();
}
/**
*Waits for the appearence of a drop down
*
* @Then /^I wait for the suggestion box to appear$/
*/
public function iWaitForTheSuggestionBoxToAppear()
{
$this->getSession()->wait(5000, "$('.suggestions-results').children().length > 0");
}
}
产生错误消息:
TypeError: $ is not a function
在参照:
$this->getSession()->wait(5000, "$('.suggestions-results').children().length > 0");
这段代码以前工作得很好。有任何想法吗
上下文:这是 Behat/Mink 功能的一部分