Skip to main content

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/.

NameClassHelpersDescription
AuthenticationDrupal\AuthTrait6Creates users and roles, logs them in, and removes them afterwards.
BigPipeDrupal\BigPipeTrait2Wait for Drupal BigPipe placeholders to be replaced on JavaScript scenarios.
BlocksDrupal\BlockTrait6Manage Drupal blocks.
Caches and cronDrupal\CacheTrait2Invalidate Drupal caches and run cron from within a scenario.
ConfigurationDrupal\ConfigTrait3Assert and set stored Drupal configuration values with automatic revert.
ContentDrupal\ContentTrait8Manage Drupal content with workflow and moderation support.
Content blocksDrupal\ContentBlockTrait4Manage Drupal content blocks.
DraggableViewsDrupal\DraggableviewsTrait3Order items in the Drupal Draggable Views.
DrushDrupal\DrushTrait3Run Drush commands and assert their output.
ECK entitiesDrupal\EckTrait5Manage Drupal ECK entities of an existing entity type and bundle.
EmailDrupal\EmailTrait11Test Drupal email functionality with content verification.
Entity lifecycleDrupal\EntityLifecycleTrait7Creates Drupal entities and removes them when the scenario ends.
Entity queriesDrupal\QueryTrait5Finds the entities a step reads, asserts on or deletes.
File field fixturesDrupal\FixtureFileTrait1Resolves a fixture file path for a file or image field.
FilesDrupal\FileTrait6Manage Drupal file entities with upload and storage operations.
MediaDrupal\MediaTrait5Manage Drupal media entities with type-specific field handling.
MenusDrupal\MenuTrait6Manage Drupal menus and menu links.
ModulesDrupal\ModuleTrait5Enable and disable Drupal modules with automatic state restoration.
ParagraphsDrupal\ParagraphsTrait4Manage Drupal paragraphs entities with structured field data.
QueuesDrupal\QueueTrait5Manage and assert Drupal queue state.
RedirectsDrupal\RedirectTrait3Manage Drupal redirect entities provided by the contrib redirect module.
Search APIDrupal\SearchApiTrait3Run Drupal Search API indexing and cron hooks.
State APIDrupal\StateTrait3Manage and assert Drupal State API values with automatic revert.
TaxonomyDrupal\TaxonomyTrait6Manage Drupal taxonomy terms with vocabulary organization.
TestmodeDrupal\TestmodeTrait2Configure Drupal Testmode module for controlled testing scenarios.
UsersDrupal\UserTrait12Manage Drupal users with role and permission assignments.
WatchdogDrupal\WatchdogTrait3Assert Drupal does not trigger PHP errors during scenarios using Watchdog.
WebformsDrupal\WebformTrait4Manage Drupal webforms.