detro/ghostdriver — pull request #46 by erdi (2012-09-05 20:34:32+00:00)
Title: Partially implemented cookie commands

This pull request contains a slightly incomplete implementation of all cookie related commands of webdriver protocol. The main feature missing is handling of cookie expiry dates - this is due to the fact that phantomjs currently stores them as strings making it almost impossible (ok, more of a PITA actually) to parse/encode them with pure js and I didn't want to pull a lib just for that cause I believe that this should be made easier in phantomjs. Probably writing some more tests around cookie path, secure and domain properties would be feasible as well.

This pull request contains a test class that uses all of the cookie related commands of webdriver. It also contains a mechanism (copied from Geb's internal test suite) for setting up a callback in-memory server that serves test pages. It seemed to be the only way to go to get proper coverage for cookie related stuff. It will also allow to modify tests that currently depend on external services like google, yahoo, bing etc. to use a local server to make them more future-proof. Have a look at CookiesTest and classes in the new ghostdriver.server package to learn how to use it.

Please let me know if there is something that I should improve to get that pull request accepted.