selenium-connect 1.6.0 → 1.7.0

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.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.9.3@selenium-server
1
+ rvm 1.9.3@selenium-connect
@@ -6,7 +6,7 @@ require 'selenium-connect/server'
6
6
  module SeleniumConnect
7
7
 
8
8
  extend self
9
- attr_reader :config, :location, :server, :driver
9
+ attr_reader :config, :config_file, :location, :server, :driver
10
10
 
11
11
  def configure
12
12
  yield configuration
@@ -1,5 +1,8 @@
1
1
  module SeleniumConnect
2
2
  class Configuration
3
+ #YAML Config File
4
+ attr_accessor :config_file
5
+
3
6
  #Selenium Server
4
7
  attr_accessor :host, :port, :version,
5
8
  :background, :log, :jar
@@ -12,17 +15,33 @@ module SeleniumConnect
12
15
  attr_accessor :sauce_username, :sauce_api_key,
13
16
  :os, :browser_version, :description
14
17
 
15
- def initialize
16
- defaults
18
+ def config_file=(file)
19
+ set_config_values_from_file(get_config_values_from_file(file))
17
20
  end
18
21
 
19
22
  private
20
23
 
24
+ def initialize
25
+ defaults
26
+ end
27
+
21
28
  def defaults
22
29
  @host = 'localhost' unless host
23
30
  @port = 4444 unless port
24
31
  @log = false unless log
25
32
  @browser = 'firefox' unless browser
26
33
  end
34
+
35
+ def get_config_values_from_file(file)
36
+ require 'yaml'
37
+ YAML.load_file(file)
38
+ end
39
+
40
+ def set_config_values_from_file(config_file_values)
41
+ @host = config_file_values['host'] || host
42
+ @port = config_file_values['port'] || port
43
+ @log = config_file_values['log'] || log
44
+ @browser = config_file_values['browser'] || browser
45
+ end
27
46
  end
28
47
  end
@@ -1,7 +1,7 @@
1
1
  require 'selenium/rake/server_task'
2
2
 
3
3
  Selenium::Rake::ServerTask.new(:server) do |t|
4
- t.version = :latest
4
+ t.jar = '/Users/more/Dropbox/_dev/Arrgyle/selenium-connect/selenium-server-standalone-2.32.0.jar'
5
5
  t.background
6
6
  t.log = false
7
7
  t.port = 4444
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'selenium-connect'
3
- s.version = '1.6.0'
3
+ s.version = '1.7.0'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ['Dave Haeffner']
6
6
  s.email = ['dave@arrgyle.com']
@@ -36,7 +36,7 @@ describe "Acceptance Tests" do
36
36
  quit
37
37
  end
38
38
 
39
- it "local jar file" do
39
+ it "local jar file", :wip => true do
40
40
  SeleniumConnect.configure do |c|
41
41
  c.host = "localhost"
42
42
  c.jar = "#{Dir.pwd}/selenium-server-standalone-2.32.0.jar"
data/spec/example.yaml ADDED
@@ -0,0 +1,23 @@
1
+ #Setup & Debugging
2
+ jar:
3
+ log:
4
+
5
+
6
+ #Where to run your tests
7
+ host: 'alocalhost'
8
+ port:
9
+
10
+
11
+ #Browser & Host
12
+ browser: 'afirefox'
13
+ browser_path:
14
+ profile_path:
15
+ profile_name:
16
+
17
+
18
+ #Saucelabs
19
+ os:
20
+ sauce_username:
21
+ sauce_api_key:
22
+ browser_version:
23
+ description:
data/spec/sauce_spec.rb CHANGED
@@ -2,7 +2,7 @@ require 'selenium-connect'
2
2
 
3
3
  describe "Sauce Labs" do
4
4
 
5
- it 'hello world', :wip => true do
5
+ it 'hello world' do
6
6
  SeleniumConnect.configure do |c|
7
7
  c.host = 'saucelabs'
8
8
  c.sauce_username = 'testing_arrgyle'
data/spec/yaml_spec.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'selenium-connect'
2
+
3
+ describe "YAML" do
4
+
5
+ it 'setting config_file returns a proper config object' do
6
+ SeleniumConnect.configure do |c|
7
+ c.config_file = "#{Dir.pwd}/spec/example.yaml"
8
+ end
9
+ end
10
+
11
+ end
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.6.0
4
+ version: 1.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
12
+ date: 2013-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
@@ -98,7 +98,9 @@ files:
98
98
  - lib/selenium-connect/server.rb
99
99
  - selenium-connect.gemspec
100
100
  - spec/acceptance_spec.rb
101
+ - spec/example.yaml
101
102
  - spec/sauce_spec.rb
103
+ - spec/yaml_spec.rb
102
104
  homepage: https://github.com/arrgyle/selenium-connect
103
105
  licenses:
104
106
  - MIT