mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 15:05:32 +00:00
BEHAT_SCREEN_SIZE env var
This commit is contained in:
parent
7f3cc3b6b9
commit
d003707894
@ -280,6 +280,15 @@ Example: mymodule/tests/behat/features/bootstrap/MyModule/Test/Behaviour/Feature
|
||||
}
|
||||
}
|
||||
|
||||
### Screen Size
|
||||
|
||||
In some Selenium drivers like [SauceLabs](http://www.saucelabs.com) you can
|
||||
define the desired browser window size through a `capabilities` definition.
|
||||
By default, Selenium doesn't support this though, so we've added a workaround
|
||||
through an environment variable:
|
||||
|
||||
BEHAT_SCREEN_SIZE=320x600 vendor/bin/behat
|
||||
|
||||
## FAQ
|
||||
|
||||
### FeatureContext not found
|
||||
|
@ -131,6 +131,11 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
|
||||
}
|
||||
|
||||
$this->testSessionEnvironment->startTestSession($this->getTestSessionState());
|
||||
|
||||
if($screenSize = getenv('BEHAT_SCREEN_SIZE')) {
|
||||
list($screenWidth, $screenHeight) = explode('x', $screenSize);
|
||||
$this->getSession()->resizeWindow((int)$screenWidth, (int)$screenHeight);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user