Skip to content

Commit 8f09638

Browse files
aguspetitusfortner
andauthored
[rb] Allow symbols again to be passed on delete_cookie (#15519)
* [build] allow tests tagged exclusive-if-local to run on rbe * Fix bug where symbol is not accepting on delete cookie --------- Co-authored-by: titusfortner <titus.fortner@gmail.com>
1 parent 848df8b commit 8f09638

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

rb/lib/selenium/webdriver/remote/bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def add_cookie(cookie)
323323
end
324324

325325
def delete_cookie(name)
326-
raise ArgumentError, 'Cookie name cannot be null or empty' if name.nil? || name.strip.empty?
326+
raise ArgumentError, 'Cookie name cannot be null or empty' if name.nil? || name.to_s.strip.empty?
327327

328328
execute :delete_cookie, name: name
329329
end

rb/spec/integration/selenium/webdriver/manager_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ module WebDriver
268268
expect { driver.manage.delete_cookie(nil) }
269269
.to raise_error(ArgumentError, /Cookie name cannot be null or empty/)
270270
end
271+
272+
it 'allows deleting a cookies using a symbol' do
273+
driver.manage.add_cookie name: :foo, value: 'bar'
274+
driver.manage.delete_cookie(:foo)
275+
expect(driver.manage.all_cookies).to be_empty
276+
end
271277
end
272278
end # Options
273279
end # WebDriver

0 commit comments

Comments
 (0)