Log in as an account of the users registry (worldParameters.users in cucumber.js), by its handle. An account that logged in earlier in the run takes its session over; otherwise the step logs in through the login form. The browser ends on the page the site shows after a login (the Dashboard).
Examples
Given I am a logged in user with the "student" user
Given we are a logged in user with the "teacher" user
Given I am a logged in user with "administrator"
And I am a logged in user with the "manager" user
Given we are a logged in user with the "student2" user
Pattern
Given(/^(I am |we are )*a logged in user with( the)* "([^"]*)"( user)*$/, …)
Part of @webship-js/moodle-steps (github.com/webship/moodle-steps), a step pack for Webship-js 2.0.x.