Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am tagging the scenario with @api to use the drush driver and the first few steps work but adding the new users fails.
Looking at Drupal\DrupalExtension\Context\DrupalContext::createUsers()
it would appear to be an issue in the drush driver ....
So .. Questions:
- What's going wrong?
- How do I get more diagnostics from the drush driver?
[@Iains-MBP BABuild]$ bin/behat
@d8 @api
Feature: DrupalContext
In order to prove the Drupal context is working properly for Drupal 8
As a developer
I need to use the step definitions of this context
Scenario: Create and log in as a user # features/content/admin.feature:7
Given I am logged in as a user with the "authenticated user" role # Drupal\DrupalExtension\Context\DrupalContext::assertAuthenticatedByRole()
When I click "My account" # Drupal\DrupalExtension\Context\MinkContext::assertClick()
Then I should see the text "Member for" # Drupal\DrupalExtension\Context\MinkContext::assertTextVisible()
Scenario: Target links within table rows # features/content/admin.feature:12
Given I am logged in as a user with the "administrator" role # Drupal\DrupalExtension\Context\DrupalContext::assertAuthenticatedByRole()
When I am at "admin/structure/types" # Drupal\DrupalExtension\Context\MinkContext::assertAtPath()
And I click "Manage fields" in the "Article" row # Drupal\DrupalExtension\Context\DrupalContext::assertClickInTableRow()
Then I should be on "admin/structure/types/manage/article/fields" # Drupal\DrupalExtension\Context\MinkContext::assertPageAddress()
And I should see the link "Add field" # Drupal\DrupalExtension\Context\MinkContext::assertLinkVisible()
Scenario: Create users with roles # features/content/admin.feature:19
Given users: # Drupal\DrupalExtension\Context\DrupalContext::createUsers()
| name | mail | roles |
| Joe User | joe@example.com | Administrator |
| Jane Doe | jane@example.com | |
(RuntimeException)
And I am logged in as a user with the "administrator" role # Drupal\DrupalExtension\Context\DrupalContext::assertAuthenticatedByRole()
When I visit "admin/people" # Drupal\DrupalExtension\Context\MinkContext::assertAtPath()
Then I should see the text "Administrator" in the "Joe User" row # Drupal\DrupalExtension\Context\DrupalContext::assertTextInTableRow()
--- Failed scenarios:
features/content/admin.feature:19
3 scenarios (2 passed, 1 failed)
12 steps (8 passed, 1 failed, 3 skipped)
0m10.10s (16.64Mb)
Comments
Comment #2
iainH CreditAttribution: iainH as a volunteer commentedHere's my
behat.yml
:and my
features/bootstrap/FeatureContext.php
:and my
features/content/admin.feature
:Comment #3
iainH CreditAttribution: iainH as a volunteer commentedGiven users:
has a default step definition (rebin/behat -dl
) that should work per the vendor tests.Comment #4
gregglesIt's a bit late now, but I found this when searching for a similar issue, so here's some ideas:
1. Did you read #2144025: Driver "drush" is not registered? That is similar and has some advice.
2. Did you try adding a 'drupal_root' entry?
3. Did you try using an ' api_driver: 'drupal'' ?
This seems to me mostly like a support issue. The steps work as long as the environment is properly configured. Getting that configuration is not easy and documentation and error messages could definitely be improved to help make it easier to get configuration right.