mirror of
https://github.com/teampoltergeist/poltergeist.git
synced 2022-11-09 12:05:00 -05:00
Merge pull request #764 from reedloden/samesite-cookies
Support 'SameSite' attribute on cookies - this is just an accessor for it - currently PhantomJS does not actually do anything differently if the attribute is set
This commit is contained in:
commit
4c73db0ebe
4 changed files with 9 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#### Features ####
|
||||
* Added ability to set proxy at runtime (Dmitry Vorotilin)
|
||||
* Implement basic support for `SameSite` cookies (Reed Loden)
|
||||
|
||||
#### Bug fixes ####
|
||||
* Fix within_frame when called on a frame whose src attribute is about:blank (Thomas Walpole) [Issue #772]
|
||||
|
|
|
@ -212,11 +212,11 @@ The following methods are used to inspect and manipulate cookies:
|
|||
* `page.driver.cookies` - a hash of cookies accessible to the current
|
||||
page. The keys are cookie names. The values are `Cookie` objects, with
|
||||
the following methods: `name`, `value`, `domain`, `path`, `secure?`,
|
||||
`httponly?`, `expires`.
|
||||
`httponly?`, `samesite`, `expires`.
|
||||
* `page.driver.set_cookie(name, value, options = {})` - set a cookie.
|
||||
The options hash can take the following keys: `:domain`, `:path`,
|
||||
`:secure`, `:httponly`, `:expires`. `:expires` should be a `Time`
|
||||
object.
|
||||
`:secure`, `:httponly`, `:samesite`, `:expires`. `:expires` should be a
|
||||
`Time` object.
|
||||
* `page.driver.remove_cookie(name)` - remove a cookie
|
||||
* `page.driver.clear_cookies` - clear all cookies
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ module Capybara::Poltergeist
|
|||
@attributes['httponly']
|
||||
end
|
||||
|
||||
def samesite
|
||||
@attributes['samesite']
|
||||
end
|
||||
|
||||
def expires
|
||||
Time.at @attributes['expiry'] if @attributes['expiry']
|
||||
end
|
||||
|
|
|
@ -653,6 +653,7 @@ module Capybara::Poltergeist
|
|||
expect(cookie.path).to eq('/')
|
||||
expect(cookie.secure?).to be false
|
||||
expect(cookie.httponly?).to be false
|
||||
expect(cookie.samesite).to be_nil
|
||||
expect(cookie.expires).to be_nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue