diff --git a/docker/php.docker b/docker/php.docker index 370c4e7..ac22cc0 100644 --- a/docker/php.docker +++ b/docker/php.docker @@ -9,7 +9,7 @@ RUN docker-php-ext-configure zip --with-libzip=/usr/include \ && docker-php-ext-install zip # composer -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ - && /usr/local/bin/composer global require hirak/prestissimo \ +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=1.0.0 --filename=composer \ + && /usr/local/bin/composer global require hirak/prestissimo "0.3.10" \ && rm -rf /root/.composer/cache/* diff --git a/module/VisualCeption.php b/module/VisualCeption.php index 3a75d94..5874b91 100755 --- a/module/VisualCeption.php +++ b/module/VisualCeption.php @@ -386,6 +386,8 @@ private function createScreenshot($identifier, array $coords, array $excludeElem $elementPath = $this->getScreenshotPath($identifier); $screenShotImage = new \Imagick(); + $this->hideElementsForScreenshot($excludeElements); + if ($this->config["fullScreenShot"] == true) { $height = $this->webDriver->executeScript("var ele=document.querySelector('html'); return ele.scrollHeight;"); list($viewportHeight, $devicePixelRatio) = $this->webDriver->executeScript("return [window.innerHeight, window.devicePixelRatio]"); @@ -408,15 +410,15 @@ private function createScreenshot($identifier, array $coords, array $excludeElem $fullShot->writeImage($elementPath); } else { - $this->hideElementsForScreenshot($excludeElements); $screenshotBinary = $this->webDriver->takeScreenshot(); - $this->resetHideElementsForScreenshot($excludeElements); $screenShotImage->readimageblob($screenshotBinary); $screenShotImage->cropImage($coords['width'], $coords['height'], $coords['offset_x'], $coords['offset_y']); $screenShotImage->writeImage($elementPath); } + $this->resetHideElementsForScreenshot($excludeElements); + return $elementPath; } diff --git a/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChanges.block2.png b/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChanges.block2.png index ab2a450..298ff34 100644 Binary files a/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChanges.block2.png and b/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChanges.block2.png differ diff --git a/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChangesAndHideElement.hideTheBlock.png b/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChangesAndHideElement.hideTheBlock.png index 008d94e..3f2bc1d 100644 Binary files a/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChangesAndHideElement.hideTheBlock.png and b/test/integration/tests/_data/VisualCeption/TimeComparisonCest.dontSeeVisualChangesAndHideElement.hideTheBlock.png differ