Drupal helpers
These are the public helpers the Drupal steps are built on. Your own step definitions call them on $this, the same way the shipped steps do, as Scenario styles explains. A trait's page gives each of its helpers a signature and a description.
HELPERS.md holds these helpers and the web helpers on 1 page. It ships with the package, so an AI coding agent in your project can read it from vendor/.
| Name | Class | Helpers | Description |
|---|---|---|---|
| Authentication | Drupal\AuthTrait | 6 | Creates users and roles, logs them in, and removes them afterwards. |
| BigPipe | Drupal\BigPipeTrait | 2 | Wait for Drupal BigPipe placeholders to be replaced on JavaScript scenarios. |
| Blocks | Drupal\BlockTrait | 6 | Manage Drupal blocks. |
| Caches and cron | Drupal\CacheTrait | 2 | Invalidate Drupal caches and run cron from within a scenario. |
| Configuration | Drupal\ConfigTrait | 3 | Assert and set stored Drupal configuration values with automatic revert. |
| Content | Drupal\ContentTrait | 8 | Manage Drupal content with workflow and moderation support. |
| Content blocks | Drupal\ContentBlockTrait | 4 | Manage Drupal content blocks. |
| DraggableViews | Drupal\DraggableviewsTrait | 3 | Order items in the Drupal Draggable Views. |
| Drush | Drupal\DrushTrait | 3 | Run Drush commands and assert their output. |
| ECK entities | Drupal\EckTrait | 5 | Manage Drupal ECK entities of an existing entity type and bundle. |
Drupal\EmailTrait | 11 | Test Drupal email functionality with content verification. | |
| Entity lifecycle | Drupal\EntityLifecycleTrait | 7 | Creates Drupal entities and removes them when the scenario ends. |
| Entity queries | Drupal\QueryTrait | 5 | Finds the entities a step reads, asserts on or deletes. |
| File field fixtures | Drupal\FixtureFileTrait | 1 | Resolves a fixture file path for a file or image field. |
| Files | Drupal\FileTrait | 6 | Manage Drupal file entities with upload and storage operations. |
| Media | Drupal\MediaTrait | 5 | Manage Drupal media entities with type-specific field handling. |
| Menus | Drupal\MenuTrait | 6 | Manage Drupal menus and menu links. |
| Modules | Drupal\ModuleTrait | 5 | Enable and disable Drupal modules with automatic state restoration. |
| Paragraphs | Drupal\ParagraphsTrait | 4 | Manage Drupal paragraphs entities with structured field data. |
| Queues | Drupal\QueueTrait | 5 | Manage and assert Drupal queue state. |
| Redirects | Drupal\RedirectTrait | 3 | Manage Drupal redirect entities provided by the contrib redirect module. |
| Search API | Drupal\SearchApiTrait | 3 | Run Drupal Search API indexing and cron hooks. |
| State API | Drupal\StateTrait | 3 | Manage and assert Drupal State API values with automatic revert. |
| Taxonomy | Drupal\TaxonomyTrait | 6 | Manage Drupal taxonomy terms with vocabulary organization. |
| Testmode | Drupal\TestmodeTrait | 2 | Configure Drupal Testmode module for controlled testing scenarios. |
| Users | Drupal\UserTrait | 12 | Manage Drupal users with role and permission assignments. |
| Watchdog | Drupal\WatchdogTrait | 3 | Assert Drupal does not trigger PHP errors during scenarios using Watchdog. |
| Webforms | Drupal\WebformTrait | 4 | Manage Drupal webforms. |