Mink doesn't work with behat 3.0.12

杀马特。学长 韩版系。学妹 提交于 2019-12-03 08:25:41

问题


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"
   }

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

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.

SOLVED:

I simply forgot to add this line:

"require": {
//...
"behat/mink-extension": "dev-master",
//... }

and in your behat.yml: comment this:

# mink_driver: true

and change this:

Behat\MinkExtension\Extension:

to this:

Behat\MinkExtension:

回答1:


FYI you don't need "behat/mink-extension": "dev-master" any more.

It works for me with:

"behat/behat": "3.*@stable",
"behat/mink": "1.6.*@stable",
"behat/mink-extension": "@stable",
"behat/mink-goutte-driver": "@stable",


来源:https://stackoverflow.com/questions/25049234/mink-doesnt-work-with-behat-3-0-12

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!