1 import { execSync } from 'child_process';
2 import { URL } from 'url';
5 * Logs out from a Drupal site.
7 * @param {object} [settings={}]
9 * @param {boolean} [settings.silent=false]
10 * If the command should be run silently.
11 * @param {function} callback
12 * A callback which will be called, when the logout is finished.
14 * The drupalLogout command.
16 exports.command = function drupalLogout({ silent = false } = {}, callback) {
19 this.drupalRelativeURL('/user/logout');
21 this.drupalUserIsLoggedIn(sessionExists => {
24 throw new Error('Logging out failed.');
27 this.assert.equal(sessionExists, false, 'The user was logged out.');
31 if (typeof callback === 'function') {