elvetemedve/behat-screenshot

Get error after install "Imagemagick PHP extension is required"

Closed this issue · 7 comments

After requiring via composer then adding the extension using screenshot_taking_mode: failed_scenarios with the local image driver, I got the following error on the first run:

Invalid configuration for path "testwork.screenshot.screenshot_taking_mode": Imagemagick PHP extension is required,  
   but not installed. 

It doesn't seem this dependency was highlighted by Composer during install time... can the Imagemagick requirement be added to the composer.json requirements? https://github.com/elvetemedve/behat-screenshot/blob/master/composer.json#L23-L30

Hi,

We didn't add it as requirement since imagick only required when you choose a screenshot taking mode which requires to combine images. By default it is not required since it would only take screenshot about the failed step. So we decided to add it as a configuration error to highlight this requirement when it is really required.
I hope this clarifies it.

Note: so you can remove the sreenshot_taking_mode config or use the failed_steps mode without imagic.

@tkotosz You wanted to write not required with default setting. :)

I have fixed the comment already. :)

Ah, that makes sense then!

In my case, to get the failed_scenarios option working on Ubuntu (this was incredibly helpful, thanks so much!), I installed the following:

sudo apt-get install -y php5.6-imagick imagemagick

Thanks for this great extension, feel free to close the issue! (I'm going to try to get it added to Acquia's BLT, see acquia/blt#1152)

Nice! Have fun with the extension. And please let us know if you run into any further issue. :)

I solved this issue in my PHP 7.1 container via

sudo apt-get -yqq install libmagickwand-dev imagemagick
sudo pecl install imagick <<<'' # This <<<'' will fix the prompt.
sudo docker-php-ext-enable imagick