# behat/behat

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/behat-behat).**

3,959 stars · 614 forks · PHP · MIT

## Links

- GitHub: https://github.com/Behat/Behat
- Homepage: http://behat.org
- awesome-repositories: https://awesome-repositories.com/repository/behat-behat.md

## Topics

`bdd` `behat` `behavior-driven-development` `cucumber` `documentation-tool` `gherkin` `php` `test-driven-development`

## Description

Behat is a behavior-driven development framework and test automation tool for PHP. It functions as a Gherkin test runner that maps natural language feature files to executable PHP methods to verify that software implementation aligns with business requirements.

The framework enables the definition of application behavior using a structured, human-readable format based on user stories, supporting localized keywords for non-English speaking stakeholders. It distinguishes itself through a driver-based browser simulation layer for user interface verification and specialized integrations for the Symfony kernel and Drupal workflows.

The toolset covers a broad range of capabilities including automated regression testing, web browser automation, and complex data handling via table transformations. It provides a command-line interface for test execution, lifecycle hooks for setup and teardown, and a plugin system for extending core functionality with third-party tools.

Execution results are available in multiple formats, including human-readable text, JSON, and JUnit XML.

## Tags

### Testing & Quality Assurance

- [Behavioral Testing Tools](https://awesome-repositories.com/f/testing-quality-assurance/behavioral-testing-tools.md) — Provides a complete framework for defining application expectations in plain language to align technical implementation with business requirements.
- [Behavior Driven Development](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/behavior-driven-development.md) — Implements behavior-driven development by mapping natural language specifications to executable PHP code.
- [Gherkin-based Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/end-to-end-testing-suites/end-to-end-testing-frameworks/gherkin-based-testing.md) — Executes end-to-end tests using human-readable Gherkin feature files to verify application behavior.
- [Acceptance Testing](https://awesome-repositories.com/f/testing-quality-assurance/acceptance-testing.md) — Verifies that PHP software implementation matches business requirements through natural language scenario execution.
- [Automation Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/acceptance-testing/automation-frameworks.md) — Provides an automation framework to verify business workflows through structured scenarios and step definitions.
- [Browser Automation](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/browser-automation.md) — Simulates user interactions with web pages through a browser driver to verify user interface behavior.
- [Business Requirement Validations](https://awesome-repositories.com/f/testing-quality-assurance/bdd-specification-mappings/business-requirement-validations.md) — Aligns technical implementation with business goals using structured Given-When-Then behavioral formats.
- [Behavior-Driven Scenario Definitions](https://awesome-repositories.com/f/testing-quality-assurance/behavior-driven-scenario-definitions.md) — Describes business expectations using a structured Given-When-Then format to document system behavior. ([source](https://docs.behat.org/en/latest/user_guide/writing_scenarios.html))
- [Behavioral Specifications](https://awesome-repositories.com/f/testing-quality-assurance/behavioral-specifications.md) — Enables the definition of application behavior using business-readable specifications and conversational contexts. ([source](https://docs.behat.org/en/latest/user_guide/gherkin.html))
- [Gherkin Feature Parsers](https://awesome-repositories.com/f/testing-quality-assurance/gherkin-feature-parsers.md) — Converts business-readable feature files into executable data structures using configurable compatibility modes. ([source](https://docs.behat.org/en/latest/user_guide/gherkin/parser_mode.html))
- [Automated Regression Verification](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/test-execution-orchestration/automated-test-runners/automated-regression-verification.md) — Executes behavioral specifications to detect regressions and ensure consistency during system updates.
- [BDD Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/end-to-end-testing-suites/end-to-end-testing-frameworks/php-testing-frameworks/bdd-frameworks.md) — Implements a behavior-driven development tool for PHP that executes human-readable test scenarios written in Gherkin.
- [State Expectation Validation](https://awesome-repositories.com/f/testing-quality-assurance/state-expectation-validation.md) — Uses assertion libraries to verify that the current application state matches the defined business expectations. ([source](https://docs.behat.org/en/latest/useful_resources.html))
- [Step Definition Mappings](https://awesome-repositories.com/f/testing-quality-assurance/step-definition-mappings.md) — Maps natural language Gherkin steps to executable PHP methods using regular expressions or attributes.
- [Test Suite Organization](https://awesome-repositories.com/f/testing-quality-assurance/unit-testing-frameworks/test-suite-organization.md) — Implements mechanisms for grouping related features and assigning them specific contexts to manage test expectations. ([source](https://docs.behat.org/en/latest/user_guide/configuration/suites.html))
- [Test Configuration Managers](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-configuration-managers.md) — Defines multiple named configuration profiles to switch between different testing environments. ([source](https://docs.behat.org/en/latest/user_guide/configuration.html))
- [Test Result Reporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/test-result-reporters.md) — Generates formatted reports of test execution outcomes in styles including human-readable text, JSON, and JUnit XML. ([source](https://docs.behat.org/en/latest/user_guide/command_line_tool/formatting.html))
- [Setup and Teardown Hooks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/setup-and-teardown-hooks.md) — Executes arbitrary PHP code before or after suites and scenarios to handle setup, teardown, and statistics. ([source](https://docs.behat.org/en/latest/user_guide/context/hooks.html))
- [Failure Flow Control](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/transient-failure-reruns/failure-flow-control.md) — Manages test execution flow, including the ability to stop on the first error or rerun failures. ([source](https://docs.behat.org/en/latest/user_guide/command_line_tool.html))
- [Label-Based Filtering](https://awesome-repositories.com/f/testing-quality-assurance/label-based-filtering.md) — Uses tags and labels on features and scenarios to filter which subsets of the test suite are executed. ([source](https://docs.behat.org/en/latest/user_guide/organizing.html))
- [Scenario Parameterization](https://awesome-repositories.com/f/testing-quality-assurance/scenario-parameterization.md) — Executes a single scenario template multiple times using a table of values to test various data inputs. ([source](https://docs.behat.org/en/latest/user_guide/writing_scenarios.html))
- [Scenario Prerequisite Steps](https://awesome-repositories.com/f/testing-quality-assurance/scenario-prerequisite-steps.md) — Runs common setup steps before every scenario in a feature to eliminate repetitive test preparation. ([source](https://docs.behat.org/en/latest/user_guide/writing_scenarios.html))
- [Step Argument Transformations](https://awesome-repositories.com/f/testing-quality-assurance/step-argument-transformations.md) — Converts string arguments from test steps into specific data types or objects before they reach the method definition. ([source](https://docs.behat.org/en/latest/user_guide/context/transformations.html))
- [Test Suite Execution](https://awesome-repositories.com/f/testing-quality-assurance/test-suite-execution.md) — Provides a command-line interface to execute specific features, scenarios, or full test suites. ([source](https://docs.behat.org/en/latest/user_guide/command_line_tool.html))
- [Targeted Test Execution](https://awesome-repositories.com/f/testing-quality-assurance/test-suite-execution/targeted-test-execution.md) — Enables the execution of a designated subset of tests rather than the entire collection to isolate functional areas. ([source](https://docs.behat.org/en/latest/user_guide/command_line_tool/identifying.html))
- [Test Context Sharing](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-orchestration/test-setup-orchestrators/test-lifecycle-hooks/test-context-sharing.md) — Allows different test context classes to share data and references during the setup phase. ([source](https://docs.behat.org/en/latest/cookbooks/accessing_contexts_from_each_other.html))

### Development Tools & Productivity

- [Step-to-Code Mappings](https://awesome-repositories.com/f/development-tools-productivity/visual-to-code-sync-engines/code-to-graph-parsers/symbol-to-node-linking/prose-to-code-linking/step-to-code-mappings.md) — Links natural language steps in feature files to specific PHP methods using attributes or regular expressions. ([source](https://docs.behat.org/en/latest/quick_start.html))
- [Test Result Formatters](https://awesome-repositories.com/f/development-tools-productivity/configuration-formatters/runner-customizations/test-result-formatters.md) — Allows generating test results in various formats by listening to internal framework events. ([source](https://docs.behat.org/en/latest/cookbooks/custom_formatter.html))
- [Output Formatters](https://awesome-repositories.com/f/development-tools-productivity/output-formatters.md) — Configures how test results are presented by enabling specific formatters within profile settings. ([source](https://docs.behat.org/en/latest/user_guide/configuration.html))
- [Test Console Formatting](https://awesome-repositories.com/f/development-tools-productivity/test-console-formatting.md) — Renders test results in various styles, such as pretty or JUnit, directing them to the console or files. ([source](https://docs.behat.org/en/latest/user_guide/command_line_tool.html))

### Software Engineering & Architecture

- [Browser Driver Abstractions](https://awesome-repositories.com/f/software-engineering-architecture/browser-driver-abstractions.md) — Abstracts web interactions through a driver layer to verify UI behavior across different browser engines.
- [Step Definition Contexts](https://awesome-repositories.com/f/software-engineering-architecture/context-sharing/shared-test-contexts/step-definition-contexts.md) — Uses specialized context classes to isolate and organize step definitions for behavioral tests.
- [Test Configuration Injection](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/environment-variable-management/environment-variable-injection/runtime-environment-injections/test-configuration-injection.md) — Injects dynamic configuration values and environment variables into test context constructors during bootstrapping. ([source](https://docs.behat.org/en/latest/user_guide/context.html))
- [Environment Variable-Based Configuration](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/environment-variable-management/environment-variables/environment-variable-based-configuration.md) — Uses JSON-formatted environment variables to define default configuration values without hardcoding. ([source](https://docs.behat.org/en/latest/user_guide/configuration.html))
- [Step Argument Transformations](https://awesome-repositories.com/f/software-engineering-architecture/data-transformation-hooks/input-transformation-pipelines/step-argument-transformations.md) — Implements a pipeline to transform raw string arguments from Gherkin steps into typed PHP objects.
- [Core Capability Extensions](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/developer-authoring-interfaces/custom-module-implementations/module-functionality-extenders/plugin-extenders/core-capability-extensions.md) — Integrates and configures external plugins to extend the core functionality of the testing framework. ([source](https://docs.behat.org/en/latest/user_guide/configuration.html))
- [Third-Party Plugins](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/third-party-plugins.md) — Integrates third-party plugins to add custom behaviors, browser automation, and specialized reporters. ([source](https://docs.behat.org/en/latest/))

### Web Development

- [Web Browser Simulation](https://awesome-repositories.com/f/web-development/headless-browser-emulation/web-browser-simulation.md) — Simulates user interactions with web pages by controlling a browser through a driver to verify interface behavior. ([source](https://docs.behat.org/en/latest/user_guide/integrations.html))

### Artificial Intelligence & ML

- [Step State Trackers](https://awesome-repositories.com/f/artificial-intelligence-ml/step-based-schedulers/step-execution-engines/execution-step-controllers/step-state-trackers.md) — Reports each executed test step as successful, failed, or pending to provide detailed execution reports. ([source](https://docs.behat.org/en/latest/user_guide/context/definitions.html))

### Data & Databases

- [Scenario](https://awesome-repositories.com/f/data-databases/data-querying/table-item-filters/numeric-range-filters/tag-filters/scenario.md) — Excludes specific scenarios globally based on tags to prevent certain tests from running unless requested. ([source](https://docs.behat.org/en/latest/user_guide/configuration.html))
- [Gherkin Table Transformations](https://awesome-repositories.com/f/data-databases/table-data-processing/data-table-parsing/gherkin-table-transformations.md) — Converts tables or rows from test steps into structured arrays or objects for simplified logic. ([source](https://docs.behat.org/en/latest/user_guide/context/transformations.html))

### DevOps & Infrastructure

- [Configuration Profiles](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-profiles.md) — Manages multiple named configuration profiles to switch between different testing environments and targets.
- [Lifecycle Hook Filters](https://awesome-repositories.com/f/devops-infrastructure/label-based-selection/target-selection-rules/selector-based-rule-filtering/tag-based-rule-filtering/lifecycle-hook-filters.md) — Provides the ability to restrict when specific setup and teardown hooks run using tags associated with scenarios. ([source](https://docs.behat.org/en/latest/user_guide/context/hooks.html))

### Programming Languages & Runtimes

- [Event-Hook Extension Systems](https://awesome-repositories.com/f/programming-languages-runtimes/class-inheritance/native-class-subclassing/plugin-and-subclass-extension-systems/event-hook-extension-systems.md) — Provides an event-driven system allowing plugins to intercept and trigger custom logic during the test lifecycle.
- [Complex Data Arguments](https://awesome-repositories.com/f/programming-languages-runtimes/function-argument-passing/complex-data-arguments.md) — Supports sending rich data structures, such as Gherkin tables or multiline strings, to step definitions. ([source](https://docs.behat.org/en/latest/user_guide/writing_scenarios.html))
