ezsystems/behat-screenshot-image-driver-cloudinary
bex/behat-screenshot, enabling Cloudinary uploads for failed test screenshots. It fits seamlessly into a PHP/Laravel-based BDD (Behavior-Driven Development) workflow, particularly for teams using Behat for automated testing./tmp/) may not be reliable or sufficient for long-term debugging.bex/behat-screenshot (v3.0+ recommended) and cloudinary/php-cloudinary-sdk (v1.15+).bex/behat-screenshot-image-driver-local)./tmp/ cleanup).DISABLE_BEHAT_SCREENSHOT_LIMIT or implement custom cleanup hooks in Behat’s AfterScenario.laravel-behat or custom BehatTestCase).AppServiceProvider for centralized config.php artisan behat --tags=@screenshot).bex/behat-screenshot (if not already present):
composer require --dev bex/behat-screenshot
composer require --dev ezsystems/behat-screenshot-image-driver-cloudinary
behat.yml with Cloudinary settings (signed/unsigned).config/behat.php:
'extensions' => [
'Bex\Behat\ScreenshotExtension' => [
'active_image_drivers' => ['cloudinary'],
'image_drivers' => [
'cloudinary' => [
'cloud_name' => env('CLOUDINARY_CLOUD_NAME'),
'preset' => env('CLOUDINARY_UPLOAD_PRESET'), // Unsigned
// OR for signed:
'api_key' => env('CLOUDINARY_API_KEY'),
'api_secret' => env('CLOUDINARY_API_SECRET'),
],
],
],
],
.env:
CLOUDINARY_CLOUD_NAME=your_cloud
CLOUDINARY_API_KEY=your_key
CLOUDINARY_API_SECRET=your_secret
# OR for unsigned:
CLOUDINARY_UPLOAD_PRESET=your_preset
/tmp/behat-screenshot/ is cleaned between runs (or disable limits).- name: Run Behat
run: |
mkdir -p /tmp/behat-screenshot/
php vendor/bin/behat --config=behat.yml
cloudinary/php-cloudinary-sdk (v1.15+). Check for breaking changes in newer SDKs.Storage facade to sync screenshots to Cloudinary post-test (alternative approach).@ui tagged tests).tags or context_data.cloudinary/php-cloudinary-sdk) quarterly.cloudinary/php-cloudinary-sdk direct integration if needed./tmp/behat-screenshot/ is writable.CLOUDINARY_* env vars or preset permissions.active_image_drivers includes cloudinary.--verbose) to log upload attempts.cloudinary/php-cloudinary-sdk’s debug mode for API issues.How can I help you explore Laravel packages today?