1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Fix deprecation warning in tests

This commit is contained in:
Thomas Walpole 2021-10-23 22:52:51 -07:00
parent 97393be2c6
commit 4ceba73d5a
2 changed files with 16 additions and 4 deletions

View file

@ -181,15 +181,21 @@ RSpec.describe 'Capybara::Session with chrome' do
end
describe 'log access' do
let(:logs) do
session.driver.browser.then do |chrome_driver|
chrome_driver.respond_to?(:logs) ? chrome_driver : chrome_driver.manage
end.logs
end
it 'does not error getting log types' do
expect do
session.driver.browser.manage.logs.available_types
logs.available_types
end.not_to raise_error
end
it 'does not error when getting logs' do
expect do
session.driver.browser.manage.logs.get(:browser)
logs.get(:browser)
end.not_to raise_error
end
end

View file

@ -76,15 +76,21 @@ RSpec.describe 'Capybara::Session with remote Chrome' do
end
describe 'log access' do
let(:logs) do
session.driver.browser.then do |chrome_driver|
chrome_driver.respond_to?(:logs) ? chrome_driver : chrome_driver.manage
end.logs
end
it 'does not error when getting log types' do
expect do
session.driver.browser.manage.logs.available_types
logs.available_types
end.not_to raise_error
end
it 'does not error when getting logs' do
expect do
session.driver.browser.manage.logs.get(:browser)
logs.get(:browser)
end.not_to raise_error
end
end