Search code examples
behatmink

Behat "base_url" from command line


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.


Solution

  • 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