2 * Ends the browser session and logs the console log if there were any errors.
6 * (optional) Settings object
8 * (optional) Only writes out the console log file if the test failed.
9 * @param {function} callback
10 * A callback which will be called.
12 * The 'browser' object.
14 exports.command = function drupalLogAndEnd({ onlyOnError = true }, callback) {
16 this.drupalLogConsole = true;
17 this.drupalLogConsoleOnlyOnError = onlyOnError;
19 // Nightwatch doesn't like it when no actions are added in a command file.
20 // https://github.com/nightwatchjs/nightwatch/issues/1792
23 if (typeof callback === 'function') {