Behat is a new generation Behavior Driven Development tool for PHP applications. Behat is inspired by Ruby’s Cucumber. Behat can be used for web acceptance testing by using Mink. Mink uses browser emulators like Selenium, Sahi, WebDriver to launch browser.
SauceLabs is cloud testing service which allow selenium based tests into cloud machine with different browser combination. Create an account with Saucelabs and you will definitely love it
Let’s directly move on to code. I assume you have installed Behat and Mink as per the blog ‘Adding Sauce To Behat’.
You can use code available on GitHub project ‘Behat-Sauce‘ directly into your project.
*SauceLabs Account (Username and API Key)
How to use?
* Clone the repository from my GitHub
$ git clone email@example.com:Shashi-ibuildings/Behat-Sauce.git $ cd /path to/Behat-Sauce
* Edit ‘Sauce.yml’ file in order to specify your username and API key.
* Now, Run ANT command to execute feature on sauce Labs
$ ant runSauce
* Once All tests executed see the reports generated in ‘report/report.html’ file.
* Use it in your project by updating ‘behat.yml’ and ‘sauce.yml’. Change Base url to your application url.
* Write and implement features in ‘features’ directory.
You can setup your Jenkins Continuous Integration server by following the blog post ‘Adding Sauce To Behat’
Don’t invest your time/money and effort in setting up different machine/browser combinations for cross browser testing. Better to use SauceLabs.
Any questions? Let me know.