diff --git a/test/webpage-spec.js b/test/webpage-spec.js index 1a1252d9..6a30e996 100644 --- a/test/webpage-spec.js +++ b/test/webpage-spec.js @@ -1395,15 +1395,25 @@ describe("WebPage object", function() { }); }); - it("should interrupt a long-running JavaScript code", function() { + xit("should interrupt a long-running JavaScript code", function() { var page = new WebPage(); + var longRunningScriptCalled = false; + var loadStatus; page.onLongRunningScript = function() { page.stopJavaScript(); + longRunningScriptCalled = true; }; + page.onError = function () {}; - page.open('../test/webpage-spec-frames/forever.html', function(status) { - expect(status).toEqual('success'); + runs(function() { + page.open('../test/webpage-spec-frames/forever.html', + function(status) { loadStatus = status; }); + }); + waits(5000); + runs(function() { + expect(loadStatus).toEqual('success'); + expect(longRunningScriptCalled).toBeTruthy(); }); }); }); @@ -2168,7 +2178,7 @@ xdescribe("WebPage render image", function(){ content = fs.read(TEST_FILE, "b"); fs.remove(TEST_FILE); - } catch (e) { console.log(e) } + } catch (e) { jasmine.fail(e) } // for PDF test if (format === "pdf") { diff --git a/test/webserver-spec.js b/test/webserver-spec.js index ea8ea60d..c7cf4aab 100644 --- a/test/webserver-spec.js +++ b/test/webserver-spec.js @@ -31,9 +31,9 @@ function checkRequest(request, response) { if (expectedPostData !== false) { expect(request.method).toEqual("POST"); expect(request.hasOwnProperty('post')).toBeTruthy(); - console.log("request.post => " + JSON.stringify(request.post, null, 4)); - console.log("expectedPostData => " + JSON.stringify(expectedPostData, null, 4)); - console.log("request.headers => " + JSON.stringify(request.headers, null, 4)); + jasmine.log("request.post => " + JSON.stringify(request.post, null, 4)); + jasmine.log("expectedPostData => " + JSON.stringify(expectedPostData, null, 4)); + jasmine.log("request.headers => " + JSON.stringify(request.headers, null, 4)); if (request.headers["Content-Type"] && request.headers["Content-Type"] === "application/x-www-form-urlencoded") { expect(typeof request.post).toEqual('object'); expect(request.post).toEqual(expectedPostData);