These are chat archives for Behat/Behat

19th
Sep 2017
Lucas Ruggiero
@Lucaskcr_twitter
Sep 19 2017 12:25
Is it possible to have more than one Behat-yml file? I want to set different projects contexts, but don't want to duplicate code
Cagatay Ulubay
@CagatayUlubay
Sep 19 2017 13:45

Of course. You can have as many as you want. You just have to add "-- config {path2.yml}" after the "behat" execution.
You can also define different profiles you want to use for example one for Chrome, one for Firefox and also add "--profile {profile_name}".
Everything defined in the profile which is also defined in "default" will overwrite the "default" one.

Example:

[behat.yml]
default:
extensions:
something: true

chrome:
extensions: ~ // <-- this will overwrite the above one!

firefox:
extensions:
anything: true // This won't overwrite it, because it doesn't exists in the top one

Last one you can use is "--suite {suite_name}"

Example:

[behat.yml]
default:
suites:
main_test: // <-- Suite Name
paths: [ %paths.base%/frontend/features ]
contexts: FeatureContext

This I have a configuration command line setup inside PHPStorm where I can say that I need the Suite for the mobile develepment area.

Lucas Ruggiero
@Lucaskcr_twitter
Sep 19 2017 14:03
This is great! I think your first suggestion will work fine for me
this is what you are suggesting, right?
in this case, my base code will be inside project vendor and my specific context and features will be inside project dir