Last active
April 18, 2018 18:42
-
-
Save megclaypool/42dc283beccc8085a15f6e9c106d74f1 to your computer and use it in GitHub Desktop.
This Behat definition resizes the browser. I've discovered that Chrome defaults to a fairly wide browser whereas PhantomJS defaults to a very narrow browser... Either way, it's important to be able to resize the browser window so you can get specific versions of your sites/menus *on purpose* rather than by accident!
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
// Include the following step definition in your FeatureContext.php file: | |
/** | |
* @Given /^I set browser window size to "([^"]*)" x "([^"]*)"$/ | |
*/ | |
public function iSetBrowserWindowSizeToX($width, $height) | |
{ | |
$this->getSession()->resizeWindow((int)$width, (int)$height, 'current'); | |
} |
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
# Include the following step in your .feature file, editing the sizes as appropriate: | |
Given I set browser window size to "1024" x "768" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment