{"enrichment":{"faq":[{"a":"behat-skill enables you to write Behat tests for PHP by using Gherkin feature files that describe application behavior in plain language. You define scenarios with Given-When-Then steps, then map those steps to PHP code in context classes. Create a `features/` directory with `.feature` files, set up a `FeatureContext` class to implement step definitions, and run `behat` from the command line. This approach bridges business requirements and automated test coverage through readable, executable specifications.","q":"How do you write Behat tests for PHP web applications?"},{"a":"behat-skill uses a `behat.yml` configuration file to define test suites and contexts. A basic example includes specifying the default suite, the features path (typically `features/`), the bootstrap path for context classes, and the context class name (usually `FeatureContext`). You can also configure profiles for different environments, set output formatters (like `pretty` or `html`), and define extensions like MinkExtension for browser automation. The configuration file allows you to organize multiple test suites and control how Behat discovers and executes your scenarios.","q":"What is a behat.yml configuration example for basic setup?"},{"a":"behat-skill integrates with MinkExtension to enable browser automation through MinkContext. Install the Mink library and configure it in `behat.yml` with a driver (such as Selenium2 for real browsers). Extend your `FeatureContext` class with `MinkContext` to gain step definitions for clicking elements, filling form fields, and navigating pages. MinkContext provides built-in steps like `I fill in \"field\" with \"value\"` and `I press \"button\"`, allowing you to write feature files that interact with web forms without writing custom step code for common interactions.","q":"How do you set up behat with MinkContext for browser automation and form interaction testing?"},{"a":"behat-skill allows you to create custom step definitions by writing methods in your context classes annotated with `@Given`, `@When`, or `@Then` attributes. Define a method that matches your Gherkin step text using regex patterns, then implement the test logic in PHP. For domain-specific scenarios, create additional context classes that extend `BehatContext` and define steps relevant to your application's business logic. You can organize multiple context classes by suite and combine them using composition or inheritance, enabling reusable, maintainable test code tailored to your specific application needs.","q":"How do you create custom step definitions and context classes for domain-specific test scenarios?"},{"a":"behat-skill integrates into CI/CD pipelines by running `behat` as a command-line tool in your build process. Configure output formatters in `behat.yml` to generate reports (such as `html`, `json`, or `junit` formats) that your CI system can parse and display. Use tags like `@smoke` or `@critical` to filter which scenarios run in different pipeline stages. For debugging, enable verbose output with `--verbose` flags, capture screenshots on failure using Mink hooks, and use `@BeforeScenario` and `@AfterScenario` hooks to set up and tear down test state. Most CI platforms (GitHub Actions, GitLab CI, Jenkins) support Behat natively.","q":"How do you integrate Behat tests into CI/CD pipelines with reporting and debugging?"},{"a":"behat-skill differs from PHPUnit in that Behat is purpose-built for behavior-driven development using Gherkin's human-readable Given-When-Then syntax, making it ideal for acceptance testing and stakeholder communication. PHPUnit is a unit testing framework focused on testing individual functions and classes with code-level assertions. behat-skill excels at describing application workflows and user interactions in business language, while PHPUnit is better suited for testing internal logic and edge cases. Many projects use both: Behat for high-level acceptance tests and PHPUnit for low-level unit tests, creating a comprehensive testing pyramid.","q":"What is the difference between behat and phpunit for BDD testing?"}],"shadow_tags":["behavior-driven-development","gherkin-syntax","browser-automation","test-automation","selenium-integration","cloud-testing","php-testing-framework","acceptance-testing","test-reporting","ci-cd-pipeline"],"summary_rewrite":"This skill enables you to create and run Behat behavior-driven development tests using Gherkin syntax, making it straightforward to validate PHP web application behavior through readable, executable specifications. Leverage structured scenario definitions to bridge the gap between business requirements and automated test coverage."},"files":[{"bytes":4774,"path":"behat-skill/SKILL.md","sha256":"5c6870df2585c8fcd65ee4baf474314f4772ccf009854401e6d99a66dfe412ef","url":"https://skillfed.io/files/LambdaTest/agent-skills/behat-skill/c3d9a309/SKILL.md"}],"id":"LambdaTest/agent-skills/behat-skill","links":{"html":"https://skillfed.io/LambdaTest/agent-skills/behat-skill","md":"https://skillfed.io/LambdaTest/agent-skills/behat-skill.md","repo":"https://github.com/LambdaTest/agent-skills"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":68,"language":"Python","last_updated":"2026-07-24","license":"MIT","name":"behat-skill","publisher":"LambdaTest","stars":339},"relations":{"similar":[{"id":"LambdaTest/agent-skills/behave-skill"},{"id":"LambdaTest/agent-skills/reqnroll-skill"},{"id":"LambdaTest/agent-skills/specflow-skill"},{"id":"LambdaTest/agent-skills/cucumber-skill"},{"id":"LambdaTest/agent-skills/phpunit-skill"},{"id":"LambdaTest/agent-skills/laravel-dusk-skill"},{"id":"LambdaTest/agent-skills/codeception-skill"},{"id":"LambdaTest/agent-skills/lettuce-skill"},{"id":"LambdaTest/agent-skills/serenity-bdd-skill"},{"id":"LambdaTest/agent-skills/webdriverio-skill"}]},"slug":{"owner":"LambdaTest","repo":"agent-skills","skill":"behat-skill"},"version":"c3d9a309"}
