Mercurial > hg > isophonics-drupal-site
view core/tests/Drupal/Nightwatch/Commands/drupalLogAndEnd.js @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | |
children |
line wrap: on
line source
/** * Ends the browser session and logs the console log if there were any errors. * See globals.js. * * @param {Object} * (optional) Settings object * @param onlyOnError * (optional) Only writes out the console log file if the test failed. * @param {function} callback * A callback which will be called. * @return {object} * The 'browser' object. */ exports.command = function drupalLogAndEnd({ onlyOnError = true }, callback) { const self = this; this.drupalLogConsole = true; this.drupalLogConsoleOnlyOnError = onlyOnError; // Nightwatch doesn't like it when no actions are added in a command file. // https://github.com/nightwatchjs/nightwatch/issues/1792 this.pause(1); if (typeof callback === 'function') { callback.call(self); } return this; };