moved default session configuration and active sessions teardown into initializer
This commit is contained in:
@@ -23,31 +23,6 @@ use Behat\Behat\Context\TranslatedContextInterface,
|
||||
*/
|
||||
class MinkContext extends RawMinkContext implements TranslatedContextInterface
|
||||
{
|
||||
/**
|
||||
* @BeforeScenario
|
||||
*/
|
||||
public function prepareMinkSessions($event)
|
||||
{
|
||||
$scenario = $event instanceof ScenarioEvent ? $event->getScenario() : $event->getOutline();
|
||||
$session = $this->getMinkParameter('default_session');
|
||||
|
||||
foreach ($scenario->getTags() as $tag) {
|
||||
if ('javascript' === $tag) {
|
||||
$session = $this->getMinkParameter('javascript_session');
|
||||
} elseif (preg_match('/^mink\:(.+)/', $tag, $matches)) {
|
||||
$session = $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
if ($scenario->hasTag('insulated')) {
|
||||
$this->getMink()->stopSessions();
|
||||
} else {
|
||||
$this->getMink()->resetSessions();
|
||||
}
|
||||
|
||||
$this->getMink()->setDefaultSessionName($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens specified page.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user