2 * Logs into Drupal as the given user.
6 * @param {string} password
9 * The drupalUserIsLoggedIn command.
11 exports.command = function drupalLogin({ name, password }) {
12 this.drupalUserIsLoggedIn(sessionExists => {
13 // Log the current user out if necessary.
17 // Log in with the given credentials.
18 this.drupalRelativeURL('/user/login')
19 .setValue('input[name="name"]', name)
20 .setValue('input[name="pass"]', password)
21 .submitForm('#user-login-form');
22 // Assert that a user is logged in.
23 this.drupalUserIsLoggedIn(sessionExists => {
27 `The user "${name}" was logged in.`,