selenium-webdriver 3.141.5926 → 3.142.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +46 -0
- data/lib/selenium/webdriver/chrome/bridge.rb +21 -3
- data/lib/selenium/webdriver/common/service.rb +25 -12
- data/lib/selenium/webdriver/firefox/binary.rb +2 -2
- data/lib/selenium/webdriver/firefox/driver.rb +2 -1
- data/lib/selenium/webdriver/firefox/options.rb +17 -6
- data/lib/selenium/webdriver/remote/response.rb +3 -1
- data/lib/selenium/webdriver/safari/bridge.rb +3 -3
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +1 -1
- metadata +4 -8
- data/lib/selenium/webdriver/common/options.rb +0 -177
- data/lib/selenium/webdriver/common/w3c_options.rb +0 -45
- data/lib/selenium/webdriver/firefox/bridge.rb +0 -47
- data/lib/selenium/webdriver/remote/commands.rb +0 -156
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b75c8768c4e57d00ee16b2ce24fb7531074c89a
|
4
|
+
data.tar.gz: 84c67463ae2e1601cb0f6e57b89d0350aa5f35f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5727d2019f0648bf85d9d7ba99a7d85f2f5e5a0248566b802290814f64f90f0b035d1fc4a36e6e00bfbe6b4b6a9633768aa6ba576bc58ee6a0648ed960ca78e2
|
7
|
+
data.tar.gz: 84d07768e3743275502cc0c546c943b27e97657e5dedfe9bb18891e379e1a814a308c681f5ba77cf4fc51e45320f0f7b566ad16ec7013536cd94276b064274d0
|
data/CHANGES
CHANGED
@@ -1,3 +1,49 @@
|
|
1
|
+
3.142.4 (2019-09-02)
|
2
|
+
====================
|
3
|
+
|
4
|
+
Chrome:
|
5
|
+
* Added support for new command for getting logs in ChromeDriver 76+
|
6
|
+
with W3C mode on
|
7
|
+
|
8
|
+
3.142.3 (2019-05-21)
|
9
|
+
====================
|
10
|
+
|
11
|
+
Firefox:
|
12
|
+
* Fixed a regression when Firefox binary path was not sent to GeckoDriver
|
13
|
+
by default and browser could not be located (issue #7219)
|
14
|
+
|
15
|
+
|
16
|
+
3.142.2 (2019-05-11)
|
17
|
+
====================
|
18
|
+
|
19
|
+
Chrome:
|
20
|
+
* Fixed an issue when getting/setting network conditions and sending CDP
|
21
|
+
commands didn't work with Grid (issue #7174)
|
22
|
+
|
23
|
+
Safari:
|
24
|
+
* Fixed an issue when getting/setting permissions and attaching debugger
|
25
|
+
didn't work with Grid (issue #7174)
|
26
|
+
|
27
|
+
3.142.1 (2019-05-07)
|
28
|
+
====================
|
29
|
+
|
30
|
+
Firefox:
|
31
|
+
* Fixed an issue when processing error in legacy driver would result
|
32
|
+
in NoMethodError (issue #7178)
|
33
|
+
|
34
|
+
3.142.0 (2019-04-24)
|
35
|
+
====================
|
36
|
+
|
37
|
+
Ruby:
|
38
|
+
* Fixed an issue when services are not shutdown properly
|
39
|
+
|
40
|
+
Firefox:
|
41
|
+
* Fixed an issue when passing :profile string to Firefox::Options.new would
|
42
|
+
result in NoMethodError. Now it will find a profile with such name on your
|
43
|
+
system and use it accordingly (issue #7119)
|
44
|
+
* Fixed an issue when instantiating Firefox driver with capabilities having
|
45
|
+
:marionette would result in NoMethodError (issue #7120)
|
46
|
+
|
1
47
|
3.141.5926 (2019-04-18)
|
2
48
|
=======================
|
3
49
|
|
@@ -23,9 +23,11 @@ module Selenium
|
|
23
23
|
module Bridge
|
24
24
|
|
25
25
|
COMMANDS = {
|
26
|
-
get_network_conditions: [:get, '
|
27
|
-
set_network_conditions: [:post, '
|
28
|
-
send_command: [:post, '
|
26
|
+
get_network_conditions: [:get, 'session/:session_id/chromium/network_conditions'],
|
27
|
+
set_network_conditions: [:post, 'session/:session_id/chromium/network_conditions'],
|
28
|
+
send_command: [:post, 'session/:session_id/goog/cdp/execute'],
|
29
|
+
get_available_log_types: [:get, 'session/:session_id/se/log/types'],
|
30
|
+
get_log: [:post, 'session/:session_id/se/log']
|
29
31
|
}.freeze
|
30
32
|
|
31
33
|
def commands(command)
|
@@ -44,6 +46,22 @@ module Selenium
|
|
44
46
|
execute :set_network_conditions, {}, {network_conditions: conditions}
|
45
47
|
end
|
46
48
|
|
49
|
+
def available_log_types
|
50
|
+
types = execute :get_available_log_types
|
51
|
+
Array(types).map(&:to_sym)
|
52
|
+
end
|
53
|
+
|
54
|
+
def log(type)
|
55
|
+
data = execute :get_log, {}, {type: type.to_s}
|
56
|
+
|
57
|
+
Array(data).map do |l|
|
58
|
+
begin
|
59
|
+
LogEntry.new l.fetch('level', 'UNKNOWN'), l.fetch('timestamp'), l.fetch('message')
|
60
|
+
rescue KeyError
|
61
|
+
next
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
47
65
|
end # Bridge
|
48
66
|
end # Chrome
|
49
67
|
end # WebDriver
|
@@ -35,27 +35,40 @@ module Selenium
|
|
35
35
|
@missing_text = nil
|
36
36
|
|
37
37
|
class << self
|
38
|
-
attr_reader :default_port, :driver_path, :executable, :missing_text
|
38
|
+
attr_reader :default_port, :driver_path, :executable, :missing_text, :shutdown_supported
|
39
39
|
|
40
|
-
def chrome(
|
41
|
-
Chrome::Service.new(
|
40
|
+
def chrome(**opts)
|
41
|
+
Chrome::Service.new(**opts)
|
42
42
|
end
|
43
43
|
|
44
|
-
def firefox(
|
45
|
-
Firefox::
|
44
|
+
def firefox(**opts)
|
45
|
+
binary_path = Firefox::Binary.path
|
46
|
+
args = opts.delete(:args)
|
47
|
+
case args
|
48
|
+
when Hash
|
49
|
+
args[:binary] ||= binary_path
|
50
|
+
opts[:args] = args
|
51
|
+
when Array
|
52
|
+
opts[:args] = ["--binary=#{binary_path}"]
|
53
|
+
opts[:args] += args
|
54
|
+
else
|
55
|
+
opts[:args] = ["--binary=#{binary_path}"]
|
56
|
+
end
|
57
|
+
|
58
|
+
Firefox::Service.new(**opts)
|
46
59
|
end
|
47
60
|
|
48
|
-
def ie(
|
49
|
-
IE::Service.new(
|
61
|
+
def ie(**opts)
|
62
|
+
IE::Service.new(**opts)
|
50
63
|
end
|
51
64
|
alias_method :internet_explorer, :ie
|
52
65
|
|
53
|
-
def edge(
|
54
|
-
Edge::Service.new(
|
66
|
+
def edge(**opts)
|
67
|
+
Edge::Service.new(**opts)
|
55
68
|
end
|
56
69
|
|
57
|
-
def safari(
|
58
|
-
Safari::Service.new(
|
70
|
+
def safari(**opts)
|
71
|
+
Safari::Service.new(**opts)
|
59
72
|
end
|
60
73
|
|
61
74
|
def driver_path=(path)
|
@@ -100,7 +113,7 @@ module Selenium
|
|
100
113
|
end
|
101
114
|
|
102
115
|
def stop
|
103
|
-
return unless
|
116
|
+
return unless self.class.shutdown_supported
|
104
117
|
|
105
118
|
stop_server
|
106
119
|
@process.poll_for_exit STOP_TIMEOUT
|
@@ -130,8 +130,8 @@ module Selenium
|
|
130
130
|
@path = Platform.cygwin_path(@path, windows: true) if Platform.cygwin?
|
131
131
|
|
132
132
|
unless File.file?(@path.to_s)
|
133
|
-
error = "Could not find Firefox binary (os=#{Platform.os}). "
|
134
|
-
|
133
|
+
error = "Could not find Firefox binary (os=#{Platform.os}). " \
|
134
|
+
"Make sure Firefox is installed or set the path manually with #{self}.path="
|
135
135
|
raise Error::WebDriverError, error
|
136
136
|
end
|
137
137
|
|
@@ -39,7 +39,8 @@ module Selenium
|
|
39
39
|
private
|
40
40
|
|
41
41
|
def marionette?(opts)
|
42
|
-
opts.delete(:marionette) != false &&
|
42
|
+
opts.delete(:marionette) != false &&
|
43
|
+
(!opts[:desired_capabilities] || opts[:desired_capabilities][:marionette] != false)
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
@@ -45,7 +45,7 @@ module Selenium
|
|
45
45
|
def initialize(**opts)
|
46
46
|
@args = Set.new(opts.delete(:args) || [])
|
47
47
|
@binary = opts.delete(:binary)
|
48
|
-
@profile = opts.delete(:profile)
|
48
|
+
@profile = process_profile(opts.delete(:profile))
|
49
49
|
@log_level = opts.delete(:log_level)
|
50
50
|
@prefs = opts.delete(:prefs) || {}
|
51
51
|
@options = opts.delete(:options) || {}
|
@@ -123,11 +123,7 @@ module Selenium
|
|
123
123
|
#
|
124
124
|
|
125
125
|
def profile=(profile)
|
126
|
-
@profile =
|
127
|
-
profile
|
128
|
-
else
|
129
|
-
Profile.from_name(profile)
|
130
|
-
end
|
126
|
+
@profile = process_profile(profile)
|
131
127
|
end
|
132
128
|
|
133
129
|
#
|
@@ -145,6 +141,21 @@ module Selenium
|
|
145
141
|
|
146
142
|
{KEY => opts}
|
147
143
|
end
|
144
|
+
|
145
|
+
private
|
146
|
+
|
147
|
+
def process_profile(profile)
|
148
|
+
return unless profile
|
149
|
+
|
150
|
+
case profile
|
151
|
+
when Profile
|
152
|
+
profile
|
153
|
+
when String
|
154
|
+
Profile.from_name(profile)
|
155
|
+
else
|
156
|
+
raise Error::WebDriverError, "don't know how to handle profile: #{profile.inspect}"
|
157
|
+
end
|
158
|
+
end
|
148
159
|
end # Options
|
149
160
|
end # Firefox
|
150
161
|
end # WebDriver
|
@@ -79,9 +79,11 @@ module Selenium
|
|
79
79
|
def add_backtrace(ex)
|
80
80
|
return unless error_payload.is_a?(Hash)
|
81
81
|
|
82
|
+
# Legacy Firefox returns String in ['value'], while we expect Hash.
|
83
|
+
# Use #dig when Firefox legacy is removed (4.0).
|
82
84
|
server_trace = error_payload[STACKTRACE_KEY] ||
|
83
85
|
error_payload[STACKTRACE_KEY.downcase] ||
|
84
|
-
error_payload
|
86
|
+
(error_payload['value'] && error_payload['value'][STACKTRACE_KEY])
|
85
87
|
return unless server_trace
|
86
88
|
|
87
89
|
backtrace = case server_trace
|
@@ -24,9 +24,9 @@ module Selenium
|
|
24
24
|
|
25
25
|
# https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/WebDriverEndpointDoc/Commands/Commands.html
|
26
26
|
COMMANDS = {
|
27
|
-
get_permissions: [:get, '
|
28
|
-
set_permissions: [:post, '
|
29
|
-
attach_debugger: [:post, '
|
27
|
+
get_permissions: [:get, 'session/:session_id/apple/permissions'],
|
28
|
+
set_permissions: [:post, 'session/:session_id/apple/permissions'],
|
29
|
+
attach_debugger: [:post, 'session/:session_id/apple/attach_debugger']
|
30
30
|
}.freeze
|
31
31
|
|
32
32
|
def commands(command)
|
data/selenium-webdriver.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.files = Dir[root + '/**/*'].reject { |e| e =~ /ruby\.iml|build\.desc/ }.map { |e| e.sub(root + '/', '') }
|
32
32
|
s.require_paths = ['lib']
|
33
33
|
|
34
|
-
s.add_runtime_dependency 'childprocess', ['>= 0.5', '<
|
34
|
+
s.add_runtime_dependency 'childprocess', ['>= 0.5', '< 3.0']
|
35
35
|
s.add_runtime_dependency 'rubyzip', ['~> 1.2', '>= 1.2.2']
|
36
36
|
|
37
37
|
# childprocess requires ffi on windows but doesn't declare it in its dependencies
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.142.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-09-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: '0.5'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '3.0'
|
24
24
|
name: childprocess
|
25
25
|
prerelease: false
|
26
26
|
type: :runtime
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
version: '0.5'
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '3.0'
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -246,7 +246,6 @@ files:
|
|
246
246
|
- lib/selenium/webdriver/common/manager.rb
|
247
247
|
- lib/selenium/webdriver/common/mouse.rb
|
248
248
|
- lib/selenium/webdriver/common/navigation.rb
|
249
|
-
- lib/selenium/webdriver/common/options.rb
|
250
249
|
- lib/selenium/webdriver/common/platform.rb
|
251
250
|
- lib/selenium/webdriver/common/port_prober.rb
|
252
251
|
- lib/selenium/webdriver/common/profile_helper.rb
|
@@ -261,7 +260,6 @@ files:
|
|
261
260
|
- lib/selenium/webdriver/common/touch_screen.rb
|
262
261
|
- lib/selenium/webdriver/common/w3c_action_builder.rb
|
263
262
|
- lib/selenium/webdriver/common/w3c_manager.rb
|
264
|
-
- lib/selenium/webdriver/common/w3c_options.rb
|
265
263
|
- lib/selenium/webdriver/common/wait.rb
|
266
264
|
- lib/selenium/webdriver/common/window.rb
|
267
265
|
- lib/selenium/webdriver/common/zipper.rb
|
@@ -272,7 +270,6 @@ files:
|
|
272
270
|
- lib/selenium/webdriver/edge/service.rb
|
273
271
|
- lib/selenium/webdriver/firefox.rb
|
274
272
|
- lib/selenium/webdriver/firefox/binary.rb
|
275
|
-
- lib/selenium/webdriver/firefox/bridge.rb
|
276
273
|
- lib/selenium/webdriver/firefox/driver.rb
|
277
274
|
- lib/selenium/webdriver/firefox/extension.rb
|
278
275
|
- lib/selenium/webdriver/firefox/extension/prefs.json
|
@@ -295,7 +292,6 @@ files:
|
|
295
292
|
- lib/selenium/webdriver/remote.rb
|
296
293
|
- lib/selenium/webdriver/remote/bridge.rb
|
297
294
|
- lib/selenium/webdriver/remote/capabilities.rb
|
298
|
-
- lib/selenium/webdriver/remote/commands.rb
|
299
295
|
- lib/selenium/webdriver/remote/driver.rb
|
300
296
|
- lib/selenium/webdriver/remote/http/common.rb
|
301
297
|
- lib/selenium/webdriver/remote/http/curb.rb
|
@@ -1,177 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
module Selenium
|
21
|
-
module WebDriver
|
22
|
-
class Options
|
23
|
-
#
|
24
|
-
# @api private
|
25
|
-
#
|
26
|
-
|
27
|
-
def initialize(bridge)
|
28
|
-
@bridge = bridge
|
29
|
-
end
|
30
|
-
|
31
|
-
#
|
32
|
-
# Add a cookie to the browser
|
33
|
-
#
|
34
|
-
# @param [Hash] opts the options to create a cookie with.
|
35
|
-
# @option opts [String] :name A name
|
36
|
-
# @option opts [String] :value A value
|
37
|
-
# @option opts [String] :path ('/') A path
|
38
|
-
# @option opts [String] :secure (false) A boolean
|
39
|
-
# @option opts [Time,DateTime,Numeric,nil] :expires (nil) Expiry date, either as a Time, DateTime, or seconds since epoch.
|
40
|
-
#
|
41
|
-
# @raise [ArgumentError] if :name or :value is not specified
|
42
|
-
#
|
43
|
-
|
44
|
-
def add_cookie(opts = {})
|
45
|
-
raise ArgumentError, 'name is required' unless opts[:name]
|
46
|
-
raise ArgumentError, 'value is required' unless opts[:value]
|
47
|
-
|
48
|
-
opts[:path] ||= '/'
|
49
|
-
opts[:secure] ||= false
|
50
|
-
|
51
|
-
obj = opts.delete(:expires)
|
52
|
-
opts[:expiry] = seconds_from(obj).to_i if obj
|
53
|
-
|
54
|
-
@bridge.add_cookie opts
|
55
|
-
end
|
56
|
-
|
57
|
-
#
|
58
|
-
# Get the cookie with the given name
|
59
|
-
#
|
60
|
-
# @param [String] name the name of the cookie
|
61
|
-
# @return [Hash, nil] the cookie, or nil if it wasn't found.
|
62
|
-
#
|
63
|
-
|
64
|
-
def cookie_named(name)
|
65
|
-
all_cookies.find { |c| c[:name] == name }
|
66
|
-
end
|
67
|
-
|
68
|
-
#
|
69
|
-
# Delete the cookie with the given name
|
70
|
-
#
|
71
|
-
# @param [String] name the name of the cookie to delete
|
72
|
-
#
|
73
|
-
|
74
|
-
def delete_cookie(name)
|
75
|
-
@bridge.delete_cookie name
|
76
|
-
end
|
77
|
-
|
78
|
-
#
|
79
|
-
# Delete all cookies
|
80
|
-
#
|
81
|
-
|
82
|
-
def delete_all_cookies
|
83
|
-
@bridge.delete_all_cookies
|
84
|
-
end
|
85
|
-
|
86
|
-
#
|
87
|
-
# Get all cookies
|
88
|
-
#
|
89
|
-
# @return [Array<Hash>] list of cookies
|
90
|
-
#
|
91
|
-
|
92
|
-
def all_cookies
|
93
|
-
@bridge.cookies.map { |cookie| convert_cookie(cookie) }
|
94
|
-
end
|
95
|
-
|
96
|
-
def timeouts
|
97
|
-
@timeouts ||= Timeouts.new(@bridge)
|
98
|
-
end
|
99
|
-
|
100
|
-
#
|
101
|
-
# @api beta This API may be changed or removed in a future release.
|
102
|
-
#
|
103
|
-
|
104
|
-
def logs
|
105
|
-
@logs ||= Logs.new(@bridge)
|
106
|
-
end
|
107
|
-
|
108
|
-
#
|
109
|
-
# Create a new top-level browsing context
|
110
|
-
# https://w3c.github.io/webdriver/#new-window
|
111
|
-
# @param type [Symbol] Supports two values: :tab and :window.
|
112
|
-
# Use :tab if you'd like the new window to share an OS-level window
|
113
|
-
# with the current browsing context.
|
114
|
-
# Use :window otherwise
|
115
|
-
# @return [String] The value of the window handle
|
116
|
-
#
|
117
|
-
def new_window(type = :tab)
|
118
|
-
case type
|
119
|
-
when :tab, :window
|
120
|
-
result = @bridge.new_window(type)
|
121
|
-
unless result.key?('handle')
|
122
|
-
raise UnknownError, "the driver did not return a handle. " \
|
123
|
-
"The returned result: #{result.inspect}"
|
124
|
-
end
|
125
|
-
result['handle']
|
126
|
-
else
|
127
|
-
raise ArgumentError, "invalid argument for type. Got: '#{type.inspect}'. " \
|
128
|
-
"Try :tab or :window"
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
#
|
133
|
-
# @api beta This API may be changed or removed in a future release.
|
134
|
-
#
|
135
|
-
|
136
|
-
def window
|
137
|
-
@window ||= Window.new(@bridge)
|
138
|
-
end
|
139
|
-
|
140
|
-
private
|
141
|
-
|
142
|
-
SECONDS_PER_DAY = 86_400.0
|
143
|
-
|
144
|
-
def datetime_at(int)
|
145
|
-
DateTime.civil(1970) + (int / SECONDS_PER_DAY)
|
146
|
-
end
|
147
|
-
|
148
|
-
def seconds_from(obj)
|
149
|
-
case obj
|
150
|
-
when Time
|
151
|
-
obj.to_f
|
152
|
-
when DateTime
|
153
|
-
(obj - DateTime.civil(1970)) * SECONDS_PER_DAY
|
154
|
-
when Numeric
|
155
|
-
obj
|
156
|
-
else
|
157
|
-
raise ArgumentError, "invalid value for expiration date: #{obj.inspect}"
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
def strip_port(str)
|
162
|
-
str.split(':', 2).first
|
163
|
-
end
|
164
|
-
|
165
|
-
def convert_cookie(cookie)
|
166
|
-
{
|
167
|
-
name: cookie['name'],
|
168
|
-
value: cookie['value'],
|
169
|
-
path: cookie['path'],
|
170
|
-
domain: cookie['domain'] && strip_port(cookie['domain']),
|
171
|
-
expires: cookie['expiry'] && datetime_at(cookie['expiry']),
|
172
|
-
secure: cookie['secure']
|
173
|
-
}
|
174
|
-
end
|
175
|
-
end # Options
|
176
|
-
end # WebDriver
|
177
|
-
end # Selenium
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
module Selenium
|
21
|
-
module WebDriver
|
22
|
-
class W3COptions < Options
|
23
|
-
|
24
|
-
#
|
25
|
-
# Get the cookie with the given name
|
26
|
-
#
|
27
|
-
# @param [String] name the name of the cookie
|
28
|
-
# @return [Hash, nil] the cookie, or nil if it wasn't found.
|
29
|
-
#
|
30
|
-
|
31
|
-
def cookie_named(name)
|
32
|
-
convert_cookie(@bridge.cookie(name))
|
33
|
-
end
|
34
|
-
|
35
|
-
#
|
36
|
-
# Delete all cookies
|
37
|
-
#
|
38
|
-
|
39
|
-
def delete_all_cookies
|
40
|
-
@bridge.delete_all_cookies
|
41
|
-
end
|
42
|
-
|
43
|
-
end # WC3Options
|
44
|
-
end # WebDriver
|
45
|
-
end # Selenium
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
module Selenium
|
21
|
-
module WebDriver
|
22
|
-
module Firefox
|
23
|
-
module Bridge
|
24
|
-
|
25
|
-
COMMANDS = {
|
26
|
-
install_addon: [:post, 'session/:session_id/moz/addon/install'],
|
27
|
-
uninstall_addon: [:post, 'session/:session_id/moz/addon/uninstall']
|
28
|
-
}.freeze
|
29
|
-
|
30
|
-
def commands(command)
|
31
|
-
COMMANDS[command] || super
|
32
|
-
end
|
33
|
-
|
34
|
-
def install_addon(path, temporary)
|
35
|
-
payload = {path: path}
|
36
|
-
payload[:temporary] = temporary unless temporary.nil?
|
37
|
-
execute :install_addon, {}, payload
|
38
|
-
end
|
39
|
-
|
40
|
-
def uninstall_addon(id)
|
41
|
-
execute :uninstall_addon, {}, {id: id}
|
42
|
-
end
|
43
|
-
|
44
|
-
end # Bridge
|
45
|
-
end # Firefox
|
46
|
-
end # WebDriver
|
47
|
-
end # Selenium
|
@@ -1,156 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
module Selenium
|
21
|
-
module WebDriver
|
22
|
-
module Remote
|
23
|
-
|
24
|
-
#
|
25
|
-
# https://w3c.github.io/webdriver/#endpoints
|
26
|
-
# @api private
|
27
|
-
#
|
28
|
-
|
29
|
-
class Bridge
|
30
|
-
COMMANDS = {
|
31
|
-
status: [:get, 'status'],
|
32
|
-
|
33
|
-
#
|
34
|
-
# session handling
|
35
|
-
#
|
36
|
-
|
37
|
-
new_session: [:post, 'session'],
|
38
|
-
delete_session: [:delete, 'session/:session_id'],
|
39
|
-
|
40
|
-
#
|
41
|
-
# basic driver
|
42
|
-
#
|
43
|
-
|
44
|
-
get: [:post, 'session/:session_id/url'],
|
45
|
-
get_current_url: [:get, 'session/:session_id/url'],
|
46
|
-
back: [:post, 'session/:session_id/back'],
|
47
|
-
forward: [:post, 'session/:session_id/forward'],
|
48
|
-
refresh: [:post, 'session/:session_id/refresh'],
|
49
|
-
get_title: [:get, 'session/:session_id/title'],
|
50
|
-
|
51
|
-
#
|
52
|
-
# window and Frame handling
|
53
|
-
#
|
54
|
-
|
55
|
-
get_window_handle: [:get, 'session/:session_id/window'],
|
56
|
-
new_window: [:post, 'session/:session_id/window/new'],
|
57
|
-
close_window: [:delete, 'session/:session_id/window'],
|
58
|
-
switch_to_window: [:post, 'session/:session_id/window'],
|
59
|
-
get_window_handles: [:get, 'session/:session_id/window/handles'],
|
60
|
-
fullscreen_window: [:post, 'session/:session_id/window/fullscreen'],
|
61
|
-
minimize_window: [:post, 'session/:session_id/window/minimize'],
|
62
|
-
maximize_window: [:post, 'session/:session_id/window/maximize'],
|
63
|
-
set_window_size: [:post, 'session/:session_id/window/size'],
|
64
|
-
get_window_size: [:get, 'session/:session_id/window/size'],
|
65
|
-
set_window_position: [:post, 'session/:session_id/window/position'],
|
66
|
-
get_window_position: [:get, 'session/:session_id/window/position'],
|
67
|
-
set_window_rect: [:post, 'session/:session_id/window/rect'],
|
68
|
-
get_window_rect: [:get, 'session/:session_id/window/rect'],
|
69
|
-
switch_to_frame: [:post, 'session/:session_id/frame'],
|
70
|
-
switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],
|
71
|
-
|
72
|
-
#
|
73
|
-
# element
|
74
|
-
#
|
75
|
-
|
76
|
-
find_element: [:post, 'session/:session_id/element'],
|
77
|
-
find_elements: [:post, 'session/:session_id/elements'],
|
78
|
-
find_child_element: [:post, 'session/:session_id/element/:id/element'],
|
79
|
-
find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
|
80
|
-
get_active_element: [:get, 'session/:session_id/element/active'],
|
81
|
-
is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
|
82
|
-
get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
|
83
|
-
get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],
|
84
|
-
get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],
|
85
|
-
get_element_text: [:get, 'session/:session_id/element/:id/text'],
|
86
|
-
get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],
|
87
|
-
get_element_rect: [:get, 'session/:session_id/element/:id/rect'],
|
88
|
-
is_element_enabled: [:get, 'session/:session_id/element/:id/enabled'],
|
89
|
-
|
90
|
-
#
|
91
|
-
# document handling
|
92
|
-
#
|
93
|
-
|
94
|
-
get_page_source: [:get, 'session/:session_id/source'],
|
95
|
-
execute_script: [:post, 'session/:session_id/execute/sync'],
|
96
|
-
execute_async_script: [:post, 'session/:session_id/execute/async'],
|
97
|
-
|
98
|
-
#
|
99
|
-
# cookies
|
100
|
-
#
|
101
|
-
|
102
|
-
get_all_cookies: [:get, 'session/:session_id/cookie'],
|
103
|
-
get_cookie: [:get, 'session/:session_id/cookie/:name'],
|
104
|
-
add_cookie: [:post, 'session/:session_id/cookie'],
|
105
|
-
delete_cookie: [:delete, 'session/:session_id/cookie/:name'],
|
106
|
-
delete_all_cookies: [:delete, 'session/:session_id/cookie'],
|
107
|
-
|
108
|
-
#
|
109
|
-
# timeouts
|
110
|
-
#
|
111
|
-
|
112
|
-
set_timeout: [:post, 'session/:session_id/timeouts'],
|
113
|
-
|
114
|
-
#
|
115
|
-
# actions
|
116
|
-
#
|
117
|
-
|
118
|
-
actions: [:post, 'session/:session_id/actions'],
|
119
|
-
release_actions: [:delete, 'session/:session_id/actions'],
|
120
|
-
|
121
|
-
#
|
122
|
-
# Element Operations
|
123
|
-
#
|
124
|
-
|
125
|
-
element_click: [:post, 'session/:session_id/element/:id/click'],
|
126
|
-
element_tap: [:post, 'session/:session_id/element/:id/tap'],
|
127
|
-
element_clear: [:post, 'session/:session_id/element/:id/clear'],
|
128
|
-
element_send_keys: [:post, 'session/:session_id/element/:id/value'],
|
129
|
-
|
130
|
-
#
|
131
|
-
# alerts
|
132
|
-
#
|
133
|
-
|
134
|
-
dismiss_alert: [:post, 'session/:session_id/alert/dismiss'],
|
135
|
-
accept_alert: [:post, 'session/:session_id/alert/accept'],
|
136
|
-
get_alert_text: [:get, 'session/:session_id/alert/text'],
|
137
|
-
send_alert_text: [:post, 'session/:session_id/alert/text'],
|
138
|
-
|
139
|
-
#
|
140
|
-
# screenshot
|
141
|
-
#
|
142
|
-
|
143
|
-
take_screenshot: [:get, 'session/:session_id/screenshot'],
|
144
|
-
take_element_screenshot: [:get, 'session/:session_id/element/:id/screenshot'],
|
145
|
-
|
146
|
-
#
|
147
|
-
# server extensions
|
148
|
-
#
|
149
|
-
|
150
|
-
upload_file: [:post, 'session/:session_id/se/file']
|
151
|
-
}.freeze
|
152
|
-
|
153
|
-
end # Bridge
|
154
|
-
end # Remote
|
155
|
-
end # WebDriver
|
156
|
-
end # Selenium
|