webdrivers 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d48dd7ab5521a67cc6fe9c30fa30878264ae2a82
4
- data.tar.gz: eec19913069b05438341878692f4705ba2be4890
3
+ metadata.gz: 279ab774cf93763609a3538d1cca8161ed86db9d
4
+ data.tar.gz: 62f2420c0e46b3c9eca68521ff5dbf13beec5d7d
5
5
  SHA512:
6
- metadata.gz: 285e46750351b6a1e002c4b6aeb7839f1f2336fefb8b3e3c974378883f039e85e3b554d42823bcfee6685bab19f4f55ea4c8d4dd62cfdce2cd37995a418bca21
7
- data.tar.gz: ce3eb1716aded508d92c16f09ca3b381b1d3509ae7d037f4e2183aee5524479fc3ab9b5b5ccda5dd0b946cf3157926e2a88c24225e5b0ece8b2d671e72622bf1
6
+ metadata.gz: 2c93b132108cda6b783584cffc6e15734e63ab5563b80853d5ad91a5e887800945ebfc2ba3306d7c8bd481580aea69f031a96d38319d378b1cdcb88e4572d3f2
7
+ data.tar.gz: b570701ea51b6666246940dda279a4e4eb10c4eca7b9dfa086a287e2b6ac419e053d54107522535ff031915ec4f44f77337e3e328b4f2d987859a80c82c4e43a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Changelog
2
2
  ==========
3
3
 
4
+ 2.3.0 - 2016-11-26
5
+ ----------
6
+
7
+ * Implement IEDriver support
8
+ * Implement MicrosoftWebDriver support
9
+
10
+
4
11
  2.2.1 - 2016-11-26
5
12
  ----------
6
13
 
data/bin/edgedriver ADDED
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require "webdrivers"
4
+
5
+ Webdrivers::Edgedriver.install(*ARGV) if Webdrivers::IEDriver.platform == 'win'
data/bin/iedriver ADDED
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require "webdrivers"
4
+
5
+ Webdrivers::IEDriver.install(*ARGV) if Webdrivers::IEDriver.platform == 'win'
data/lib/webdrivers.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "webdrivers/common"
2
2
  require "webdrivers/chromedriver"
3
+ require "webdrivers/edgedriver"
3
4
  require "webdrivers/geckodriver"
5
+ require "webdrivers/iedriver"
4
6
  require "webdrivers/phantomjs"
5
7
  require 'fileutils'
6
8
  require 'rbconfig'
@@ -36,7 +36,7 @@ module Webdrivers
36
36
  case filename
37
37
  when /tar\.gz$/
38
38
  untargz_file(filename)
39
- else
39
+ when /\.zip$/
40
40
  unzip_file(filename)
41
41
  end
42
42
  end
@@ -63,7 +63,7 @@ module Webdrivers
63
63
  @top_path
64
64
  end
65
65
 
66
- def download_url(version = nil)
66
+ def download_url(version = '2.0.0')
67
67
  downloads[version || newest_version]
68
68
  end
69
69
 
@@ -90,7 +90,7 @@ module Webdrivers
90
90
  end
91
91
 
92
92
  def internet_connection?
93
- true if open(base_url)
93
+ true #if open(base_url)
94
94
  rescue
95
95
  false
96
96
  end
@@ -0,0 +1,34 @@
1
+ require 'nokogiri'
2
+
3
+ module Webdrivers
4
+ class Edgedriver < Common
5
+
6
+ class << self
7
+ def file_name
8
+ "MicrosoftWebDriver.exe"
9
+ end
10
+
11
+ def current_version
12
+ # No version information available
13
+ end
14
+
15
+ def newest_version
16
+ version = %x(ver)
17
+ version[/\d+\.\d+\.\d+/][/[^\.]\d+$/]
18
+ end
19
+
20
+ def download_url(version = nil)
21
+ if newest_version.to_i >= 14965
22
+ 'https://download.microsoft.com/download/1/4/1/14156DA0-D40F-460A-B14D-1B264CA081A5/MicrosoftWebDriver.exe'
23
+ else
24
+ 'https://download.microsoft.com/download/3/2/D/32D3E464-F2EF-490F-841B-05D53C848D15/MicrosoftWebDriver.exe'
25
+ end
26
+ end
27
+
28
+ def base_url
29
+ 'http://google.com'
30
+ end
31
+ end
32
+
33
+ end
34
+ end
@@ -0,0 +1,35 @@
1
+ require 'nokogiri'
2
+
3
+ module Webdrivers
4
+ class IEDriver < Common
5
+
6
+ class << self
7
+ def file_name
8
+ "IEDriverServer.exe"
9
+ end
10
+
11
+ def current_version
12
+ return nil unless File.exists?(binary_path)
13
+ %x(#{binary_path} --version).strip.match(/IEDriverServer.exe (\d\.\d+\.\d*\.\d*)/)[1]
14
+ end
15
+
16
+ def newest_version
17
+ downloads.keys.sort.last
18
+ end
19
+
20
+ def downloads
21
+ doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url))
22
+ items = doc.css("Key").collect(&:text)
23
+ items.select! { |item| item.include?('IEDriverServer_Win32') }
24
+ items.each_with_object({}) do |item, hash|
25
+ hash[item[/^[^\/]+/]] = "#{base_url}#{item}"
26
+ end
27
+ end
28
+
29
+ def base_url
30
+ 'http://selenium-release.storage.googleapis.com/'
31
+ end
32
+ end
33
+
34
+ end
35
+ end
@@ -32,7 +32,7 @@ module Webdrivers
32
32
  end
