Skip to content

Commit

Permalink
[rb] class method not an instance method
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Apr 7, 2020
1 parent d49c8ba commit cadb413
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions rb/lib/selenium/webdriver/remote/capabilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def json_create(data)
caps.accept_insecure_certs = data.delete('acceptInsecureCerts') if data.key?('acceptInsecureCerts')
caps.page_load_strategy = data.delete('pageLoadStrategy') if data.key?('pageLoadStrategy')

process_key(caps, data.delete('timeouts'))
process_timeouts(caps, data.delete('timeouts'))

if data.key?('proxy')
proxy = data.delete('proxy')
Expand All @@ -161,6 +161,16 @@ def json_create(data)

caps
end

private

def process_timeouts(caps, timeouts)
return if timeouts.nil?

caps.implicit_timeout = timeouts['implicit']
caps.page_load_timeout = timeouts['pageLoad']
caps.script_timeout = timeouts['script']
end
end

#
Expand Down Expand Up @@ -263,14 +273,6 @@ def camel_case(str)
str.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
end

def process_timeouts(caps, timeouts)
return if timeouts.nil?

caps.implicit_timeout = timeouts['implicit']
caps.page_load_timeout = timeouts['pageLoad']
caps.script_timeout = timeouts['script']
end

end # Capabilities
end # Remote
end # WebDriver
Expand Down

0 comments on commit cadb413

Please sign in to comment.