I'm currently a little stuck with behat + responsive features that appear / disappear at given break-points on the screen.
The first thing would be to create tags to filter features for devices. Like @iphone or @mobile and so on.
This gets really messy if you are testing on multiple devices with multiple-screen-sizes / orientations. We then would end up with: @iphone5c_hor @iphone5c_vert @iphone5s_hor @iphone5s_vert @samsung..._vert
My second attempt was to tag features with a min-width tag e.g. min-width:700 and to use the feature-context and the webdriver to determine if the current browser I'm on supports the feature I'm trying to execute. This works up until this point:
/**
* @BeforeFeature
*
* @param \Behat\Behat\Hook\Scope\BeforeFeatureScope|BeforeScenarioScope $scope
*/
public function prepareForTheScenario(BeforeScenarioScope $scope)
{
if (!$this->checkWindowWidth($scope)) {
// TODO: skip scenario here
}
}
Has anybody had any experience with these kind of dynamic tests, am I going down a completely wrong way, and If not how can I make that work?