Jump to content

Behat (software): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Update latest release
3.7.0
Line 16: Line 16:
| released = {{Start date and age|2010|09|10|df=yes}}<ref>[http://everzet.com/post/1096996491/bdd-in-php-or-just-be-hat everzet's blog • BDD in PHP or "Just Be Hat"]. Everzet.com (2010-09-10). Retrieved on 2015-03-19.</ref>
| released = {{Start date and age|2010|09|10|df=yes}}<ref>[http://everzet.com/post/1096996491/bdd-in-php-or-just-be-hat everzet's blog • BDD in PHP or "Just Be Hat"]. Everzet.com (2010-09-10). Retrieved on 2015-03-19.</ref>
| discontinued =
| discontinued =
| latest release version = 3.6.1
| latest release version = 3.7.0
| latest release date = {{Start date and age|2020|02|06|df=yes}}<ref>[https://github.com/Behat/Behat/releases Latest Behat releases]</ref>
| latest release date = {{Start date and age|2020|06|03|df=yes}}<ref>[https://github.com/Behat/Behat/releases Latest Behat releases]</ref>
| latest preview version =
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->

Revision as of 23:20, 9 June 2020

Developer(s)Konstantin Kudryashov
Initial release10 September 2010; 14 years ago (2010-09-10)[1]
Stable release
3.7.0 / 3 June 2020; 4 years ago (2020-06-03)[2]
Repository
Written inPHP
Operating systemCross-platform
TypeBehavior-driven development
LicenseMIT License
Websitebehat.org

Behat is a test framework for behavior-driven development written in the PHP programming language. Behat was created by Konstantin Kudryashov and its development is hosted on GitHub.

Purpose

Behat is intended to aid communication between developers, clients and other stakeholders during a software development process. It allows the clear documentation of testable examples of the software's intended behaviour. Behat test scenarios are written with Gherkin,[3] a business-readable domain-specific language following defined patterns.

Benefits

Tests can be run at any point new code is introduced into a codebase to confirm no regressions within the existing test coverage are introduced. It can be integrated with Selenium and other browser emulators to generate screenshots of failures. Like other BDD frameworks, Behat scenarios are a series of Given, When, and Then steps that explain a business case. The definition of these steps exist within method annotations of a class that extends the BehatContext.[4]

Examples

The preconditions after "Given" correspond to the PHP method name to execute:

Feature: Function to test description

    Free text

    Scenario: Scenario 1
        Given preconditions
        When actions
        Then results

    Scenario: Scenario 2
        ...

References

  1. ^ everzet's blog • BDD in PHP or "Just Be Hat". Everzet.com (2010-09-10). Retrieved on 2015-03-19.
  2. ^ Latest Behat releases
  3. ^ https://github.com/cucumber/cucumber/wiki/Gherkin
  4. ^ BDD With Behat - Tuts+ Code Tutorial. Code.tutsplus.com (2013-12-23). Retrieved on 2015-03-19.