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

Log in through the Django admin login form as a user from the users registry in cucumber.js worldParameters ({ <key>: { username, password } }, with the password read from an environment variable so no credential has to live in a feature file).

The CMS toolbar is only injected on pages served through the CMS, not on the raw Django admin index, so the login redirects back to the front end ("/"). A default django CMS project (as scaffolded by the python -m cms installer) serves a single, unprefixed language, so URLs here are bare: no "/en/" (or other language code) segment.

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 "admin"
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/django-cms-steps (github.com/webship/django-cms-steps), a step pack for Webship-js 2.0.x.