valthebald / behat-screenshot-image-driver-rsync
Image driver for bex/behat-screenshot extension that uploads files to remote server using rsync
Installs: 2 359
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
- bex/behat-screenshot: ^1.0
Requires (Dev)
- behat/mink-selenium2-driver: ^1.3.0
- bex/behat-test-runner: ^1.1
- phpspec/phpspec: 2.4.0-alpha2
This package is auto-updated.
Last update: 2025-03-19 11:11:23 UTC
README
This package is an image driver for the bex/behat-screenshot behat extension which uploads screenshots to remote server using rsync protocol.
Installation
Install by adding to your composer.json
:
composer require --dev valthebald/behat-screenshot-image-driver-rsync
Configuration
Enable the image driver in the Behat-ScreenshotExtension's config in behat.yml
like this:
default: extensions: Bex\Behat\ScreenshotExtension: active_image_drivers: rsync
Required parameters:
default: extensions: Bex\Behat\ScreenshotExtension: active_image_drivers: rsync image_drivers: rsync: server: remote.example.com username: username path: /full/path/to/screenshots/folder # No trailing slash here!
Optional parameters:
image_drivers: rsync: ssh_options: "ssh -i private_file.pem -p 2222" # This parameter will be passed as -e to rsync command preview_url: "https://remote.example.com/scheenshots/folder" # If screenshots folder is accessible via HTTP/S
Usage
When you run behat and a step fails then the Behat-ScreenshotExtension will automatically take the screenshot and will pass it to the image driver, which will upload it and returns the URL of the uploaded image. So you will see something like this:
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 https://remote.example.com/scheenshots/folder/feature88_step2.png Then I should have a skipped step # FeatureContext::skippedStep()