public function SocialMinkContext::iMakeAScreenshotWithFileName in Open Social 8.2
Same name and namespace in other branches
- 8 tests/behat/features/bootstrap/SocialMinkContext.php \SocialMinkContext::iMakeAScreenshotWithFileName()
@Given /^I make a screenshot with the name "([^"]*)"$/
2 calls to SocialMinkContext::iMakeAScreenshotWithFileName()
- SocialMinkContext::iMakeAScreenshot in tests/
behat/ features/ bootstrap/ SocialMinkContext.php - @Given /^I make a screenshot$/
- SocialMinkContext::takeScreenShotAfterFailedStep in tests/
behat/ features/ bootstrap/ SocialMinkContext.php - @AfterStep
File
- tests/
behat/ features/ bootstrap/ SocialMinkContext.php, line 70
Class
- SocialMinkContext
- Defines application features from the specific context.
Code
public function iMakeAScreenshotWithFileName($filename) {
$screenshot = $this
->getSession()
->getDriver()
->getScreenshot();
$dir = '/var/www/travis_artifacts';
if (is_writeable($dir)) {
$file_and_path = $dir . '/' . $filename . '.jpg';
file_put_contents($file_and_path, $screenshot);
}
}