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:
parent
97393be2c6
commit
4ceba73d5a
2 changed files with 16 additions and 4 deletions
|
@ -181,15 +181,21 @@ RSpec.describe 'Capybara::Session with chrome' do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'log access' do
|
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
|
it 'does not error getting log types' do
|
||||||
expect do
|
expect do
|
||||||
session.driver.browser.manage.logs.available_types
|
logs.available_types
|
||||||
end.not_to raise_error
|
end.not_to raise_error
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not error when getting logs' do
|
it 'does not error when getting logs' do
|
||||||
expect do
|
expect do
|
||||||
session.driver.browser.manage.logs.get(:browser)
|
logs.get(:browser)
|
||||||
end.not_to raise_error
|
end.not_to raise_error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -76,15 +76,21 @@ RSpec.describe 'Capybara::Session with remote Chrome' do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'log access' do
|
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
|
it 'does not error when getting log types' do
|
||||||
expect do
|
expect do
|
||||||
session.driver.browser.manage.logs.available_types
|
logs.available_types
|
||||||
end.not_to raise_error
|
end.not_to raise_error
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not error when getting logs' do
|
it 'does not error when getting logs' do
|
||||||
expect do
|
expect do
|
||||||
session.driver.browser.manage.logs.get(:browser)
|
logs.get(:browser)
|
||||||
end.not_to raise_error
|
end.not_to raise_error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue