I would like to know if it's possible to set the base_url via the command line. Example
bin/behat --base_url=http://google.fr
I would like to avoid creating a new profile and passing it via the command line each time I have to test a new url, for flexibility purpose.
Is there any trick here to do this ?
Thank you.
I found the solution by myself.
Just pass the base_url in the BEHAT_PARAM environment variable.
export BEHAT_PARAMS="context[parameters][base_url]=http://google.fr"
Then run behat
bin/behat
Alternatively if you are using Mink you could define a profile in behat.yml
# behat.yml
default:
extensions:
Behat\MinkExtension\Extension:
base_url: http://local.mysite.com
goutte: ~
selenium2: ~
dev:
extensions:
Behat\MinkExtension\Extension:
base_url: http://dev.mysite.com
And then you can run your tests against local.mysite.com by default with
$ behat
Or against dev.mysite.com with
$ behat --profile=dev
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