Use selenium-webdriver `exectue_cdp` method if it exists
This commit is contained in:
parent
34de7e08be
commit
d57e3387b3
|
@ -90,10 +90,14 @@ private
|
|||
end
|
||||
|
||||
def execute_cdp(cmd, params = {})
|
||||
if browser.respond_to? :execute_cdp
|
||||
browser.execute_cdp(cmd, params)
|
||||
else
|
||||
args = { cmd: cmd, params: params }
|
||||
result = bridge.http.call(:post, "session/#{bridge.session_id}/goog/cdp/execute", args)
|
||||
result['value']
|
||||
end
|
||||
end
|
||||
|
||||
def build_node(native_node, initial_cache = {})
|
||||
::Capybara::Selenium::ChromeNode.new(self, native_node, initial_cache)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rspec/expectations'
|
||||
require 'webdrivers' if ENV['CI']
|
||||
require 'webdrivers' if ENV['CI'] || ENV['WEBDRIVERS']
|
||||
require 'selenium_statistics'
|
||||
if ENV['TRAVIS']
|
||||
require 'coveralls'
|
||||
|
|
Loading…
Reference in New Issue