selenium-connect 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,17 @@
1
1
  module SeleniumConnect
2
2
  class Configuration
3
3
  attr_accessor :host, :port, :browser, :profile_path, :version, :background, :log, :jar
4
+
5
+ def initialize
6
+ set_sensible_defaults
7
+ end
8
+
9
+ private
10
+
11
+ def set_sensible_defaults
12
+ host = "localhost" unless host
13
+ port = "4444" unless port
14
+ browser = "firefox" unless browser
15
+ end
4
16
  end
5
17
  end
@@ -8,16 +8,13 @@ module SeleniumConnect
8
8
 
9
9
  def initialize(configuration)
10
10
  @configuration = configuration
11
- set_sensible_defaults
12
- @driver = initialize_selenium
11
+ @driver = initialize_driver
13
12
  end
14
13
 
15
14
  private
16
15
 
17
- def set_sensible_defaults
18
- configuration.host = "localhost" unless configuration.host
19
- configuration.port = "4444" unless configuration.port
20
- configuration.browser = "firefox" unless configuration.browser
16
+ def set_server_url
17
+ "http://#{configuration.host}:#{configuration.port}/wd/hub"
21
18
  end
22
19
 
23
20
  def set_profile
@@ -26,11 +23,7 @@ module SeleniumConnect
26
23
  Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)
27
24
  end
28
25
 
29
- def set_server_url
30
- "http://#{configuration.host}:#{configuration.port}/wd/hub"
31
- end
32
-
33
- def initialize_selenium
26
+ def initialize_driver
34
27
  Selenium::WebDriver::Remote::Bridge.new(
35
28
  :url => set_server_url,
36
29
  :desired_capabilities => set_profile)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'selenium-connect'
3
- s.version = '1.2.0'
3
+ s.version = '1.2.1'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ['Dave Haeffner']
6
6
  s.email = ['dave@arrgyle.com']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: