robertfausk/behat-screenshot-image-driver-url

Url image driver for bex/behat-screenshot behat extension

Maintainers

👁 robertfausk

Package info

github.com/robertfausk/behat-screenshot-image-driver-url

pkg:composer/robertfausk/behat-screenshot-image-driver-url

Statistics

Installs: 964

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2020-03-30 07:31 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 7d909045357f0d99dded40b0de844faeceb65ca4

imageBDDBehatTDDdriverscreenshotbehat-screenshot

This package is auto-updated.

Last update: 2026-06-14 05:21:19 UTC


README

👁 Latest Stable Version
👁 Latest Unstable Version
👁 Total Downloads
👁 License
👁 Build Status
👁 Scrutinizer Quality Score
👁 Code Coverage
👁 Software License
👁 PHP7 Compatible
👁 Open Issues
👁 Closed Issues
👁 Contributors
👁 Contributors

This package is an image driver for the bex/behat-screenshot behat extension which can upload the screenshot to local web server dir and print the url of the uploaded image. If you are in a docker like environment then this extension provide the url in log output.

Installation

Install by adding to your composer.json:

composer require --dev robertfausk/behat-screenshot-image-driver-url

Configuration

Enable the image driver in the Behat-ScreenshotExtension's config in behat.yml:

default:
 extensions:
 Bex\Behat\ScreenshotExtension:
 active_image_drivers: url

You have to choose where to upload files and the web address:

default:
 extensions:
 Bex\Behat\ScreenshotExtension:
 active_image_drivers: url
 image_drivers:
 url:
 screenshot_directory: /var/www/html/public/screenshots # your local web server dir where the image gets saved
 screenshot_url: https://acme/screenshots # used for creation of web url; could also be something like https://localhost:9000/screenshots
 # you can use something similar in your ci:
 # screenshot_url: https://acme.test.my-company.com/screenshots
 

Usage

When a step fails a screenshot will be taken and put into web server directory. URL of the uploaded image will be displayed in the Behat log. So you can open it directly from log output:

 Scenario: # features/feature.feature:2
 Given I have a step # FeatureContext::passingStep()
 When I have a failing step # FeatureContext::failingStep()
 Error (Exception)
Screenshot has been taken. Open image at /var/www/html/public/screenshots/IMAGE_LINK.png or https://acme/screenshots/IMAGE_LINK.png
 Then I should have a skipped step # FeatureContext::skippedStep()

👁 console output example of behat screenshot image driver url

How to upgrade?

Have a look at CHANGELOG for detailed information.