Features definitions and steps should be hosted in modules (they test) rather than in a single directory in root.
Each module should be able to declare that it holds some behat features and steps definitions, the same way it declares it holds simpletest tests.

For this, of course, behat needs to be integrated into drush.

Comments

al.ex’s picture

Hi Benoit,

I agree with you, it should be possible to associate features and step definitions with a module if the functionality they're testing confines to this module only.

However, keeping a "global" features directory imho does make a lot of sense too. That's the place to maintain site features, i.e. any sort of high-level functionality which usually integrates more than one module.

I don't understand why behat would need to integrate with drush though to make this happen. Could you explain that?

Cheers,
-Alex

benoit.pointet’s picture

I agree, a "global" features directory makes definitely sense. However per module step definition make definitely sense.

Don't remember why I thought drush integration was important. Drop this.

mile23’s picture

I'd go a step further and say that global-scope tests should live outside the root drupal directory.

Most every Drupal site I set up these days has an 'umbrella' directory above Drupal, with lots of non-Drupal stuff in it. Behat tests should live there, for a few different reasons:

1) Feature files are supposed to have information about your processes in them. That kind of documentation doesn't belong under the docroot.

2) Composer will end up making a vendor directory, etc.

3) See #1.