Send the login form with a user name (or an address) and a password. The step does not expect the login to succeed: assert the outcome with the next step (the error message of the login page, who is logged in).
Examples
When I log in with the username "student" and the password "wrong-password"
When we log in with the username "nobody" and the password "Whatever-123!"
When I log in with the username "student@example.com" and the password "wrong-password"
And I log in with the username "" and the password "wrong-password"
When we log in with the username "no-such-account" and the password "Nothing-at-all-1!"
Pattern
When(/^(I |we )*log in with the username "([^"]*)" and the password "([^"]*)"$/, …)
Part of @webship-js/moodle-steps (github.com/webship/moodle-steps), a step pack for Webship-js 2.0.x.