selenium-connect 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module SeleniumConnect
2
2
  class Configuration
3
- attr_accessor :host, :port, :browser, :profile_path, :profile_name, :version, :background, :log, :jar
3
+ attr_accessor :host, :port, :browser, :browser_path, :profile_path, :profile_name, :version, :background, :log, :jar
4
4
 
5
5
  def initialize
6
6
  defaults
@@ -1,8 +1,8 @@
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
- t.log = '/Users/more/Dropbox/_dev/Arrgyle/selenium-connect/runner.out'
6
+ t.log = 'false'
7
7
  t.port = 4444
8
8
  end
@@ -20,10 +20,10 @@ module SeleniumConnect
20
20
  Selenium::WebDriver.for(
21
21
  :remote,
22
22
  :url => set_server_url,
23
- :desired_capabilities => get_capabilities)
23
+ :desired_capabilities => get_browser)
24
24
  end
25
25
 
26
- def get_capabilities
26
+ def get_browser
27
27
  case config.browser
28
28
  when "firefox"
29
29
  Firefox.new(config).capabilities
@@ -21,7 +21,10 @@ module SeleniumConnect
21
21
  def init_browser
22
22
  profile = get_profile
23
23
  profile.assume_untrusted_certificate_issuer = false unless profile.nil?
24
- @capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)
24
+ browser = Selenium::WebDriver::Remote::Capabilities.firefox
25
+ browser[:firefox_binary] if config.browser_path
26
+ browser[:firefox_profile] = profile
27
+ @capabilities = browser
25
28
  end
26
29
 
27
30
  end #Firefox
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'selenium-connect'
3
- s.version = '1.4.0'
3
+ s.version = '1.5.0'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ['Dave Haeffner']
6
6
  s.email = ['dave@arrgyle.com']
@@ -7,13 +7,14 @@ describe "Acceptance Tests" do
7
7
  let(:quit) { SeleniumConnect.finish }
8
8
 
9
9
  context "Common" do
10
- it "logging", :wip => true do
10
+ it "logging" do
11
11
  SeleniumConnect.configure do |c|
12
12
  c.log = "#{Dir.pwd}/runner.out"
13
13
  end
14
14
  google.visit
15
15
  SeleniumConnect.finish
16
- File.read('runner.out').empty?.should == false
16
+ log = File.read('runner.out')
17
+ log.empty?.should == false
17
18
  File.delete('runner.out')
18
19
  end
19
20
  end
@@ -35,6 +36,16 @@ describe "Acceptance Tests" do
35
36
  quit
36
37
  end
37
38
 
39
+ it "local jar file" do
40
+ SeleniumConnect.configure do |c|
41
+ c.host = "localhost"
42
+ c.jar = "#{Dir.pwd}/selenium-server-standalone-2.32.0.jar"
43
+ end
44
+ google.visit
45
+ google.page_title.should include("Google")
46
+ quit
47
+ end
48
+
38
49
  it "profile name" do
39
50
  pending "requires machine setup to run, and need a public example"
40
51
  SeleniumConnect.configure do |c|
@@ -49,7 +60,36 @@ describe "Acceptance Tests" do
49
60
  end
50
61
  end
51
62
 
63
+ it "browser path", :wip => true do
64
+ #only works with Firefox
65
+ SeleniumConnect.configure do |c|
66
+ c.host = "localhost"
67
+ c.jar = "#{Dir.pwd}/selenium-server-standalone-2.32.0.jar"
68
+ c.browser = "firefox"
69
+ c.browser_path = "/Applications/Firefox.app/Contents/MacOS/firefox"
70
+ end
71
+ google.visit
72
+ google.page_title.should include("Google")
73
+ quit
74
+ end
75
+
52
76
  end #Context//Firefox
77
+
78
+ context "IE" do
79
+
80
+ it "grid" do
81
+ pending
82
+ SeleniumConnect.configure do |c|
83
+ # c.host = "at-xp1.dodiis-aspace.local"
84
+ c.host = "192.168.1.139"
85
+ c.browser = "ie"
86
+ end
87
+ driver.get 'https://mashup.ic.mantech.com/ispace'
88
+ quit
89
+ end
90
+
91
+ end #Context//IE
92
+
53
93
  end #Describe
54
94
 
55
95
  class Google
@@ -64,6 +104,6 @@ class Google
64
104
  end
65
105
 
66
106
  def page_title
67
- page.getTitle
107
+ page.title
68
108
  end
69
109
  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.4.0
4
+ version: 1.5.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-10 00:00:00.000000000 Z
12
+ date: 2013-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver