shez1983 / Behat-Laravel-Extension-Example-App

Quick example app to demonstrate setting up Behat with Mink and Laravel extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1. Install Dependencies

Have a look at the require-dev block in the composer.json file to see which dependencies you'll need to pull in:

"behat/behat": "~3.0@dev",
"behat/mink": "~1.6@dev",
"behat/mink-extension": "~2.0@dev",
"behat/mink-browserkit-driver": "~1.2@dev",
"laracasts/behat-laravel-extension": "dev-master"

2. Take a look at Behat.yml

Notice how, within this file, we load the LaravelExtension. As a parameter, you may also specify a custom Laravel 5 environment file that should be loaded. By default, the extension will look for a .env.behat file, however, you're free to change this.

This file should, like the .env file in your project root, contain any special environment variables for your tests (such as a special acceptance test-specific database).

3. Write Features

Check out features/bootstrap/example.feature for a quickie feature to get you started. Because our context (features/bootstrap/FeatureContext.php) is extending MinkContext, we already have a bunch of definitions out of the box.

You can always run behat -dl to see a full list.

Have fun!

example

About

Quick example app to demonstrate setting up Behat with Mink and Laravel extension


Languages

Language:CSS 65.3%Language:PHP 34.1%Language:JavaScript 0.3%Language:Gherkin 0.2%Language:ApacheConf 0.2%