Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG fix screenshot path

  • Loading branch information...
commit fe6e6c9fd4f1d9bfbebcb8271108a9b27f7a53a1 1 parent 018df38
@michalochman authored
4 features/bootstrap/SilverStripe/Test/Behaviour/BasicContext.php
@@ -162,9 +162,7 @@ public function takeScreenshotAfterFailedStep(StepEvent $event)
$feature = $parent->getFeature();
$step = $event->getStep();
- // TODO:
- // - line below assumes that /tmp exists and is writable - most likely need to change the path
- $screenshot_path = sprintf('/tmp/%s_%d.png', basename($feature->getFile()), $step->getLine());
+ $screenshot_path = realpath(sprintf('%s/%s_%d.png', sys_get_temp_dir(), basename($feature->getFile()), $step->getLine()));
$screenshot = $driver->wdSession->screenshot();
file_put_contents($screenshot_path, base64_decode($screenshot));
file_put_contents('php://stderr', sprintf('Saving screenshot into %s' . PHP_EOL, $screenshot_path));
Please sign in to comment.
Something went wrong with that request. Please try again.