I'm trying to use behat and mink together, reading that link:
http://docs.behat.org/cookbook/behat_and_mink.html#method-1-composer
and trying to activate Mink in Behat framework, but it does not work for me :(
here is text form manual
And this executable will already autoload all the needed classes in order to activate MinkExtension through behat.yml.
Now lets activate it:
I'm thinking he is talking about
/vendor/behat/mink-extension/behat.yml
?
I had added these lines into that file
# behat.yml
default:
extensions:
Behat\MinkExtension\Extension:
goutte: ~
selenium2: ~
But when i'm doing $bin/behat -dl
i can see only
Given /^I am in a directory "([^"]*)"$/
Given /^I have a file named "([^"]*)"$/
When /^I run "([^"]*)"$/
Then /^I should get:$/
Seems mink-extension do not activated...but how i can activate it, if i did everything what is written in the manual :(
P.S. I just tried to follow instruction (from here http://docs.behat.org/cookbook/behat_and_mink.html) in totally new clean place (new folder) but it does not work it shows me next error
bin/behat -dl
[RuntimeException]
Context class not found.
Maybe you have provided wrong or no `bootstrap` path in your behat.yml:
http://docs.behat.org/guides/7.config.html#paths
But in tutorial nothing says about paths and yml modifications :( Maybe is there exist any updated tutorial version ?
based on error message I have to make some php file in bootstrap folder, but it was not describe in tutorial :( strange
SOLVED:
$ mkdir behat_mink_test && cd behat_mink_test
$ touch composer.json
$ echo '{
> "require": {
> "behat/behat": "2.4.*@stable",
> "behat/mink": "1.4.*@stable",
> "behat/mink-extension": "*",
> "behat/mink-goutte-driver": "*",
> "behat/mink-selenium2-driver": "*"
> },
> "minimum-stability": "dev",
> "config": {
> "bin-dir": "bin/"
> }
> }' > composer.json
$ curl http://getcomposer.org/installer | php
$ php composer.phar install
$ bin/behat -h
$ touch behat.yml
$ echo 'default:
> extensions:
> Behat\MinkExtension\Extension:
> goutte: ~
> selenium2: ~' > behat.yml
$ bin/behat -dl
and finally it works now :) thanks
You should not edit the behat.yml file located in /vendor/behat/mink-extension/behat.yml. You should add these lines to the behat.yml file at the root of your proyect (the directory where the bin subdirectory is). If there is no behat.yml file there, just create it-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With