drupalextension icon indicating copy to clipboard operation
drupalextension copied to clipboard

Error message is a little less useful

Open eliza411 opened this issue 11 years ago • 2 comments

In Version 1, running an untagged @api step like this:

Given I am logged in as a user with the "authenticated user" role

Produced the message:

  No ability to create users in Drupal\Driver\BlackboxDriver. 
  Put `@api` into your feature and add an api driver 
  (ex: `api_driver: drupal`) in behat.yml.

In Version 3 the output says:

No ability to generate random in Drupal\Driver\BlackboxDriver.
Put `@api` into your feature and add an api driver
(ex: `api_driver: drupal`) in behat.yml. (Drupal\Driver\Exception\UnsupportedDriverActionException)

The former seems slightly more meaningful even if the latter is more exact. I'm find just closing this as "wontfix" if you prefer but wanted to make sure it was on purpose before I update the docs accordingly.

eliza411 avatar Dec 05 '14 21:12 eliza411

This wasn't intentional, the former is much more useful!

jhedstrom avatar Dec 05 '14 21:12 jhedstrom

I think the fix here will be for steps using the random generator to wrap that in a try/catch and throw their own more meaningful exception if the random generator isn't available... There might be a more efficient way to achieve this as well...

jhedstrom avatar Dec 05 '17 18:12 jhedstrom