In #watir channel we had a short discussion about a possible unified API
between all current Watir implementations. We came up with an API like this:

browser.cookies # returns Cookies object which includes Enumerable
browser.clear # removes all cookies
browser << new_cookie # adds cookie
browser.delete new_cookie

#<< should take a Cookie object as an argument if i understood correctly
with #delete cookies are deleted only by "name" when talking about
Watir-WebDriver, but maybe it's/will be different with other implementations
so #delete should also take a Cookie object as an argument. Or maybe just
"name".

Jari liked more the API where "name" is the argument due to the limitations
of WebDriver, but this would mean that if user has a Cookie object already
then he/she had to execute #name explicitly. I wouldn't make that as a
requirement.

I also noticed that currently Watir doesn't have anything related with
cookies except CookieManager, which seems not to be best. And nothing for
FireWatir. That means that the API for cookies is an open subject and free
to change, i guess.

What are other's thoughts about the matter?

Jarmo
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to