For Windows users, please read on.
INSTALL PHP
Download link https://www.apachefriends.org/download.html
Version - 1.8.3 / PHP 5.5.15
2. Install XAMPP.
You may see a warning about having an antivirus running - just ignore this.
Select all defaults during the install.
Install to C:\xampp
The install will take around 5 - 10 minutes.
INSTALL COMPOSER
Download link https://getcomposer.org/Composer-Setup.exe
Run the executable specifying "C:\xampp\php\php.exe" for "Where is PHP.exe located".
INSTALL BEHAT
5. In the Behat folder from Step 4, create a file called "composer.json" and add the following into it:
{
"require": {
"behat/behat": "~2.4.5",
"behat/mink": "~1.5",
"behat/mink-extension": "~1.1.4",
"behat/mink-goutte-driver": "~1.0.8",
"behat/mink-selenium2-driver": "~1.1.1"
},
"config": {
"bin-dir": "bin/"
}
}
6. Install Behat.
Open a new command prompt window and type "cd /Behat/". You should now be in "C:\Behat>"
Type "composer install" (without the quotes). This will create a 'vendor' folder in your behat folder.
7. Add the Behat path "C:\Behat\bin" to your system path variable, as follows:
Right click "Computer" and select "Properties"
Under "Control Panel Home" select "Advanced system settings"
In the "Advanced" tab navigate to the bottom and select "Environment Variables"
In the "System variables" section scroll down and select "Path" and then select the "Edit" button
Ensure you are at the end of the "Variable value" field and add this to the end of the "Path" value ";C:\Behat\bin;".
8. Test that Behat has installed correctly:
Open a new command prompt window and type "behat --version" (without the quotes). You should see 'Behat version DEV'.
9. In the same command window, navigate to "C:\Behat\".
Type "behat --init" (without the quotes).
This will create:
- a features folder,
- a bootstrap folder,
- and the FeatureContext.php file inside the bootstrap folder.
Save the .yml file located here "C:\Behat\" (do this using windows explorer)
Save the .feature files located here in "C:\Behat\features" (again do this using windows explorer)
10. In the same command window, type: "behat --config behat.yml features\<name_of_feature_file>.feature" (without the quotes).
MAKE SURE TO ALTER THE TEXT "<name_of_feature_file>" to an actual feature file.
11. Click enter (Enter Ctrl + C to stop if you wish to terminate the test early.)