src/Bex/Behat/ScreenshotExtension/Listener/ScreenshotListener.php
public function saveScreenshot(AfterScenarioTested $event)
    {
        if ($this->shouldSaveScreenshot($event)) {
            $fileName = $this->filenameGenerator->generateFileName($event->getFeature(), $event->getScenario());
            $image = $this->screenshotTaker->getImage();
            $this->screenshotUploader->upload($image, $fileName);
        }

        $this->screenshotTaker->reset();
    }
public function saveScreenshot(AfterScenarioTested $event)
    {
        if ($this->shouldSaveScreenshot($event)) {
            $fileName = $this->filenameGenerator->generateFileName($event->getFeature(), $event->getScenario());
            $image = $this->screenshotTaker->getImage();
            $this->screenshotUploader->upload($image, $fileName);
        }

        $this->screenshotTaker->reset();
    }
public function saveScreenshot ( AfterScenarioTested $ event ) { if ( $ this -> shouldSaveScreenshot ( $ event ) ) { $ fileName = $ this -> filenameGenerator -> generateFileName ( $ event -> getFeature ( ) , $ event -> getScenario ( ) ) ; $ image = $ this -> screenshotTaker -> getImage ( ) ; $ this -> screenshotUploader -> upload ( $ image , $ fileName ) ; } $ this -> screenshotTaker -> reset ( ) ; }
Save screenshot after scanerio if required

@param  AfterScenarioTested $event
Save screenshot after scanerio if required