I am doing some tests with zombie.js
and phantom.js
, I would like to display my active session name before each test. Which method can I use?
With behat 3.0 and mink 1.6.
You can use hooks. BeforeSuite, AfterSuite, BeforeFeature, AfterFeature, BeforeScenario, AfterScenario, BeforeStep, AfterStep
Example
/**
* @BeforeSuite
*/
public static function prepare(SuiteEvent $event)
{
// prepare system for test suite
// before it runs
}
/**
* @AfterScenario @database
*/
public function cleanDB(ScenarioEvent $event)
{
// clean database after scenarios,
// tagged with @database
}
If your class extends MinkContext
then you can dump your session with: $this->getSession()
.
If your class extends BehatContext
then you can dump your session with: $this->getMainContext()->getSession()