Many pages need user data e.g.login or register.
It should be possible to specify users in the behat.yml and use this saved data to fill forms or write custom steps:
default:
QATools\BehatExtension:
users:
registered:
firstname: michael
lastname: geppert
public function fillLoginForm()
{
$user = $this->getUser('registered');
$this->loginForm->fill($user->getData());
}
public function enterFirstname()
{
$user = $this->getUser('registered');
$this->firstname->setValue($user->get('firstname'));
}
Normally only one user is active at time. Therefore extend the whole feature with an active user and specific steps to load him.
For example:
Scenario: A basic registration of an user
Given "valid" as user
Many pages need user data e.g.login or register.
It should be possible to specify users in the
behat.ymland use this saved data to fill forms or write custom steps:Normally only one user is active at time. Therefore extend the whole feature with an active user and specific steps to load him.
For example: