behat-steps

A set of Behat rules for `.feature` files and PHP test context files. Behat is a tool for writing browser and application tests in plain, human-readable scenarios, including tests for Drupal websites.

In plain words
What is it for?
It helps write or maintain Behat scenarios that interact with web elements, check HTTP results, manage Drupal blocks and content, and verify browser behavior.
Why use it?
It provides a reference for existing test actions, reducing duplicated step definitions and uncertainty about how to test pages, links, cookies, downloads, paths, responses, and waiting.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/abderrahimghazali/cursor-rules/behat-steps
Clone the repo
git clone --depth 1 https://github.com/abderrahimghazali/cursor-rules

Made for: Cursor.

Per session 15,618 This file is loaded in full into every session.
When invoked 15,618 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.15618 $0.15618
Opus 5 $0.07809 $0.07809
Sonnet 5 $0.03124 $0.03124
Haiku 4.5 $0.01562 $0.01562

Measured yesterday against content hash 5e59e00977ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

behat-steps scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to behat-steps — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/behat-steps.mdc · 2,776 lines

How it starts

The opening of the file, as written. The whole thing — 2,776 lines — stays where its author put it; the contents beside it link to each section on GitHub.


description: globs: *.feature,FeatureContext.php,*Context.php alwaysApply: false

Behat Steps - Claude Memory

Available steps

Index of Generic steps

Class Description
CookieTrait Verify and inspect browser cookies.
DateTrait Convert relative date expressions into timestamps or formatted dates.
ElementTrait Interact with HTML elements using CSS selectors and DOM attributes.
FileDownloadTrait Test file download functionality with content verification.
KeyboardTrait Simulate keyboard interactions in Drupal browser testing.
LinkTrait Verify link elements with attribute and content assertions.
PathTrait Navigate and verify paths with URL validation.
ResponseTrait Verify HTTP responses with status code and header checks.
WaitTrait Wait for a period of time or for AJAX to finish.

Index of Drupal steps

Class Description
Drupal\BigPipeTrait Bypass Drupal BigPipe when rendering pages.
Drupal\BlockTrait Manage Drupal blocks.
Drupal\ContentBlockTrait Manage Drupal content blocks.
Drupal\ContentTrait Manage Drupal content with workflow and moderation support.
Drupal\DraggableviewsTrait Order items in the Drupal Draggable Views.
Drupal\EckTrait Manage Drupal ECK entities with custom type and bundle creation.
Drupal\EmailTrait Test Drupal email functionality with content verification.
Drupal\FieldTrait Manipulate Drupal form fields and verify widget functionality.
Drupal\FileTrait Manage Drupal file entities with upload and storage operations.
Drupal\MediaTrait Manage Drupal media entities with type-specific field handling.
Drupal\MenuTrait Manage Drupal menu systems and menu link rendering.
Drupal\MetatagTrait Assert <meta> tags in page markup.
Drupal\OverrideTrait Override Drupal Extension behaviors.
Drupal\ParagraphsTrait Manage Drupal paragraphs entities with structured field data.
Drupal\SearchApiTrait Assert Drupal Search API with index and query operations.
Drupal\TaxonomyTrait Manage Drupal taxonomy terms with vocabulary organization.
Drupal\TestmodeTrait Configure Drupal Testmode module for controlled testing scenarios.
Drupal\UserTrait Manage Drupal users with role and permission assignments.
Drupal\WatchdogTrait Assert Drupal does not trigger PHP errors during scenarios using Watchdog.

Read the full file on GitHub · 2,776 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 2,776 lines · 15,618 tokens per session scan A 5e59e00977ad

Subscribe to this mod's changes

behat-steps is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 15,618 tokens to every session, about $0.0781 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to behat-steps, differing in 0 lines, and is treated as a copy.