Behat from Scratch

Build Status

Simple project created as an introduction to Behat on the first London Behat Users meetup.

It is based on the Silex micro-framework, uses Twig templates and Symfony's form component.

Installation

Download the composer:

curl -s http://getcomposer.org/installer | php

Install the dependencies:

php composer.phar install

Running Behat

By default custom Silex session is used so there's no need for additional configuration. Behat will create a Silex application and simulate requests.

All the project's scenarios can be run with:

./bin/behat

Composer created this symbolic link during the installation.

Running in a browser

To use session run in a browser (like selenium2) you will have to change default_sesion in behat.yml and configure a web server. Example configuration for apache:

<VirtualHost *:80>
    ServerName behat.dev

    DocumentRoot /var/www/behat.dev/web
    DirectoryIndex index.php

    <Directory /var/www/behat.dev/web>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Paths to source code and a domain name have to be updated. Also base_url in behat.yml needs to be changed accordingly.