Posted by mlncn on March 26, 2018 at 4:17am
Here's what i'd like to do:
- Include one or more .feature Behat tests in a contributed module
- Have automated tests run with just this module and its dependencies installed
- Optionally include these .feature Behat tests from the module when it is included in my site or installation profile automated tests, this time running with the full site installed
There was a good discussion about contributing behat tests to drupal.org that covered these questions, but the Drupal 8 answer to Behat Runner hasn't seen development since then.
Thoughts for behavior driven development and Drupal 8 in 2018, in particular in the context of separating some tests into modules or Feature modules?

Comments
Documentation how to add behat subcontexts in contrib modules
Have a look at https://behat-drupal-extension.readthedocs.io/en/v4.0.1/subcontexts.html
Or an example at https://www.drupal.org/project/honeypot/issues/3059040