PatrickB
PatrickB

Reputation: 3255

behat.yml in app/config instead of root directory

I installed behat with mink and selenium2-driver for my Symfony2 project.

Is it possible to use the /app/config/behat.yml instead of the /behat.yml file?

I searched on google but I can't find anything else this command.

php bin/behat --config app/config/behat.yml

But the command isn't working either.
I think there must be a config-path in composer.json.

Upvotes: 0

Views: 3532

Answers (1)

user2707671
user2707671

Reputation: 1714

Yes, you can configure which config file you want to use. Look at this part of the doc. http://docs.behat.org/guides/7.config.html#paths

What error do you get when running your command?

php bin/behat --config app/config/behat.yml

This error?

[RuntimeException]                                                         
Context class not found.                                                   
Maybe you have provided a wrong or no `bootstrap` path in your behat.yml:  
http://docs.behat.org/guides/7.config.html#paths

If that's the case, I think if might be because you need to specify where to find the features in your behat.yml file.

Now you moved the file to /app/config/behat.yml, the related path from behat.yml to the feature directory has changed, so you should add the following to the file:

default:
    paths:
         features: ../features/
         bootstrap: ../features/bootstrap

Upvotes: 2

Related Questions