behat currently logged in user

Re: behat currently logged in user

от Tim Hunt -
Количество ответов: 0
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers

That seems like a poor example. But the if and the else have identical code inside, so there is no need for the if statement.

More generally, you should not do things like this. Instead

  1. There should be one scenario which tests registering a clicker through the UI.
  2. (Or possibly two scenarios if the UI really is different for students and admins.)
  3. Then, for use in other scenarios, you should define a step
    Given clicker "abc123" is assigned to "Student 1" which sets that up directly in the database.

There are two reasons for that: it is much faster, and you only want to test each bit of functionality once.