Relaunch run on webkit1 if webkit2 fails

This commit is contained in:
Gaël Métais
2015-10-28 22:55:52 +01:00
parent 6f7f05b456
commit c54cf5a2ba
+9
View File
@@ -112,8 +112,17 @@ var PhantomasWrapper = function() {
// It's time to launch the test!!!
var triesNumber = 2;
var currentTry = 0;
async.retry(triesNumber, function(cb) {
currentTry ++;
// Fix for https://github.com/gmetais/YellowLabTools/issues/114
if (currentTry === 2 && options.engine === 'webkit2') {
debug('Launching a second try with the old webkit v1 engine');
options.engine = 'webkit';
}
var process = phantomas(task.url, options, function(err, json, results) {
var errorCode = err ? parseInt(err.message, 10) : null;