From 22f46aebde52b3ea20a0f7a557ad64bb3d6cb38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Fri, 25 Mar 2016 21:43:27 +0200 Subject: [PATCH] Quick fix for cookie regression in PhantomJS 2.1 --- extensions/cookies/cookies.js | 5 +++-- test/integration-spec.yaml | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/cookies/cookies.js b/extensions/cookies/cookies.js index 64ffa5687..d4fb2ea24 100644 --- a/extensions/cookies/cookies.js +++ b/extensions/cookies/cookies.js @@ -4,7 +4,7 @@ /* global phantom: true */ 'use strict'; -exports.version = '1.0'; +exports.version = '1.1'; exports.module = function(phantomas) { @@ -74,7 +74,8 @@ exports.module = function(phantomas) { } if (!phantom.addCookie(cookie)) { - throw 'PhantomJS could not add cookie: ' + JSON.stringify(cookie); + // In PhantomJS 2.1, the addCookie function always returns false (#597). + //throw 'PhantomJS could not add cookie: ' + JSON.stringify(cookie); } phantomas.log('Cookies: set ' + JSON.stringify(cookie)); diff --git a/test/integration-spec.yaml b/test/integration-spec.yaml index 6b10f78dc..180b14b0c 100644 --- a/test/integration-spec.yaml +++ b/test/integration-spec.yaml @@ -9,6 +9,8 @@ # DOM operations - url: "/dom-operations.html" + options: + cookie: "bar=foo;domain=url" metrics: requests: 3 cssCount: 1