Because as soon as you start doing that you:
1. Can not refactor your contexts
2. Can not clearly see what the code actually does
3. Can not easily reword your features
And if you think that using inline steps is easier:
return array(
new Step\Given(‘I am on the homepage’),
new Step\When(‘I follow ”Login”’),
new Step\When(‘I fill ”Username” with “‘ . $username . '"’),
new Step\When(‘I fill ”Password” with “‘ . $password . '"’),
new Step\When(‘I click “Login"’),
);
It is not:
$session = $this->getSession();
$page = $session->getPage();
$session->visit($this->locateUrl(‘/‘));
$page->clickLink(‘Login’);
$page->fillField(‘Username’, $username);
$page->fillField(‘Password’, $password);
$page->pressButton(‘Login’);
Kind regards,