Open nathanboktae opened 9 years ago
How does someone add cookie per page, because in documentation I only see addCookie, and it adds it to phantom?
Phantomjs 1 didn't support this so mocha-phantomjs
didn't support it explicitly. However if you use a before hook, you could use the API to set the cookies as you wish.
--cookies-file
is currently broken - see ariya/phantomjs#13115page.cookieJar
, butpage.addCookie
still exists - does it just proxy to the other call?Before we had a test that was adding a cookie without a doman, loading the tests on the
file:
protocol, and it saw the cookie there. Now in phantomjs2, that cookie fails to add because it has no domain. Also, that test didn't make much sense in the real world. Cookies always are tied to a domain, butfile:
has always been special in the same origin policy, not really having a domain, so the test wasn't very accurate to begin with.In my manual tests, I wasn't able to add a cookie before loading a page with a domain at all.... :/
Help wanted with this one.