webdrivers 2.3.2 → 2.4.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 +8 -0
- data/README.md +10 -4
- data/lib/webdrivers/common.rb +14 -8
- data/lib/webdrivers/edgedriver.rb +1 -1
- data/lib/webdrivers/phantomjs.rb +2 -2
- data/spec/chromedriver_spec.rb +3 -1
- data/spec/edgedriver_spec.rb +7 -3
- data/spec/geckodriver_spec.rb +3 -1
- data/spec/iedriver_spec.rb +3 -1
- data/spec/phantomjs_spec.rb +6 -4
- data/webdrivers.gemspec +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcddb954704b678fab85d7ae639d1c093387e30a
|
4
|
+
data.tar.gz: 27c68403706b2b469a0e4d643318321a8a3dfc88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a4562dc88f07adacffd0566765813ae34e9c58bdd75243e5f9dafe28b8759d2b01c7f3ae1f41dce39735a5e6c40c8032234ed1d8fa7198720ca38245a3567a3
|
7
|
+
data.tar.gz: 4fda0ac9518d6f57e8a55a620a467db14dd107deb5a08842975abc6c12eca71fc4c6c309f97ef1e5346f0d56ae2351c02bc8d4c60e8748a6ec1610a1fbe46211
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,14 +2,20 @@
|
|
2
2
|
|
3
3
|
[![Build status](https://api.travis-ci.org/titusfortner/webdrivers.svg)](https://travis-ci.org/titusfortner/webdrivers)
|
4
4
|
|
5
|
-
Run Selenium tests more easily with
|
5
|
+
Run Selenium tests more easily with automatic installation and updates for all supported webdrivers.
|
6
6
|
|
7
7
|
# Description
|
8
8
|
|
9
9
|
`webdrivers` installs driver executables, in your gem path.
|
10
|
-
`chromedriver` and `geckodriver` are currently supported.
|
11
10
|
|
12
|
-
|
11
|
+
Currently supported:
|
12
|
+
* `chromedriver`
|
13
|
+
* `geckodriver`
|
14
|
+
* `phantomjs`
|
15
|
+
* `IEDriverServer`
|
16
|
+
* `MicrosoftWebDriver`
|
17
|
+
|
18
|
+
Drivers are stored in `~/.webdrivers/platform` directory and used within the context of your gem path
|
13
19
|
|
14
20
|
|
15
21
|
# Usage
|
@@ -18,7 +24,7 @@ Drivers are stored in `~/.webdrivers` directory and used within the context of y
|
|
18
24
|
|
19
25
|
or in your Gemfile:
|
20
26
|
|
21
|
-
`gem "webdrivers", "~> 2.
|
27
|
+
`gem "webdrivers", "~> 2.3"`
|
22
28
|
|
23
29
|
|
24
30
|
# License
|
data/lib/webdrivers/common.rb
CHANGED
@@ -36,6 +36,9 @@ module Webdrivers
|
|
36
36
|
case filename
|
37
37
|
when /tar\.gz$/
|
38
38
|
untargz_file(filename)
|
39
|
+
when /tar\.bz2$/
|
40
|
+
system "tar xjf #{filename}"
|
41
|
+
filename.gsub('.tar.bz2', '')
|
39
42
|
when /\.zip$/
|
40
43
|
unzip_file(filename)
|
41
44
|
end
|
@@ -52,12 +55,13 @@ module Webdrivers
|
|
52
55
|
end
|
53
56
|
|
54
57
|
def unzip_file(filename)
|
55
|
-
Zip::
|
58
|
+
Zip::File.open("#{Dir.pwd}/#{filename}") do |zip_file|
|
56
59
|
zip_file.each do |f|
|
57
60
|
@top_path ||= f.name
|
58
61
|
f_path = File.join(Dir.pwd, f.name)
|
59
|
-
FileUtils.
|
60
|
-
|
62
|
+
FileUtils.rm_rf(f_path) if File.exist?(f_path)
|
63
|
+
FileUtils.mkdir_p(File.dirname(f_path)) unless File.exist?(File.dirname(f_path))
|
64
|
+
zip_file.extract(f, f_path)
|
61
65
|
end
|
62
66
|
end
|
63
67
|
@top_path
|
@@ -76,16 +80,18 @@ module Webdrivers
|
|
76
80
|
end
|
77
81
|
|
78
82
|
def install_dir
|
79
|
-
File.expand_path(File.join(ENV['HOME'], ".webdrivers")).tap { |dir| FileUtils.mkdir_p dir}
|
83
|
+
File.expand_path(File.join(ENV['HOME'], ".webdrivers")).tap { |dir| FileUtils.mkdir_p dir }
|
80
84
|
end
|
81
85
|
|
82
86
|
def platform
|
83
87
|
cfg = RbConfig::CONFIG
|
84
88
|
case cfg['host_os']
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
+
when /linux/
|
90
|
+
cfg['host_cpu'] =~ /x86_64|amd64/ ? "linux64" : "linux32"
|
91
|
+
when /darwin/
|
92
|
+
"mac"
|
93
|
+
else
|
94
|
+
"win"
|
89
95
|
end
|
90
96
|
end
|
91
97
|
|
@@ -18,7 +18,7 @@ module Webdrivers
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def download_url(version = nil)
|
21
|
-
if newest_version.to_i >=
|
21
|
+
if newest_version.to_i >= 14986
|
22
22
|
'https://download.microsoft.com/download/1/4/1/14156DA0-D40F-460A-B14D-1B264CA081A5/MicrosoftWebDriver.exe'
|
23
23
|
else
|
24
24
|
'https://download.microsoft.com/download/3/2/D/32D3E464-F2EF-490F-841B-05D53C848D15/MicrosoftWebDriver.exe'
|
data/lib/webdrivers/phantomjs.rb
CHANGED
@@ -20,7 +20,7 @@ module Webdrivers
|
|
20
20
|
def downloads
|
21
21
|
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url))
|
22
22
|
items = doc.css(".execute").collect { |item| item["href"] }
|
23
|
-
format_platform = platform.dup.gsub('32', '-i686').gsub('64', 'x86_64')
|
23
|
+
format_platform = platform.dup.gsub('32', '-i686').gsub('64', '-x86_64')
|
24
24
|
items.select! { |item| item.include?(format_platform) }
|
25
25
|
items.each_with_object({}) do |item, hash|
|
26
26
|
hash[item[/-(\d+\.\d+\.\d+)-/, 1]] = "https://bitbucket.org#{item}"
|
@@ -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/#{file_name}", file_name)
|
35
|
+
FileUtils.mv("#{platform_install_dir}/#{filename}/bin/#{file_name}", file_name)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
data/spec/chromedriver_spec.rb
CHANGED
@@ -6,8 +6,10 @@ describe Webdrivers::Chromedriver do
|
|
6
6
|
|
7
7
|
it 'downloads' do
|
8
8
|
chromedriver.download
|
9
|
-
|
9
|
+
suffix = chromedriver.platform == 'win' ? '.exe' : ''
|
10
|
+
file = "#{chromedriver.platform_install_dir}/chromedriver#{suffix}"
|
10
11
|
expect(File.exist?(file)).to eq true
|
12
|
+
FileUtils.rm(file)
|
11
13
|
end
|
12
14
|
|
13
15
|
it { expect(chromedriver.newest_version.to_f).to be >= 2.25 }
|
data/spec/edgedriver_spec.rb
CHANGED
@@ -5,13 +5,17 @@ describe Webdrivers::Edgedriver do
|
|
5
5
|
let(:edgedriver) { Webdrivers::Edgedriver }
|
6
6
|
|
7
7
|
it 'downloads' do
|
8
|
+
allow(edgedriver).to receive(:newest_version).and_return(0)
|
8
9
|
edgedriver.download
|
9
|
-
file = "#{
|
10
|
+
file = "#{edgedriver.platform_install_dir}/MicrosoftWebDriver.exe"
|
10
11
|
expect(File.exist?(file)).to eq true
|
12
|
+
FileUtils.rm(file)
|
11
13
|
end
|
12
14
|
|
13
|
-
it
|
14
|
-
|
15
|
+
it 'gets latest version' do
|
16
|
+
skip unless edgedriver.platform == 'win'
|
17
|
+
expect(edgedriver.newest_version.to_f).to be >= 2.25
|
18
|
+
end
|
15
19
|
|
16
20
|
context "on a windows platform" do
|
17
21
|
before { allow(edgedriver).to receive(:platform) { "win" } }
|
data/spec/geckodriver_spec.rb
CHANGED
@@ -6,8 +6,10 @@ describe Webdrivers::Geckodriver do
|
|
6
6
|
|
7
7
|
it 'downloads' do
|
8
8
|
geckodriver.download
|
9
|
-
|
9
|
+
suffix = geckodriver.platform == 'win' ? '.exe' : ''
|
10
|
+
file = "#{geckodriver.platform_install_dir}/geckodriver#{suffix}"
|
10
11
|
expect(File.exist?(file)).to eq true
|
12
|
+
FileUtils.rm(file)
|
11
13
|
end
|
12
14
|
|
13
15
|
it { expect(geckodriver.newest_version.to_f).to be >= 0.11 }
|
data/spec/iedriver_spec.rb
CHANGED
@@ -5,9 +5,11 @@ describe Webdrivers::IEDriver do
|
|
5
5
|
let(:iedriver) { Webdrivers::IEDriver }
|
6
6
|
|
7
7
|
it 'downloads' do
|
8
|
+
allow(iedriver).to receive(:current_version).and_return(0)
|
8
9
|
iedriver.download
|
9
|
-
file = "#{
|
10
|
+
file = "#{iedriver.platform_install_dir}/IEDriverServer.exe"
|
10
11
|
expect(File.exist?(file)).to eq true
|
12
|
+
FileUtils.rm(file)
|
11
13
|
end
|
12
14
|
|
13
15
|
it { expect(iedriver.newest_version.to_f).to be >= 2.25 }
|
data/spec/phantomjs_spec.rb
CHANGED
@@ -6,20 +6,22 @@ describe Webdrivers::PhantomJS do
|
|
6
6
|
|
7
7
|
it 'downloads' do
|
8
8
|
phantomjs.download
|
9
|
-
|
9
|
+
suffix = phantomjs.platform == 'win' ? '.exe' : ''
|
10
|
+
file = "#{phantomjs.platform_install_dir}/phantomjs#{suffix}"
|
10
11
|
expect(File.exist?(file)).to eq true
|
12
|
+
FileUtils.rm(file)
|
11
13
|
end
|
12
14
|
|
13
15
|
it { expect(phantomjs.newest_version.to_f).to be >= 0.11 }
|
14
16
|
|
15
|
-
it { expect(phantomjs.downloads.size).to be >=
|
17
|
+
it { expect(phantomjs.downloads.size).to be >= 4 }
|
16
18
|
|
17
19
|
context "on a linux platform" do
|
18
|
-
before { allow(phantomjs).to receive(:platform) { "
|
20
|
+
before { allow(phantomjs).to receive(:platform) { "linux64" } }
|
19
21
|
|
20
22
|
it { expect(phantomjs.file_name).to match(/phantomjs$/) }
|
21
23
|
|
22
|
-
it { expect(phantomjs.binary_path).to match '.webdrivers/
|
24
|
+
it { expect(phantomjs.binary_path).to match '.webdrivers/linux64/phantomjs' }
|
23
25
|
|
24
26
|
it { expect(phantomjs.download_url('1.9.6')).to match("phantomjs-1.9.6-linux-") }
|
25
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.4.0"
|
7
7
|
s.authors = ["Titus Fortner"]
|
8
8
|
s.email = ["titusfortner@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/titusfortner/webdrivers"
|
@@ -20,5 +20,5 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_development_dependency "rake", "~> 10.0"
|
21
21
|
|
22
22
|
s.add_runtime_dependency "nokogiri", "~> 1.6"
|
23
|
-
s.add_runtime_dependency "
|
23
|
+
s.add_runtime_dependency "rubyzip", "~> 1.0"
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webdrivers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -53,19 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rubyzip
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '1.0'
|
69
69
|
description: Run Selenium tests more easily with install and updates for all supported
|
70
70
|
webdrivers.
|
71
71
|
email:
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.6.8
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Easy installation and use of webdrivers.
|