I want to be able to execute Behat based test scenarios within Jenkins. Behat itself is a single executable (behat.phar) that runs with the use of PHP.
Where can I place Behat so that it’s within the Jenkins folder structure? The only place I can think of is in: ‘C:\Program Files (x86)\Jenkins\jobs’. Anyone have any better suggestions?
I have looked through the Jenkins documentation and wasn’t able to find anything on this topic.
Install Behat in whatever location you would normally (e.g.,
C:\Program Files (x86)\Behat\behat.phar), then set a system environment variable to your behat directory. e.g., setBEHAT_HOMEtoC:\Program Files (x86)\Behat\. Finally, use the environment variable in your your execution script (.bat file, Ant file, Gradle file, etc).There are many different ways you can do this and environment variables aren’t always the best option, but it is an option that will work across all the different ways you can execute a program from Jenkins.