From c54cf5a2bad7b9330c6fef28e8f4741fb7099fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 28 Oct 2015 22:55:52 +0100 Subject: [PATCH] Relaunch run on webkit1 if webkit2 fails --- lib/tools/phantomas/phantomasWrapper.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/tools/phantomas/phantomasWrapper.js b/lib/tools/phantomas/phantomasWrapper.js index b83ca33..e739a90 100644 --- a/lib/tools/phantomas/phantomasWrapper.js +++ b/lib/tools/phantomas/phantomasWrapper.js @@ -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;