From 443fb8aca09c888a0d119f46903b29105d220dd6 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Tue, 9 Dec 2014 10:22:28 +0000 Subject: [PATCH] Workaround for phantomjs 1.9.8 bug, MKWS-343 This will avoid the error message: Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://phantom/run-jasmine.js. Domains, protocols and ports must match. after the tests runs. --- test/phantom/run-jasmine.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/phantom/run-jasmine.js b/test/phantom/run-jasmine.js index ef0577a..e9bf784 100644 --- a/test/phantom/run-jasmine.js +++ b/test/phantom/run-jasmine.js @@ -46,7 +46,11 @@ function wait_for_jasmine(checkFx, readyFx, failFx, timeout) { clearInterval(interval); result.time = (new Date().getTime() - start); result.failed ? failFx(result) : readyFx(result); - phantom.exit(result.failed == 0 ? 0 : 2); + + // See: https://github.com/ariya/phantomjs/issues/12697 + // phantomjs 1.9.8 + page.close(); + setTimeout(function(){ phantom.exit(result.failed == 0 ? 0 : 2); }, 0); } // timeout -- 1.7.10.4