{"id":19140261,"url":"https://github.com/drevops/behat-steps","last_synced_at":"2026-04-10T12:09:10.739Z","repository":{"id":37981744,"uuid":"138952639","full_name":"drevops/behat-steps","owner":"drevops","description":"🧪 A collection of Behat steps","archived":false,"fork":false,"pushed_at":"2026-01-21T06:13:55.000Z","size":2336,"stargazers_count":26,"open_issues_count":10,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-21T18:18:23.534Z","etag":null,"topics":["bdd","behat","behat-extension","behavior-driven-development","drupal","quality-assurance","test"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drevops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"drevops","patreon":"drevops"}},"created_at":"2018-06-28T01:48:05.000Z","updated_at":"2026-01-07T10:06:09.000Z","dependencies_parsed_at":"2024-02-05T02:42:21.199Z","dependency_job_id":"7cf1952a-8c21-4b2a-9bab-ed847a327ff9","html_url":"https://github.com/drevops/behat-steps","commit_stats":{"total_commits":149,"total_committers":15,"mean_commits":9.933333333333334,"dds":"0.32885906040268453","last_synced_commit":"885cc8d5a05b9613ac764f96da4bceb843396702"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/drevops/behat-steps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fbehat-steps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fbehat-steps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fbehat-steps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fbehat-steps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drevops","download_url":"https://codeload.github.com/drevops/behat-steps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fbehat-steps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdd","behat","behat-extension","behavior-driven-development","drupal","quality-assurance","test"],"created_at":"2024-11-09T07:16:57.425Z","updated_at":"2026-04-10T12:09:10.719Z","avatar_url":"https://github.com/drevops.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" rel=\"noopener\"\u003e\u003cimg width=200px height=200px src=\"logo.png\" alt=\"Behat Steps steps logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eA collection of Behat steps\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub Issues](https://img.shields.io/github/issues/DrevOps/behat-steps.svg)](https://github.com/DrevOps/behat-steps/issues)\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/DrevOps/behat-steps.svg)](https://github.com/DrevOps/behat-steps/pulls)\n[![Test](https://github.com/drevops/behat-steps/actions/workflows/test.yml/badge.svg)](https://github.com/drevops/behat-steps/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/drevops/behat-steps/graph/badge.svg?token=0UFU5VNNPI)](https://codecov.io/gh/drevops/behat-steps)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/drevops/behat-steps)\n![LICENSE](https://img.shields.io/github/license/drevops/behat-steps)\n![Renovate](https://img.shields.io/badge/renovate-enabled-green?logo=renovatebot)\n\n[![Total Downloads](https://poser.pugx.org/drevops/behat-steps/downloads)](https://packagist.org/packages/drevops/behat-steps)\n\n[![Vortex Ecosystem](https://img.shields.io/badge/%F0%9F%8C%80-Vortex%20Ecosystem-2C5A68?style=for-the-badge\u0026labelColor=65ACBC)](https://github.com/drevops/vortex)\n\u003c/div\u003e\n\n---\n\n## What is it?\n\nThis library is a collection of reusable testing actions and assertions for\nautomated testing with [Behat](https://behat.org). It’s designed to help you\nwrite reliable, readable, and maintainable tests faster.\n\nWe provide a set of generic traits that can be used in any PHP project, with\nspecial support for Drupal through additional step definitions. All methods are\nproperly namespaced, so they won’t conflict with your existing custom step\ndefinitions.\n\nOur goal is to make this a go-to library for Behat steps. We maintain solid\n[test coverage](tests/behat/features) to avoid false positives and negatives,\nand follow [clear\nguidelines](CONTRIBUTING.md#steps-format) to keep the step language consistent.\n\nWe actively maintain this package and welcome [contributions](CONTRIBUTING.md)\nfrom the community.\n\n## Available steps\n\n### Index of Generic steps\n\n| Class | Description |\n| --- | --- |\n| [CookieTrait](STEPS.md#cookietrait) | Verify and inspect browser cookies. |\n| [DateTrait](STEPS.md#datetrait) | Convert relative date expressions into timestamps or formatted dates. |\n| [ElementTrait](STEPS.md#elementtrait) | Interact with HTML elements using CSS selectors and DOM attributes. |\n| [FieldTrait](STEPS.md#fieldtrait) | Manipulate form fields and verify widget functionality. |\n| [FileDownloadTrait](STEPS.md#filedownloadtrait) | Test file download functionality with content verification. |\n| [IframeTrait](STEPS.md#iframetrait) | Switch between iframes and the root document. |\n| [JavascriptTrait](STEPS.md#javascripttrait) | Automatically detect JavaScript errors during test execution. |\n| [KeyboardTrait](STEPS.md#keyboardtrait) | Simulate keyboard interactions in Drupal browser testing. |\n| [LinkTrait](STEPS.md#linktrait) | Verify link elements with attribute and content assertions. |\n| [MetatagTrait](STEPS.md#metatagtrait) | Assert `\u003cmeta\u003e` tags in page markup. |\n| [ModalTrait](STEPS.md#modaltrait) | Interact with and assert modals. |\n| [PathTrait](STEPS.md#pathtrait) | Navigate and verify paths with URL validation. |\n| [ResponseTrait](STEPS.md#responsetrait) | Verify HTTP responses with status code and header checks. |\n| [ResponsiveTrait](STEPS.md#responsivetrait) | Test responsive layouts with viewport control. |\n| [RestTrait](STEPS.md#resttrait) | Lightweight REST API testing with no Drupal dependencies. |\n| [TableTrait](STEPS.md#tabletrait) | Interact with HTML table elements and assert their content. |\n| [WaitTrait](STEPS.md#waittrait) | Wait for a period of time or for AJAX to finish. |\n| [XmlTrait](STEPS.md#xmltrait) | Assert XML responses with element and attribute checks. |\n\n### Index of Drupal steps\n\n| Class | Description |\n| --- | --- |\n| [Drupal\\BigPipeTrait](STEPS.md#drupalbigpipetrait) | Bypass Drupal BigPipe when rendering pages. |\n| [Drupal\\BlockTrait](STEPS.md#drupalblocktrait) | Manage Drupal blocks. |\n| [Drupal\\CacheTrait](STEPS.md#drupalcachetrait) | Invalidate specific Drupal caches from within a scenario. |\n| [Drupal\\ConfigOverrideTrait](STEPS.md#drupalconfigoverridetrait) | Disable Drupal config overrides from settings.php during a scenario. |\n| [Drupal\\ContentBlockTrait](STEPS.md#drupalcontentblocktrait) | Manage Drupal content blocks. |\n| [Drupal\\ContentTrait](STEPS.md#drupalcontenttrait) | Manage Drupal content with workflow and moderation support. |\n| [Drupal\\DraggableviewsTrait](STEPS.md#drupaldraggableviewstrait) | Order items in the Drupal Draggable Views. |\n| [Drupal\\EckTrait](STEPS.md#drupalecktrait) | Manage Drupal ECK entities with custom type and bundle creation. |\n| [Drupal\\EmailTrait](STEPS.md#drupalemailtrait) | Test Drupal email functionality with content verification. |\n| [Drupal\\FileTrait](STEPS.md#drupalfiletrait) | Manage Drupal file entities with upload and storage operations. |\n| [Drupal\\MediaTrait](STEPS.md#drupalmediatrait) | Manage Drupal media entities with type-specific field handling. |\n| [Drupal\\MenuTrait](STEPS.md#drupalmenutrait) | Manage Drupal menu systems and menu link rendering. |\n| [Drupal\\ModuleTrait](STEPS.md#drupalmoduletrait) | Enable and disable Drupal modules with automatic state restoration. |\n| [Drupal\\OverrideTrait](STEPS.md#drupaloverridetrait) | Override Drupal Extension behaviors. |\n| [Drupal\\ParagraphsTrait](STEPS.md#drupalparagraphstrait) | Manage Drupal paragraphs entities with structured field data. |\n| [Drupal\\QueueTrait](STEPS.md#drupalqueuetrait) | Manage and assert Drupal queue state. |\n| [Drupal\\SearchApiTrait](STEPS.md#drupalsearchapitrait) | Assert Drupal Search API with index and query operations. |\n| [Drupal\\StateTrait](STEPS.md#drupalstatetrait) | Manage and assert Drupal State API values with automatic revert. |\n| [Drupal\\TaxonomyTrait](STEPS.md#drupaltaxonomytrait) | Manage Drupal taxonomy terms with vocabulary organization. |\n| [Drupal\\TestmodeTrait](STEPS.md#drupaltestmodetrait) | Configure Drupal Testmode module for controlled testing scenarios. |\n| [Drupal\\TimeTrait](STEPS.md#drupaltimetrait) | Control system time in tests using Drupal state overrides. |\n| [Drupal\\UserTrait](STEPS.md#drupalusertrait) | Manage Drupal users with role and permission assignments. |\n| [Drupal\\WatchdogTrait](STEPS.md#drupalwatchdogtrait) | Assert Drupal does not trigger PHP errors during scenarios using Watchdog. |\n| [Drupal\\WebformTrait](STEPS.md#drupalwebformtrait) | Manage Drupal webforms. |\n\n\n\n\n[//]: # (END)\n\n## Installation\n\n```bash\ncomposer require --dev drevops/behat-steps:^3\n```\n\n## Usage\n\nAdd required traits to your\n`FeatureContext.php` ([example](tests/behat/bootstrap/FeatureContext.php)):\n\n```php\n\u003c?php\n\nuse DrevOps\\BehatSteps\\CookieTrait;\n\n/**\n * Defines application features from the specific context.\n */\nclass FeatureContext extends DrupalContext {\n\n  use CookieTrait;\n\n}\n```\n\nEnsure that your [`behat.yml`](behat.yml) has all the required extensions\nenabled.\n\n### Exceptions\n\nThis library uses [Mink exception classes](https://mink.behat.org/en/latest/)\nfor\nconsistent error handling:\n\n| Exception                          | When thrown                                          |\n|------------------------------------|------------------------------------------------------|\n| `ElementNotFoundException`         | Element, field, link, or selector not found on page  |\n| `ExpectationException`             | Assertion fails (value mismatch, state verification) |\n| `UnsupportedDriverActionException` | Feature requires specific driver (e.g., Selenium)    |\n| `\\RuntimeException`                | Invalid input or processing error (not an assertion) |\n\nExample error messages:\n\n```\nElement matching css \"#my-element\" not found.\nLink with title \"My Link\" not found.\nSelect with id|name|label \"My Select\" not found.\nThe cookie with name \"session\" was not set.\n```\n\n### Skipping before scenario hooks\n\nSome traits provide `beforeScenario` hook implementations. These can be disabled\nby adding `@behat-steps-skip:METHOD_NAME` tag to your test.\n\nFor example, to skip `beforeScenario` hook from `ElementTrait`, add\n`@behat-steps-skip:ElementTrait` tag to the feature.\n\n## Writing tests with AI assistants\n\nCopy and paste below into your project's `CLAUDE.md` or `AGENTS.md` file.\n\n```\n## Writing Behat Tests\n\nAvailable step definitions are listed in `.behat-steps.txt`.\nRead this file before writing or modifying Behat tests.\nUse only step patterns from this file. Do not invent steps.\n\nIf `.behat-steps.txt` does not exist or is outdated, regenerate it:\n\n    ./vendor/bin/behat --definitions=i \u003e .behat-steps.txt\n\nRegenerate after adding new step traits or updating dependencies.\n\nFor detailed examples, see: vendor/drevops/behat-steps/STEPS.md\n```\n\n## Development\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to\nthis project.\n\n---\n_This repository was created using the [Scaffold](https://getscaffold.dev/)\nproject template_\n","funding_links":["https://github.com/sponsors/drevops","https://patreon.com/drevops"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrevops%2Fbehat-steps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrevops%2Fbehat-steps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrevops%2Fbehat-steps/lists"}