Behat Extension compatible with both Laravel and Lumen
Pull in the extension using composer
composer require xedi/laravel-behat --devℹ️ If you are using Lumen you will need to register the ServiceProvider yourself for access to the Artisan commands.
// bootstrap/app.php
if (class_exists("Xedi\\Behat\\ServiceProvider")) {
$app->register("Xedi\\Behat\\ServiceProvider");
}Next you need to configure behat.
php artisan make:behat-yamlIt is recommended that you use a .env.behat environment file and set the LOG_DRIVER to single.
Then, you need to initialize a behat within your repository.
vendor/bin/behat --initIf everything is working, it will create a "features" directory within your repository.
To run the test run behat as normal.
vendor/bin/behatAlternatively, you can run individual files:
vendor/bin/behat -- features/Example.featureYou can also run specific Scenarios by specifying the line number it begins on:
vendor/bin/behat -- features/Example.feature:54For more information, check out the help documentation using the --help option