From 565d1185abcfa61e96eda75c6ebd63b5a1e6837b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 3 Sep 2014 13:38:40 +0200 Subject: [PATCH] Validate the test even when it's in timeout --- app/lib/phantomasWrapper.js | 6 ++++++ phantomas_custom/core/scopeYLT/scopeYLT.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/lib/phantomasWrapper.js b/app/lib/phantomasWrapper.js index 44728f7..a9cdea5 100644 --- a/app/lib/phantomasWrapper.js +++ b/app/lib/phantomasWrapper.js @@ -81,6 +81,12 @@ var PhantomasWrapper = function() { err = 1001; } + // Don't cancel test if it is a timeout + if (err === 252) { + console.log('Timeout after ' + options.timeout + ' seconds. But it\'s not a problem, the test is valid.'); + err = null; + } + if (err) { console.log('Attempt failed for test id ' + task.testId + '. Error code ' + err); } diff --git a/phantomas_custom/core/scopeYLT/scopeYLT.js b/phantomas_custom/core/scopeYLT/scopeYLT.js index 7e3076a..633548f 100644 --- a/phantomas_custom/core/scopeYLT/scopeYLT.js +++ b/phantomas_custom/core/scopeYLT/scopeYLT.js @@ -56,7 +56,8 @@ exports.module = function(phantomas) { try { result = origFn.apply(this, arguments); } catch(e) { - phantomas.log('Error catched on spyed function "' + fn + '"": ' + e); + phantomas.log('Error catched on spyed function "' + fn + '": ' + e); + phantomas.log(arguments); } finally { // After