Created
March 3, 2016 16:51
-
-
Save balsama/bc6bc9df4c9cbffa703a to your computer and use it in GitHub Desktop.
Handy step definitions
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
/** | |
* Resizes the window to 1440x900 | |
* | |
* @When I make the window big | |
*/ | |
public function makeTheWindowBig() { | |
$this->getSession()->resizeWindow(1440, 900, 'current'); | |
} | |
/** | |
* Takes a screenshot | |
* | |
* @param sting $filename | |
* The name of the screenshot file | |
* | |
* @When I take a screenshot named :filename | |
*/ | |
public function takeScreenshotAfterFailedStep($filename) { | |
$screenshot = $this->getSession()->getDriver()->getScreenshot(); | |
$filepath = sys_get_temp_dir() . DIRECTORY_SEPARATOR; | |
file_put_contents($_SERVER['HOME'] . '/' . $filename . '.png', $screenshot); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment