Tutorial by Examples

Functional tests are best described as tests for your user stories. If you've dealt with user stories before they normally follow the following pattern: As a [role], I want to [desire], so that [benefit/desired outcome] For the following examples we'll use this user story as an example: As a Du...
Behat provides Gherkin Syntax which is a human-readable format. It allows you to easily describe your user stories. To start with Behat you should install it with Composer and then initialize your test files: $ composer require --dev behat/behat="^3.0.5" $ ./vendor/bin/behat --init ...
Mink provides an interface for web drivers (like Goutte and Selenium) as well as a MinkContext which, when extended, provides additional web language for our steps. To install Mink (and the default Goutte driver): $ composer require --dev behat/mink-extension="^2.0" $ composer require -...
If we want to test JavaScript on a website, we'll need to use something a bit more powerful than Goutte (which is just cURL via Guzzle). There are a couple of options such as ZombieJS, Selenium and Sahi. For this example I'll use Selenium. First you'll need to install the drivers for Mink: $ compo...
With functional testing data is often modified. This can cause subsequent runs of the test suite to fail (as the data could have changed from the original state it was in). If you have setup your data source using an ORM or framework that supports migration or seeding (like Doctrine, Propel, Larave...
Functional testing also can include testing processes that leave your environment, such as external API calls and emails. As an example, imagine you're functionally testing the registration process for your website. The final step of this process involves sending an email with an activation link. U...
Behat/Mink Install using composer (for other methods check ) behat.org If you using linux, please go sure that you have installed php-curl (normal curl installation won't work) Linux sudo apt-get install php5-curl If you are using Windows, make sure you have PHP, Curl and Git installed. You...

Page 1 of 1