File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
selenium/webdriver/remote
test/selenium/webdriver/common Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1117,7 +1117,7 @@ def add_cookie(self, cookie_dict) -> None:
1117
1117
1118
1118
"""
1119
1119
if 'sameSite' in cookie_dict :
1120
- assert cookie_dict ['sameSite' ] in ['Strict' , 'Lax' ]
1120
+ assert cookie_dict ['sameSite' ] in ['Strict' , 'Lax' , 'None' ]
1121
1121
self .execute (Command .ADD_COOKIE , {'cookie' : cookie_dict })
1122
1122
else :
1123
1123
self .execute (Command .ADD_COOKIE , {'cookie' : cookie_dict })
Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ def same_site_cookie_lax(webserver):
57
57
return same_site_cookie_lax
58
58
59
59
60
+ @pytest .fixture
61
+ def same_site_cookie_none (webserver ):
62
+ same_site_cookie_none = {
63
+ 'name' : 'foo' ,
64
+ 'value' : 'bar' ,
65
+ 'path' : '/' ,
66
+ 'domain' : webserver .host ,
67
+ 'sameSite' : 'None' ,
68
+ 'secure' : True }
69
+ return same_site_cookie_none
70
+
71
+
60
72
@pytest .fixture (autouse = True )
61
73
def pages (request , driver , pages ):
62
74
pages .load ('simpleTest.html' )
@@ -88,6 +100,15 @@ def testAddCookieSameSiteLax(same_site_cookie_lax, driver):
88
100
assert 'sameSite' in returned and returned ['sameSite' ] == 'Lax'
89
101
90
102
103
+ @pytest .mark .xfail_firefox (reason = 'sameSite cookie attribute not implemented' )
104
+ @pytest .mark .xfail_remote (reason = 'sameSite cookie attribute not implemented' )
105
+ @pytest .mark .xfail_safari
106
+ def testAddCookieSameSiteNone (same_site_cookie_none , driver ):
107
+ driver .add_cookie (same_site_cookie_none )
108
+ # Note that insecure sites (http:) can't set cookies with the Secure directive.
109
+ # driver.get_cookie would return None
110
+
111
+
91
112
@pytest .mark .xfail_ie
92
113
@pytest .mark .xfail_safari
93
114
def testAddingACookieThatExpiredInThePast (cookie , driver ):
You can’t perform that action at this time.
0 commit comments