Class: Selenium::WebDriver::Safari::Options
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Safari::Options
- Defined in:
- lib/selenium/webdriver/safari/options.rb
Instance Attribute Summary collapse
-
#data_dir ⇒ Object
Returns the value of attribute data_dir.
-
#extensions ⇒ Object
readonly
Returns the value of attribute extensions.
-
#port ⇒ Object
Returns the value of attribute port.
-
#skip_extension_installation ⇒ Object
Returns the value of attribute skip_extension_installation.
Instance Method Summary collapse
- #add_extension(ext) ⇒ Object
- #as_json ⇒ Object
- #clean_session? ⇒ Boolean
-
#initialize(opts = {}) ⇒ Options
constructor
A new instance of Options.
- #skip_extension_installation? ⇒ Boolean
- #to_capabilities ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Options
Returns a new instance of Options.
8 9 10 11 |
# File 'lib/selenium/webdriver/safari/options.rb', line 8 def initialize(opts = {}) @extensions = [] (opts) end |
Instance Attribute Details
#data_dir ⇒ Object
Returns the value of attribute data_dir.
5 6 7 |
# File 'lib/selenium/webdriver/safari/options.rb', line 5 def data_dir @data_dir end |
#extensions ⇒ Object (readonly)
Returns the value of attribute extensions.
6 7 8 |
# File 'lib/selenium/webdriver/safari/options.rb', line 6 def extensions @extensions end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/selenium/webdriver/safari/options.rb', line 5 def port @port end |
#skip_extension_installation ⇒ Object
Returns the value of attribute skip_extension_installation.
5 6 7 |
# File 'lib/selenium/webdriver/safari/options.rb', line 5 def skip_extension_installation @skip_extension_installation end |
Instance Method Details
#add_extension(ext) ⇒ Object
13 14 15 |
# File 'lib/selenium/webdriver/safari/options.rb', line 13 def add_extension(ext) @extensions << verify_safari_extension(ext) end |
#as_json ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/selenium/webdriver/safari/options.rb', line 32 def as_json { 'port' => port, 'dataDir' => data_dir, 'cleanSession' => clean_session?, 'extensions' => extensions_as_json, 'skipExtensionInstallation' => skip_extension_installation? } end |
#clean_session? ⇒ Boolean
17 18 19 |
# File 'lib/selenium/webdriver/safari/options.rb', line 17 def clean_session? !!@clean_session end |
#skip_extension_installation? ⇒ Boolean
21 22 23 |
# File 'lib/selenium/webdriver/safari/options.rb', line 21 def skip_extension_installation? !!@skip_extension_installation end |
#to_capabilities ⇒ Object
25 26 27 28 29 30 |
# File 'lib/selenium/webdriver/safari/options.rb', line 25 def to_capabilities caps = Remote::Capabilities.safari caps.merge!('safari.options' => as_json) caps end |