In JUnit
, I would have done this in an @Before
method but I don't see that in Mink. Does anyone know how to do this for all the tests instead of having to do $this->getSession()->maximize()
in every function? Thanks
You can use backgrounds or feature hooks. Both work similarly to the setUp method used in xUnit frameworks.
Backgrounds are more explicit:
Feature: your feature
Background:
Given the window is maximized
Scenario: Log in
Given I press the login button
Then I should see "logged in"
And with hooks, you can have a FeatureContext method executed. Maybe this is more appropiate:
/** @BeforeFeature */
public static function setupFeature(FeatureEvent $event)
{
}
Read more at the docs: