Skip to main content

Web helpers

These are the public helpers the web steps are built on. Your own step definitions call them on $this, the same way the shipped steps do, as Scenario styles explains. A page gives each helper of a trait or class a signature and a description, and Root context covers what WebRawContext itself adds.

HELPERS.md holds these helpers and the Drupal helpers on 1 page. It ships with the package, so an AI coding agent in your project can read it from vendor/.

NameClassHelpersDescription
AccessibilityAccessibilityTrait21Assess accessibility of rendered pages.
Basic authenticationBasicAuthTrait1Keep HTTP basic authentication applied across session resets.
CookiesCookieTrait4Verify and inspect browser cookies.
Dropzone uploadsDropzoneTrait1Simulate a real multi-file drag-and-drop gesture onto a Dropzone target.
ElementsElementTrait8Interact with HTML elements using CSS selectors and DOM attributes.
Failure diagnosticsDiagnosticsTrait12Append on-failure diagnostics to the failure message of any failed step.
File downloadsFileDownloadTrait8Test file download functionality with content verification.
Fixture filesFixtureDirectoryTrait5Resolves fixture files in the directory Mink's files_path parameter names.
Form fieldsFieldTrait13Manipulate form fields and verify widget functionality.
HeadingsHeadingTrait1Finds a heading by its text within the page or an element of it.
IframesIframeTrait1Switch between iframes and the root document.
JavaScript errorsJavascriptTrait2Automatically detect JavaScript errors during test execution.
JSON responsesJsonTrait7Assert JSON responses with path and schema checks.
Mapped valuesMappingTrait3Replace {{ Key }} tokens in step arguments and table cells.
MessagesMessageTrait3Assert status, error, warning and success messages rendered on the page.
Meta tagsMetatagTrait14Assert <meta> tags and head/SEO markup in page markup.
ModalsModalTrait9Interact with and assert modals.
Page regionsRegionTrait4Interact with and assert against named page regions.
PathsPathTrait4Navigate and verify paths with URL validation.
Random valuesRandomTrait10Replace random-value tokens in step arguments and table cells.
Relative datesDateTrait3Convert relative date expressions into timestamps or formatted dates.
Request headersRequestHeadersTrait1Holds the request headers shared by the traits that issue HTTP requests.
Responsive layoutsResponsiveTrait7Test responsive layouts with viewport control.
REST APIsRestTrait2Test REST APIs with lightweight steps.
Root contextWebRawContext21Root context carrying the plumbing every suite needs.
Shell commandsCommandTrait2Run local shell commands and assert on their result.
TablesTableTrait10Interact with HTML table elements and assert their content.
Vertical tablesTableTransposeTrait2Reads a vertical Gherkin table as 1 set of values per entity.
WaitsWaitTrait2Wait for a period of time or for AJAX to finish.
XML responsesXmlTrait9Assert XML responses with element and attribute checks.