Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cookie.rb to handle situations when expires is a DateTime object #52

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

luke-hill
Copy link
Contributor

@luke-hill luke-hill commented Dec 2, 2024

As mentioned in the commit detailed message

The standard Selenium WebDriver response is to return an object which has an expiry in datetime format.
In order to most effectively work with Selenium, and to provide the smallest barrier possible, co-erce the DateTime object into a Time object and then store it as a HTTP Cookie

The reason for this change is that I have started working with cookies now and need a way of quickly storing them as they have nice uses for other tests and then call them back. I found this library didn't work well with the standard cookies obtained using the W3C conformant endpoints

  • See HERE for more info on working with cookies with the Selenium level API
  • See HERE for w3c spec for cookies specifically #get_cookie

The standard Selenium WebDriver response is to return an object which has an expiry in datetime format.

In order to most effectively work with Selenium, and to provide the smallest barrier possible, co-erce the DateTime object into a Time object and then store it as a HTTP Cookie
@flavorjones
Copy link
Member

@luke-hill Thank you for opening this pull request!

I added a commit that expands the expires= tests to include a DateTime argument. In general, we like to have tests for any bugfixes or new features to prevent breaking the functionality in the future.

@flavorjones flavorjones merged commit e4e66bd into sparklemotion:master Dec 5, 2024
6 of 7 checks passed
@luke-hill
Copy link
Contributor Author

Sorry thankyou @flavorjones - I'll be honest as you can tell this was done using inline GH so I wasn't sure if this would be accepted or not. For the other ones I'll fork and make a proper PR for each.

This I imagine would need releasing as/when you do a 1.1

@luke-hill luke-hill deleted the patch-1 branch December 6, 2024 09:06
@flavorjones
Copy link
Member

This was released yesterday in v1.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants