Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Behat Skill

ASecurity

Generates Behat BDD tests for PHP with Gherkin feature files and MinkContext for browser testing. Use when user mentions "Behat", "PHP BDD", "Mink", "behat.yml". Triggers on: "Behat", "PHP BDD", "Mink", "behat.yml", "FeatureContext PHP".

36 stars
0 votes
0 copies
0 views
Added 9/22/2026
code-qualitygophpbashsqlnodetestingdebugginggitapici/cd

Works with

api

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add NVlabs/Skill2Env --skill behat-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Behat Skill?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Behat Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nvlabs-behat-skill/badge)](https://www.skillsdirectory.com/skills/nvlabs-behat-skill)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: behat-skill
description: >
  Generates Behat BDD tests for PHP with Gherkin feature files and MinkContext
  for browser testing. Use when user mentions "Behat", "PHP BDD", "Mink",
  "behat.yml". Triggers on: "Behat", "PHP BDD", "Mink", "behat.yml",
  "FeatureContext PHP".
languages:
  - PHP
category: bdd-testing
license: MIT
metadata:
  author: TestMu AI
  version: "1.0"
---

# Behat BDD Skill

## Core Patterns

### Feature File (features/login.feature)

```gherkin
Feature: User Login
  As a user I want to log in

  Scenario: Successful login
    Given I am on "/login"
    When I fill in "email" with "user@test.com"
    And I fill in "password" with "password123"
    And I press "Login"
    Then I should see "Dashboard"
    And I should be on "/dashboard"

  Scenario: Invalid credentials
    Given I am on "/login"
    When I fill in "email" with "wrong@test.com"
    And I fill in "password" with "wrong"
    And I press "Login"
    Then I should see "Invalid credentials"
```

### Custom Context (features/bootstrap/LoginContext.php)

```php
<?php
use Behat\MinkExtension\Context\MinkContext;
use Behat\Behat\Context\Context;

class LoginContext extends MinkContext implements Context
{
    /**
     * @When I login as :email with password :password
     */
    public function iLoginAs(string $email, string $password): void
    {
        $this->visit('/login');
        $this->fillField('email', $email);
        $this->fillField('password', $password);
        $this->pressButton('Login');
    }

    /**
     * @Then I should see the dashboard
     */
    public function iShouldSeeTheDashboard(): void
    {
        $this->assertSession()->addressEquals('/dashboard');
        $this->assertSession()->pageTextContains('Welcome');
    }

    /**
     * @Then the response time should be under :ms milliseconds
     */
    public function responseUnder(int $ms): void
    {
        // Custom performance assertion
    }
}
```

### Built-in MinkContext Steps

```gherkin
# Navigation
Given I am on "/path"
When I go to "/path"
When I reload the page

# Forms
When I fill in "field" with "value"
When I select "option" from "select"
When I check "checkbox"
When I uncheck "checkbox"
When I press "button"
When I attach the file "path" to "field"

# Assertions
Then I should see "text"
Then I should not see "text"
Then I should be on "/path"
Then the response status code should be 200
Then the "field" field should contain "value"
Then I should see an "css-selector" element
Then print current URL
```

### behat.yml

```yaml
default:
  suites:
    default:
      contexts:
        - LoginContext
        - Behat\MinkExtension\Context\MinkContext
  extensions:
    Behat\MinkExtension:
      base_url: 'http://localhost:3000'
      sessions:
        default:
          selenium2:
            browser: chrome
            wd_host: 'http://localhost:4444/wd/hub'
```

### Tags

```bash
./vendor/bin/behat --tags=@smoke
./vendor/bin/behat --tags="@smoke&&~@slow"
```

## Setup: `composer require --dev behat/behat behat/mink-extension behat/mink-selenium2-driver`
## Init: `./vendor/bin/behat --init`

### Cloud Execution on TestMu AI

Set environment variables: `LT_USERNAME`, `LT_ACCESS_KEY`

```yaml
# behat.yml
default:
  extensions:
    Behat\MinkExtension:
      base_url: 'https://your-app.com'
      selenium2:
        wd_host: 'https://hub.lambdatest.com/wd/hub'
        capabilities:
          browser: 'chrome'
          extra_capabilities:
            'LT:Options':
              user: '%env(LT_USERNAME)%'
              accessKey: '%env(LT_ACCESS_KEY)%'
              build: 'Behat Build'
              name: 'Behat Test'
              platformName: 'Windows 11'
              video: true
              console: true
              network: true
```
## Run: `./vendor/bin/behat` or `./vendor/bin/behat features/login.feature`

## Deep Patterns

See `reference/playbook.md` for production-grade patterns:

| Section | What You Get |
|---------|-------------|
| §1 Project Setup | behat.yml with suites, Mink extension, profiles, project structure |
| §2 Feature Files | Gherkin with Scenario Outline, Background, TableNode data |
| §3 Context Classes | Step definitions, dependency injection, API context, assertions |
| §4 Hooks | BeforeSuite/Scenario/Step, screenshot on failure, transaction rollback |
| §5 Page Objects | Page Object pattern with elements map, reusable components |
| §6 LambdaTest Integration | Remote Selenium config, cloud browser profiles |
| §7 Custom Formatters | HTML report formatter, result collection |
| §8 CI/CD Integration | GitHub Actions with MySQL, Selenium, JUnit reports |
| §9 Debugging Table | 12 common problems with causes and fixes |
| §10 Best Practices | 14-item BDD testing checklist |

Attribution

NVlabsNVlabs
View sourceMore from NVlabs →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman Review

Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment is one line: location, problem, fix. Use when user says "review this PR", "code review", "review the diff", "/review", or invokes /caveman-review. Auto-triggers when reviewing pull requests.

1066601 votes

Caveman Commit

Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit", "/commit", or invokes /caveman-commit. Auto-triggers when staging changes.

1066601 votes

Springboot Verification

Verification loop for Spring Boot projects: build, static analysis, tests with coverage, security scans, and diff review before release or PR.

2456590 votes

Verification Loop

一个全面的 Claude Code 会话验证系统。

2456590 votes

Django Verification

Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.

2456590 votes
View all in code-quality →