Download the PHP package bex/behat-screenshot without Composer
On this page you can find all versions of the php package bex/behat-screenshot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bex/behat-screenshot
More information about bex/behat-screenshot
Files in bex/behat-screenshot
Package behat-screenshot
Short Description Extension for behat to help debug failing scenarios
License MIT
Homepage https://github.com/elvetemedve/behat-screenshot
Informations about the package behat-screenshot
Behat-ScreenshotExtension
Behat-ScreenshotExtension helps you debug Behat scenarios by taking screenshot of the failing steps.
By default the extension takes the screenshot and save it to the preconfigured directory (by default it will save the image to the default temporary system directory).
Also the extension allows you to specify an image driver which can upload the image to a host, in this case you will see the image url in the terminal right after the failing step. See available image drivers below.
You can also create your own image driver easily, for more information see this section.
Installation
Install by adding to your composer.json
:
Configuration
Enable the extension in behat.yml
like this:
You can configure the screenshot directory like this:
If you are using another image driver you can enable it like this:
You can even enable more than one image driver at once:
You can make a combined screenshot including previous steps:
You can disable the extension by removing from the behat.yml or you can disable it for a profile by using the enabled
parameter, e.g.:
Usage
When you run behat and a step fails then the extension will automatically take the screenshot and you will see the filepath or the image URL of the screenshot (based on the configured image driver). So you will see something like this:
Available Image Drivers
- bex/behat-screenshot-image-driver-uploadpie
- bex/behat-screenshot-image-driver-img42
- bex/behat-screenshot-image-driver-unsee
How to create your own image driver
- Implement the
Bex\Behat\ScreenshotExtension\Driver\ImageDriverInterface
- Put your class under the
Bex\Behat\ScreenshotExtension\Driver
namespace
That's it!
See example here: https://github.com/tkotosz/behat-screenshot-image-driver-dummy
All versions of behat-screenshot with dependencies
behat/behat Version ^3.0.0
behat/mink-extension Version ^2.0.0
bex/behat-extension-driver-locator Version ^1.0|^2.0
symfony/filesystem Version ^2.7|^3.0|^4.0|^5.0
symfony/finder Version ^2.7|^3.0|^4.0|^5.0