xedi / laravel-behat
Laravel Extension for Behat
Installs: 1 549
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 3
Type:behat-extension
Requires
- php: >=5.4
- behat/behat: ^3.7.0
- friends-of-behat/mink: ^1.8.0
- friends-of-behat/mink-browserkit-driver: ^1.3.4
- friends-of-behat/mink-extension: ^2.4.0
- illuminate/console: ^7.0
- illuminate/container: ^7.0
- illuminate/support: ^7.0
- suin/phpcs-psr4-sniff: ^2.2
- symfony/browser-kit: ^4
- symfony/config: ^5.1.5
- symfony/dependency-injection: ^5.1
- symfony/event-dispatcher: ^5.1
- symfony/http-foundation: ^5.1
- symfony/http-kernel: ^5.1
Requires (Dev)
- squizlabs/php_codesniffer: 3.4.*
README
Behat Extension compatible with both Laravel and Lumen
Getting Started
Installation
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"); }
Setup
Next you need to configure behat.
php artisan make:behat-yaml
It 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 --init
If everything is working, it will create a "features" directory within your repository.
Running the tests
To run the test run behat as normal.
vendor/bin/behat
Alternatively, you can run individual files:
vendor/bin/behat -- features/Example.feature
You can also run specific Scenarios by specifying the line number it begins on:
vendor/bin/behat -- features/Example.feature:54
For more information, check out the help documentation using the --help
option