Skip to content

Commit

Permalink
Fix deprecation warning in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Oct 24, 2021
1 parent 97393be commit 4ceba73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions spec/selenium_spec_chrome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,21 @@ module TestSessions
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
Expand Down
10 changes: 8 additions & 2 deletions spec/selenium_spec_chrome_remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,21 @@ module TestSessions
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
Expand Down

0 comments on commit 4ceba73

Please sign in to comment.