Last active
January 21, 2016 21:06
-
-
Save kporras07/c7e70927d855ea027771 to your computer and use it in GitHub Desktop.
Screenshot with behat selenium
This file contains 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
<?php | |
/** | |
* This works for Selenium and other real browsers that support screenshots. | |
* | |
* @Then /^show me an screenshot$/ | |
*/ | |
public function showMeAnScreenshot() { | |
$image_data = $this->getSession()->getDriver()->getScreenshot(); | |
$file_and_path = '/tmp/behat_screenshot.png'; | |
file_put_contents($file_and_path, $image_data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment