fbpx
Wikipedia

Behat (software)

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.

Developer(s)Konstantin Kudryashov
Initial release8 September 2010; 13 years ago (2010-09-08)[1]
Stable release
3.13.0 / 18 April 2023; 12 months ago (2023-04-18)[1]
Repository
  • github.com/Behat/Behat
Written inPHP
Operating systemCross-platform
TypeBehavior-driven development
LicenseMIT License
Websitebehat.org

Purpose edit

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,[2] a business-readable domain-specific language following defined patterns.

Benefits edit

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 use to directly test php code and is often used with Selenium to remote control browsers as part of the scenarios. The browsers under remote control can take videos[3] or screenshots of failures. Using selenium or tools like selenoid[4] a "grid" of browsers can be remote controlled for parallel test execution. There is also a module for running php only scenarios.[5]

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.[6]

Behat can output test results in a number of different formats, including JUnit XML and HTML[7]

Examples edit

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

Feature: Simple description of this feature’s story  Describe benefit, role and feature or user story  Use as many lines as needed  Background:  Given some step run for all scenarios    Scenario: Scenario or example description  Given I setup preconditions with:  | data column 1 | data column 2 |  | alice | bob |  When I press the "blue" button  Then the result is:  """  A multiple line  string of data  """  #comments can be added as needed  Scenario Outline: Scenario or example description  Given I setup config with "<setting>"  When I push button "<button>"  Then "<result>" happens  Examples:  | setting | button | result |  | a | red | there is a beep |  | b | blue | there is no beep | 

References edit

  1. ^ a b "Behat/CHANGELOG.md at master · Behat/Behat". github.com. Retrieved 2021-03-27.
  2. ^ "Cucumber Common Components". GitHub. 14 November 2021.
  3. ^ community, Alexander Andryashin, Ivan Krutov, Kirill Merkushev and the Aerokube. "Aerokube Selenoid | A cross browser Selenium solution for Docker". aerokube.com. Retrieved 2024-02-19.{{cite web}}: CS1 maint: multiple names: authors list (link)
  4. ^ aerokube/selenoid, Aerokube, 2024-02-17, retrieved 2024-02-19
  5. ^ Marynicz, Daniel (2023-11-17), Daniel-Marynicz/BehatParallelExtension, retrieved 2024-02-19
  6. ^ BDD With Behat - Tuts+ Code Tutorial. Code.tutsplus.com (2013-12-23). Retrieved on 2015-03-19.
  7. ^ Vanmeert, Neal (2024-01-24), dutchiexl/BehatHtmlFormatterPlugin, retrieved 2024-02-19

External links edit

  • Official website  


behat, software, topic, this, article, meet, wikipedia, notability, guidelines, products, services, please, help, demonstrate, notability, topic, citing, reliable, secondary, sources, that, independent, topic, provide, significant, coverage, beyond, mere, triv. The topic of this article may not meet Wikipedia s notability guidelines for products and services Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention If notability cannot be shown the article is likely to be merged redirected or deleted Find sources Behat software news newspapers books scholar JSTOR July 2014 Learn how and when to remove this message 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 Developer s Konstantin KudryashovInitial release8 September 2010 13 years ago 2010 09 08 1 Stable release3 13 0 18 April 2023 12 months ago 2023 04 18 1 Repositorygithub wbr com wbr Behat wbr BehatWritten inPHPOperating systemCross platformTypeBehavior driven developmentLicenseMIT LicenseWebsitebehat wbr org Contents 1 Purpose 2 Benefits 3 Examples 4 References 5 External linksPurpose editBehat 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 2 a business readable domain specific language following defined patterns Benefits editTests 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 use to directly test php code and is often used with Selenium to remote control browsers as part of the scenarios The browsers under remote control can take videos 3 or screenshots of failures Using selenium or tools like selenoid 4 a grid of browsers can be remote controlled for parallel test execution There is also a module for running php only scenarios 5 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 6 Behat can output test results in a number of different formats including JUnit XML and HTML 7 Examples editThe preconditions after Given correspond to the PHP method name to execute Feature Simple description of this feature s story Describe benefit role and feature or user story Use as many lines as needed Background Given some step run for all scenarios Scenario Scenario or example description Given I setup preconditions with data column 1 data column 2 alice bob When I press the blue button Then the result is A multiple line string of data comments can be added as needed Scenario Outline Scenario or example description Given I setup config with lt setting gt When I push button lt button gt Then lt result gt happens Examples setting button result a red there is a beep b blue there is no beep References edit a b Behat CHANGELOG md at master Behat Behat github com Retrieved 2021 03 27 Cucumber Common Components GitHub 14 November 2021 community Alexander Andryashin Ivan Krutov Kirill Merkushev and the Aerokube Aerokube Selenoid A cross browser Selenium solution for Docker aerokube com Retrieved 2024 02 19 a href Template Cite web html title Template Cite web cite web a CS1 maint multiple names authors list link aerokube selenoid Aerokube 2024 02 17 retrieved 2024 02 19 Marynicz Daniel 2023 11 17 Daniel Marynicz BehatParallelExtension retrieved 2024 02 19 BDD With Behat Tuts Code Tutorial Code tutsplus com 2013 12 23 Retrieved on 2015 03 19 Vanmeert Neal 2024 01 24 dutchiexl BehatHtmlFormatterPlugin retrieved 2024 02 19External links editOfficial website nbsp Portal nbsp Free and open source software nbsp This computer programming related article is a stub You can help Wikipedia by expanding it vte Retrieved from https en wikipedia org w index php title Behat software amp oldid 1215772686, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.