selenium-webdriver 3.4.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +15 -0
- data/lib/selenium/webdriver/chrome/driver.rb +2 -2
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/remote/bridge.rb +4 -4
- data/lib/selenium/webdriver/remote/w3c/capabilities.rb +19 -13
- data/selenium-webdriver.gemspec +1 -1
- metadata +2 -3
- data/Gemfile.lock +0 -54
data/CHANGES
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
3.4.2 (2017-06-14)
|
2
|
+
==================
|
3
|
+
|
4
|
+
Ruby:
|
5
|
+
* Added unhandledPromptBehavior to the list of known capabilities.
|
6
|
+
* Added timeouts to the list of known capabilities.
|
7
|
+
* Fixed a regression when passing hash as :desired_capabilities caused NoMethodError (issue 4172, thanks Thomas Walpole).
|
8
|
+
* Fixed a regression when extension capabilities (the ones that have ":" inside)
|
9
|
+
were filtered out when doing protocol handshake.
|
10
|
+
* Improved handling of capability names passed as plain camelCased strings
|
11
|
+
vs Rubyish snake_cased symbols when doing protocol handshake.
|
12
|
+
|
13
|
+
Chrome:
|
14
|
+
* Fixed a regression when passing :switches to driver initialization was ignored.
|
15
|
+
|
1
16
|
3.4.1 (2017-06-13)
|
2
17
|
==================
|
3
18
|
|
@@ -74,9 +74,9 @@ module Selenium
|
|
74
74
|
caps = opts.delete(:desired_capabilities) { Remote::Capabilities.chrome }
|
75
75
|
options = opts.delete(:options) { Options.new }
|
76
76
|
|
77
|
-
args = opts.delete(:args)
|
77
|
+
args = opts.delete(:args) || opts.delete(:switches)
|
78
78
|
if args
|
79
|
-
WebDriver.logger.deprecate ':args', 'Selenium::WebDriver::Chrome::Options#add_argument'
|
79
|
+
WebDriver.logger.deprecate ':args or :switches', 'Selenium::WebDriver::Chrome::Options#add_argument'
|
80
80
|
raise ArgumentError, ':args must be an Array of Strings' unless args.is_a? Array
|
81
81
|
args.each { |arg| options.add_argument(arg.to_s) }
|
82
82
|
end
|
Binary file
|
@@ -92,7 +92,7 @@ module Selenium
|
|
92
92
|
#
|
93
93
|
|
94
94
|
def create_session(desired_capabilities)
|
95
|
-
response = execute(:new_session, {},
|
95
|
+
response = execute(:new_session, {}, merged_capabilities(desired_capabilities))
|
96
96
|
|
97
97
|
@session_id = response['sessionId']
|
98
98
|
oss_status = response['status']
|
@@ -171,13 +171,13 @@ module Selenium
|
|
171
171
|
COMMANDS[command]
|
172
172
|
end
|
173
173
|
|
174
|
-
def
|
175
|
-
|
174
|
+
def merged_capabilities(oss_capabilities)
|
175
|
+
w3c_capabilities = W3C::Capabilities.from_oss(oss_capabilities)
|
176
176
|
|
177
177
|
{
|
178
178
|
desiredCapabilities: oss_capabilities,
|
179
179
|
capabilities: {
|
180
|
-
firstMatch: [
|
180
|
+
firstMatch: [w3c_capabilities]
|
181
181
|
}
|
182
182
|
}
|
183
183
|
end
|
@@ -39,6 +39,8 @@ module Selenium
|
|
39
39
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1326397
|
40
40
|
class Capabilities
|
41
41
|
|
42
|
+
EXTENSION_CAPABILITY_PATTERN = /\A[\w-]+:.*\z/
|
43
|
+
|
42
44
|
# TODO (alex): compare with spec
|
43
45
|
KNOWN = [
|
44
46
|
:browser_name,
|
@@ -54,10 +56,10 @@ module Selenium
|
|
54
56
|
:implicit_timeout,
|
55
57
|
:page_load_timeout,
|
56
58
|
:script_timeout,
|
59
|
+
:unhandled_prompt_behavior,
|
60
|
+
:timeouts,
|
57
61
|
].freeze
|
58
62
|
|
59
|
-
BROWSER_SPECIFIC = ['moz:firefoxOptions'].freeze
|
60
|
-
|
61
63
|
KNOWN.each do |key|
|
62
64
|
define_method key do
|
63
65
|
@capabilities.fetch(key)
|
@@ -140,26 +142,30 @@ module Selenium
|
|
140
142
|
|
141
143
|
#
|
142
144
|
# Creates W3C compliant capabilities from OSS ones.
|
143
|
-
# @param [Remote::Capabilities]
|
145
|
+
# @param [Hash, Remote::Capabilities]
|
144
146
|
#
|
145
147
|
|
146
|
-
def from_oss(
|
147
|
-
|
148
|
+
def from_oss(oss_capabilities)
|
149
|
+
w3c_capabilities = new
|
150
|
+
|
148
151
|
# TODO (alex): make capabilities enumerable?
|
149
|
-
|
150
|
-
|
152
|
+
oss_capabilities = oss_capabilities.__send__(:capabilities) unless oss_capabilities.is_a?(Hash)
|
153
|
+
oss_capabilities.each do |name, value|
|
151
154
|
next if value.nil?
|
152
155
|
next if value.is_a?(String) && value.empty?
|
153
156
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
157
|
+
capability_name = name.to_s
|
158
|
+
snake_cased_capability_names = KNOWN.map(&:to_s)
|
159
|
+
camel_cased_capability_names = snake_cased_capability_names.map(&w3c_capabilities.method(:camel_case))
|
160
|
+
|
161
|
+
next unless snake_cased_capability_names.include?(capability_name) ||
|
162
|
+
camel_cased_capability_names.include?(capability_name) ||
|
163
|
+
capability_name.match(EXTENSION_CAPABILITY_PATTERN)
|
159
164
|
|
165
|
+
w3c_capabilities[name] = value
|
160
166
|
end
|
161
167
|
|
162
|
-
|
168
|
+
w3c_capabilities
|
163
169
|
end
|
164
170
|
end
|
165
171
|
|
data/selenium-webdriver.gemspec
CHANGED
@@ -5,7 +5,7 @@ raise "cwd must be #{root} when reading gemspec" if root != Dir.pwd
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'selenium-webdriver'
|
8
|
-
s.version = '3.4.
|
8
|
+
s.version = '3.4.2'
|
9
9
|
|
10
10
|
s.authors = ['Alex Rodionov', 'Titus Fortner']
|
11
11
|
s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: selenium-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.4.
|
5
|
+
version: 3.4.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alex Rodionov
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2017-06-
|
14
|
+
date: 2017-06-15 00:00:00 +07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -96,7 +96,6 @@ extra_rdoc_files: []
|
|
96
96
|
files:
|
97
97
|
- CHANGES
|
98
98
|
- Gemfile
|
99
|
-
- Gemfile.lock
|
100
99
|
- LICENSE
|
101
100
|
- README.md
|
102
101
|
- selenium-webdriver.gemspec
|
data/Gemfile.lock
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
selenium-webdriver (3.4.1)
|
5
|
-
childprocess (~> 0.5)
|
6
|
-
rubyzip (~> 1.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
addressable (2.5.1)
|
12
|
-
public_suffix (~> 2.0, >= 2.0.2)
|
13
|
-
childprocess (0.7.0)
|
14
|
-
ffi (~> 1.0, >= 1.0.11)
|
15
|
-
crack (0.4.3)
|
16
|
-
safe_yaml (~> 1.0.0)
|
17
|
-
diff-lcs (1.3)
|
18
|
-
ffi (1.9.18)
|
19
|
-
hashdiff (0.3.4)
|
20
|
-
public_suffix (2.0.5)
|
21
|
-
rack (1.6.8)
|
22
|
-
rspec (3.6.0)
|
23
|
-
rspec-core (~> 3.6.0)
|
24
|
-
rspec-expectations (~> 3.6.0)
|
25
|
-
rspec-mocks (~> 3.6.0)
|
26
|
-
rspec-core (3.6.0)
|
27
|
-
rspec-support (~> 3.6.0)
|
28
|
-
rspec-expectations (3.6.0)
|
29
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.6.0)
|
31
|
-
rspec-mocks (3.6.0)
|
32
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.6.0)
|
34
|
-
rspec-support (3.6.0)
|
35
|
-
rubyzip (1.2.1)
|
36
|
-
safe_yaml (1.0.4)
|
37
|
-
webmock (2.3.2)
|
38
|
-
addressable (>= 2.3.6)
|
39
|
-
crack (>= 0.3.2)
|
40
|
-
hashdiff
|
41
|
-
yard (0.8.7.6)
|
42
|
-
|
43
|
-
PLATFORMS
|
44
|
-
ruby
|
45
|
-
|
46
|
-
DEPENDENCIES
|
47
|
-
rack (~> 1.0)
|
48
|
-
rspec (~> 3.0)
|
49
|
-
selenium-webdriver!
|
50
|
-
webmock (~> 2.0)
|
51
|
-
yard (~> 0.8.7)
|
52
|
-
|
53
|
-
BUNDLED WITH
|
54
|
-
1.15.1
|