问题描述
我安装了Behat,Mink和其他一些相关软件包.这是我的composer.json文件:
I installed Behat, Mink and a few other related packages. Here is my composer.json file:
"require":{
//...
"behat/behat": "~3.0.6",
"behat/symfony2-extension": "dev-master",
"behat/mink": "dev-master",
"behat/mink-browserkit-driver": "dev-master",
"behat/mink-goutte-driver": "dev-master",
"behat/mink-selenium2-driver": "dev-master",
"phpunit/php-code-coverage": "dev-master",
"phpunit/phpunit-mock-objects": "dev-master",
"phpunit/phpunit": "dev-master"
}
这是我的behat.yml文件:
And here is my behat.yml file:
default:
extensions:
Behat\Symfony2Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
base_url: 'http://localhost/app_test.php/'
#javascript_session: sahi
browser_name: chrome
sahi:
goutte: ~
selenium2: ~
paths:
features: features
bootstrap: %behat.paths.features%/Context
现在当我运行behat时,出现以下错误: [Behat \ Testwork \ ServiceContainer \ Exception \ ExtensionInitializationException]
找不到Behat\MinkExtension\Extension
扩展文件或类.
Now when I run behat I get following error:[Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException]Behat\MinkExtension\Extension
extension file or class could not be located.
有人知道如何解决此问题吗?预先感谢.
Does anyone know how to fix this?Thanks in advance.
已解决:
我只是忘了添加这一行:
I simply forgot to add this line:
"require": {
//...
"behat/mink-extension": "dev-master",
//... }
并在您的behat.yml中:对此发表评论:
and in your behat.yml:comment this:
# mink_driver: true
并更改此内容:
Behat\MinkExtension\Extension:
对此:
Behat\MinkExtension:
推荐答案
仅供参考,您不再需要"behat/mink-extension": "dev-master"
.
FYI you don't need "behat/mink-extension": "dev-master"
any more.
它对我有用:
"behat/behat": "3.*@stable",
"behat/mink": "1.6.*@stable",
"behat/mink-extension": "@stable",
"behat/mink-goutte-driver": "@stable",
这篇关于Mink不适用于behat 3.0.12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!