Log in as an account from the users registry, worldParameters.users in cucumber.js, so no password appears in a feature file. The handle is the registry key ("admin", "editor", "author", "contributor", "subscriber"). It opens the login screen, submits the form and fails with the screen's own message when WordPress refuses the credentials.
Examples
Given I am a logged in user with the "admin" user
Given we are a logged in user with username "editor"
Given I am a logged in user with "author"
And a logged in user with the username "admin"
Given I am a logged in user with the username "subscriber" user
Pattern
Given(/^(I am |we are )*a logged in user with( the)*( username)* "([^"]*)?"( user)*$/, …)
Part of @webship-js/wordpress-steps (github.com/webship/wordpress-steps), a step pack for Webship-js 2.0.x.