33
33
 
34
34
  def extract_file(filename)
35
- FileUtils.mv("#{platform_install_dir}/#{filename}bin/#{filename}", file_name)
35
+ FileUtils.mv("#{platform_install_dir}/#{filename}bin/#{file_name}", file_name)
36
36
  end
37
37
  end
38
38
 
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe Webdrivers::Edgedriver do
4
+
5
+ let(:edgedriver) { Webdrivers::Edgedriver }
6
+
7
+ it 'downloads' do
8
+ edgedriver.download
9
+ file = "#{ENV['GEM_HOME']}/bin/edgedriver"
10
+ expect(File.exist?(file)).to eq true
11
+ end
12
+
13
+ it { expect(edgedriver.newest_version.to_f).to be >= 2.25 }
14
+
15
+
16
+ context "on a windows platform" do
17
+ before { allow(edgedriver).to receive(:platform) { "win" } }
18
+
19
+ it { expect(edgedriver.file_name).to match(/MicrosoftWebDriver\.exe$/) }
20
+
21
+ it { expect(edgedriver.binary_path).to match '.webdrivers/win/MicrosoftWebDriver.exe' }
22
+
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ require "spec_helper"
2
+
3
+ describe Webdrivers::IEDriver do
4
+
5
+ let(:iedriver) { Webdrivers::IEDriver }
6
+
7
+ it 'downloads' do
8
+ iedriver.download
9
+ file = "#{ENV['GEM_HOME']}/bin/iedriver"
10
+ expect(File.exist?(file)).to eq true
11
+ end
12
+
13
+ it { expect(iedriver.newest_version.to_f).to be >= 2.25 }
14
+
15
+
16
+ context "on a windows platform" do
17
+ before { allow(iedriver).to receive(:platform) { "win" } }
18
+
19
+ it { expect(iedriver.downloads.size).to be >= 16 }
20
+
21
+ it { expect(iedriver.file_name).to match(/IEDriverServer\.exe$/) }
22
+
23
+ it { expect(iedriver.binary_path).to match '.webdrivers/win/IEDriverServer.exe' }
24
+
25
+ it { expect(iedriver.download_url('2.53')).to match("2.53/IEDriverServer_Win32") }
26
+ end
27
+ end
data/webdrivers.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "webdrivers"
6
- s.version = "2.2.1"
6
+ s.version = "2.3.0"
7
7
  s.authors = ["Titus Fortner"]
8
8
  s.email = ["titusfortner@gmail.com"]
9
9
  s.homepage = "https://github.com/titusfortner/webdrivers"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdrivers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
@@ -72,7 +72,9 @@ email:
72
72
  - titusfortner@gmail.com
73
73
  executables:
74
74
  - chromedriver
75
+ - edgedriver
75
76
  - geckodriver
77
+ - iedriver
76
78
  - phantomjs
77
79
  extensions: []
78
80
  extra_rdoc_files: []
@@ -85,15 +87,21 @@ files:
85
87
  - README.md
86
88
  - Rakefile
87
89
  - bin/chromedriver
90
+ - bin/edgedriver
88
91
  - bin/geckodriver
92
+ - bin/iedriver
89
93
  - bin/phantomjs
90
94
  - lib/webdrivers.rb
91
95
  - lib/webdrivers/chromedriver.rb
92
96
  - lib/webdrivers/common.rb
97
+ - lib/webdrivers/edgedriver.rb
93
98
  - lib/webdrivers/geckodriver.rb
99
+ - lib/webdrivers/iedriver.rb
94
100
  - lib/webdrivers/phantomjs.rb
95
101
  - spec/chromedriver_spec.rb
102
+ - spec/edgedriver_spec.rb
96
103
  - spec/geckodriver_spec.rb
104
+ - spec/iedriver_spec.rb
97
105
  - spec/phantomjs_spec.rb
98
106
  - spec/spec_helper.rb
99
107
  - webdrivers.gemspec
@@ -123,6 +131,8 @@ specification_version: 4
123
131
  summary: Easy installation and use of webdrivers.
124
132
  test_files:
125
133
  - spec/chromedriver_spec.rb
134
+ - spec/edgedriver_spec.rb
126
135
  - spec/geckodriver_spec.rb
136
+ - spec/iedriver_spec.rb
127
137
  - spec/phantomjs_spec.rb
128
138
  - spec/spec_helper.rb