In general, Behat recommends using the FeatureContext class. In addition, you can specify any other PHP classes in the features/bootstrap directory, and they are loaded, but in alphabetical order, no matter what dependencies exist.
Given that there is a property and a FeatureContext class:
features/bootstrap/FeatureContext.php features/bootstrap/MyLovelyTrait.php
What is the best way to load it properly? Obviously, MyLovelyTrait is used in FeatureContext:
class FeatureContext extends BehatContext { use MyLovelyTrait; }
And this does not succeed, because M > F , in the alphabet.
I use composer autoload with pleasure, but I donβt want the require_once autoload.php file at the top of the BehatContext.php file. Is there a way to specify this in the behat.yml configuration? In addition, any other answer regarding loading Behat context file classes will be appreciated.
source share