2017 © Pedro Peláez
 

library behat-laravel

Adding BDD test with Behat to laravel 4

image

guilhermeguitte/behat-laravel

Adding BDD test with Behat to laravel 4

  • Sunday, February 15, 2015
  • by GuilhermeGuitte
  • Repository
  • 7 Watchers
  • 63 Stars
  • 18,982 Installations
  • PHP
  • 0 Dependents
  • 2 Suggesters
  • 14 Forks
  • 7 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Behat-Laravel

ProjectStatus, (*1)

Behat-Laravel is a solution to test your application using the BDD methodology., (*2)

Features:

Current:, (*3)

  • Create the folder structure to receive the Acceptance tests.
  • Run the acceptance test.
  • Ingration with Zizaco/TestCases-Laravel, that provide the useful methods test your application.

Quick start:

Required setup

In the require key of composer.json file add the following:, (*4)

"guilhermeguitte/behat-laravel": "dev-master"

Run the Composer update comand, (*5)

$ composer update

In your config/app.php add 'GuilhermeGuitte\BehatLaravel\BehatLaravelServiceProvider' to the end of the $providers array, (*6)

'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'GuilhermeGuitte\BehatLaravel\BehatLaravelServiceProvider',

),

Install selenium., (*7)

http://docs.seleniumhq.org/download/, (*8)

Commands

Now generate Behat's structure folder using the follow artisan's command:, (*9)

$ php artisan behat:install

You can pass the test path if you are not using the app/tests folder., (*10)

$ php artisan behat:install --test_path==your/test/path

Generating Documentation

To create a document in html just run:, (*11)

$ php artisan behat:html # will create a file at application's root

or, (*12)

$ php artisan behat:html --out path/you/need/doc.html # will create a file specified path

Structure

http://docs.behat.org/, (*13)

Adding Contexts

When you create a context in the folder tests\acceptance\contexts these files will be included by FeatureContext preventing the specification of files that will be used by the tests., (*14)

$ php artisan behat:feature --name=NameOfFeature

Will create:, (*15)

    app\tests\acceptance\contexts\NameOfFeatureContext.php
    app\tests\acceptance\features\name_of_feature\name_of_feature.feature

Running tests

To run all test, you can use the follow command:, (*16)

$ php artisan behat:run

To run tests for specific features, you can specify the name of the folder or the .feature file:, (*17)

$ php artisan behat:run name_of_feature
$ php artisan behat:run name_of_feature/name_of_feature.feature
$ php artisan behat:run name_of_feature/separated_scenarios.feature

If you have large feature files and you only want to run a specific senario use, (*18)

$ php artisan behat:run --name="name of feature"

Laravel behat currently supports the following behat command line options:, (*19)

 --format (-f)        How to format features. pretty is default.
                      Default formatters are:
                      - pretty: Prints the feature as is.
                      - progress: Prints one character per step.
                      - html: Generates a nice looking HTML report.
                      - junit: Generates a report similar to Ant+JUnit.
                      - failed: Prints list of failed scenarios.
                      - snippets: Prints only snippets for undefined steps.

 --no-snippets        Do not print out snippets
 --profile (-p)       Specify config profile to use.
 --name               Only execute the feature elements which match
                      part of the given name or regex.

License

Behat-Laravel is free software distributed under the terms of the MIT license., (*20)

The Versions

15/02 2015

dev-master

9999999-dev

Adding BDD test with Behat to laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guilherme Guitte

laravel bdd test behat illuminate

20/08 2014

dev-behat-3.0

dev-behat-3.0

Adding BDD test with Behat to laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guilherme Guitte

laravel bdd test behat illuminate

06/08 2014

v1.5

1.5.0.0

Adding BDD test with Behat to laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guilherme Guitte

laravel bdd test behat illuminate

18/03 2014

v1.0

1.0.0.0

Adding BDD test with Behat to laravel 4

  Sources   Download

MIT

The Requires

 

by Guilherme Guitte

laravel bdd test behat illuminate