Skip to main content

Web steps

These steps work on any website, whatever it's built with. WebContext composes all of them, and so does DrupalContext, which extends it. A trait's page gives each of its steps an example and lists the options and the prerequisites the trait declares.

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

NameTraitDescription
AccessibilityAccessibilityTraitAssess accessibility of rendered pages.
Basic authenticationBasicAuthTraitKeep HTTP basic authentication applied across session resets.
CookiesCookieTraitVerify and inspect browser cookies.
Dropzone uploadsDropzoneTraitSimulate a real multi-file drag-and-drop gesture onto a Dropzone target.
ElementsElementTraitInteract with HTML elements using CSS selectors and DOM attributes.
Failure diagnosticsDiagnosticsTraitAppend on-failure diagnostics to the failure message of any failed step.
File downloadsFileDownloadTraitTest file download functionality with content verification.
Form fieldsFieldTraitManipulate form fields and verify widget functionality.
IframesIframeTraitSwitch between iframes and the root document.
JavaScript errorsJavascriptTraitAutomatically detect JavaScript errors during test execution.
JSON responsesJsonTraitAssert JSON responses with path and schema checks.
KeyboardKeyboardTraitSimulate keyboard interactions in the browser.
LinksLinkTraitVerify link elements with attribute and content assertions.
Mapped valuesMappingTraitReplace {{ Key }} tokens in step arguments and table cells.
MessagesMessageTraitAssert status, error, warning and success messages rendered on the page.
Meta tagsMetatagTraitAssert <meta> tags and head/SEO markup in page markup.
ModalsModalTraitInteract with and assert modals.
Page regionsRegionTraitInteract with and assert against named page regions.
PathsPathTraitNavigate and verify paths with URL validation.
Random valuesRandomTraitReplace random-value tokens in step arguments and table cells.
Relative datesDateTraitConvert relative date expressions into timestamps or formatted dates.
Response headersResponseTraitVerify HTTP response headers.
Responsive layoutsResponsiveTraitTest responsive layouts with viewport control.
REST APIsRestTraitTest REST APIs with lightweight steps.
Shell commandsCommandTraitRun local shell commands and assert on their result.
TablesTableTraitInteract with HTML table elements and assert their content.
WaitsWaitTraitWait for a period of time or for AJAX to finish.
XML responsesXmlTraitAssert XML responses with element and attribute checks.