Class: SimpleSauce::Options
- Inherits:
-
Object
- Object
- SimpleSauce::Options
- Defined in:
- lib/simple_sauce/options.rb
Constant Summary collapse
- W3C =
%i[browser_name platform_name browser_version].freeze
- SAUCE =
%i[access_key appium_version avoid_proxy build capture_html chromedriver_version command_timeout crmuxdriver_version custom_data disable_popup_handler extended_debugging firefox_adapter_version firefox_profile_url idle_timeout iedriver_version max_duration name parent_tunnel passed prerun prevent_requeue priority proxy_host public record_logs record_screenshots record_video restricted_public_info screen_resolution selenium_version source tags time_zone tunnel_identifier username video_upload_on_pass capture_performance].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #capabilities ⇒ Object (also: #as_json)
-
#initialize(**opts) ⇒ Options
constructor
A new instance of Options.
Constructor Details
Class Method Details
.camel_case(str) ⇒ Object
6 7 8 |
# File 'lib/simple_sauce/options.rb', line 6 def camel_case(str) str.to_s.gsub(/_([a-z])/) { Regexp.last_match(1).upcase } end |
Instance Method Details
#capabilities ⇒ Object Also known as: as_json
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/simple_sauce/options.rb', line 28 def capabilities caps = W3C.each_with_object({}) do |key, hash| value = send(key) hash[self.class.camel_case(key)] = value if value end caps['sauce:options'] = {} SAUCE.each do |key| value = send(key) caps['sauce:options'][self.class.camel_case(key)] = value unless value.nil? end caps end |