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 +4 -4
- data/CHANGELOG.md +7 -0
- data/bin/edgedriver +5 -0
- data/bin/iedriver +5 -0
- data/lib/webdrivers.rb +2 -0
- data/lib/webdrivers/common.rb +3 -3
- data/lib/webdrivers/edgedriver.rb +34 -0
- data/lib/webdrivers/iedriver.rb +35 -0
- data/lib/webdrivers/phantomjs.rb +1 -1
- data/spec/edgedriver_spec.rb +24 -0
- data/spec/iedriver_spec.rb +27 -0
- data/webdrivers.gemspec +1 -1
- metadata +11 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 279ab774cf93763609a3538d1cca8161ed86db9d
|
4
|
+
data.tar.gz: 62f2420c0e46b3c9eca68521ff5dbf13beec5d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c93b132108cda6b783584cffc6e15734e63ab5563b80853d5ad91a5e887800945ebfc2ba3306d7c8bd481580aea69f031a96d38319d378b1cdcb88e4572d3f2
|
7
|
+
data.tar.gz: b570701ea51b6666246940dda279a4e4eb10c4eca7b9dfa086a287e2b6ac419e053d54107522535ff031915ec4f44f77337e3e328b4f2d987859a80c82c4e43a
|
data/CHANGELOG.md
CHANGED
data/bin/edgedriver
ADDED
data/bin/iedriver
ADDED
data/lib/webdrivers.rb
CHANGED
data/lib/webdrivers/common.rb
CHANGED
@@ -36,7 +36,7 @@ module Webdrivers
|
|
36
36
|
case filename
|
37
37
|
when /tar\.gz$/
|
38
38
|
untargz_file(filename)
|
39
|
-
|
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 =
|
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
|
data/lib/webdrivers/phantomjs.rb
CHANGED
@@ -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.
|
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.
|
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
|