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

Log in to the administrator panel as an account of the users registry in cucumber.js worldParameters ({ <handle>: { username, password } }, with the password read from an environment variable so no credential lives in a feature file). Opens /administrator first, so no earlier "on the administrator login page" step is needed. The account must be allowed to log in to the administrator (Manager, Administrator or Super Users group); the accounts are created once with the Joomla CLI (php cli/joomla.php user:add), a feature never creates users.

Examples

Given I am a logged in user with the "admin" user
Given we are a logged in user with the username "admin"
Given I am a logged in user with "manager"
And a logged in user with username "admin"
Given I am a logged in user with the username "admin" user

Pattern

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

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