libreoffice-online/cypress_test/plugins/index.js
Henry Castro 6e230e4ba6 cypress: enable logging browser side
This time the logs come from the browser

Change-Id: If9b66a140b0174d0e3ef1e1e492ceeb49953d563
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94468
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-05-21 19:53:43 +02:00

23 lines
524 B
JavaScript

/* global require */
var process = require('process');
var tasks = require('./tasks');
function plugin(on, config) {
on('task', {
copyFile: tasks.copyFile,
failed: require('cypress-failed-log/src/failed')()
});
on('before:browser:launch', function(browser, launchOptions) {
if (browser.family === 'chromium' && process.env.ENABLE_LOGGING) {
launchOptions.args.push('--enable-logging=stderr');
launchOptions.args.push('--v=2');
return launchOptions;
}
});
return config;
}
module.exports = plugin;