【发布时间】:2016-12-19 21:24:49
【问题描述】:
以下代码的执行:
<?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 功能的一部分
【问题讨论】:
-
这应该不需要 jQuery 它是从 Mink 上下文继承的。