Given I am a logged in user with the "member" user

Log in with an account of the users registry in cucumber.js (worldParameters.users), by its handle, and make sure the session is that account's. An account that is already logged in is kept. The first time in a run the account goes through the login form; after that its session is put back, so switching accounts inside a scenario is quick.

Examples

Given I am a logged in user with the "member" user
Given I am a logged in user with the "owner" user
Given we are a logged in user with the "reader" user
And I am a logged in user with the "stranger" user
When I am a logged in user with the "member" user

Pattern

Given(/^(I am|we are) a logged in user with the "([^"]*)" user$/, …)

Part of @webship-js/redmine-steps (github.com/webship/redmine-steps), a step pack for Webship-js 2.0.x.