Created
April 23, 2013 12:08
-
-
Save Spoygg/5443042 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @AfterStep */ | |
public function showContentAfterFailure(StepEvent $event) | |
{ | |
try { | |
if ($event->hasException()) { | |
$this->saveScreenshot( | |
sprintf( | |
'screenshot-%s-%s.png', | |
date('Y-m-d_h-i-s', time()), | |
str_replace(' ', '_', $event->getLogicalParent()->getTitle()) | |
), | |
'/source' | |
); | |
} | |
} catch (UnsupportedDriverActionException $exception) { | |
// Screenshot will not be saved for contexts that do not | |
// support screenshots. | |
// $this->printLastResponse(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment