Various adaptations for Phantomas v2

This commit is contained in:
Gaël Métais
2020-08-11 03:01:43 +02:00
parent bafea756ee
commit e19a521c4e
4 changed files with 60 additions and 47 deletions
+2 -23
View File
@@ -65,32 +65,11 @@ var PhantomasWrapper = function() {
options.proxy = task.options.proxy;
}
// Output the command line for debugging purpose
debug('If you want to reproduce the phantomas task only, copy the following command line:');
var optionsString = '';
for (var opt in options) {
var value = options[opt];
if ((typeof value === 'string' || value instanceof String) && value.indexOf(' ') >= 0) {
value = '"' + value + '"';
}
if (value === true) {
optionsString += ' ' + '--' + opt;
} else if (value === false || value === null || value === undefined) {
// Nothing
} else {
optionsString += ' ' + '--' + opt + '=' + value;
}
}
debug('node node_modules/phantomas/bin/phantomas.js --url=' + task.url + optionsString + ' --verbose');
// It's time to launch the test!!!
const promise = phantomas(task.url, {
'analyze-css': true
'analyze-css': true,
'screenshot': true
});
// handle the promise