selenium-webdriver 3.0.0.beta4.0 → 4.0.0.alpha5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +679 -0
  3. data/Gemfile +2 -0
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/lib/selenium-webdriver.rb +2 -2
  7. data/lib/selenium/server.rb +23 -16
  8. data/lib/selenium/webdriver.rb +43 -25
  9. data/lib/selenium/webdriver/atoms.rb +20 -1
  10. data/lib/selenium/webdriver/atoms/findElements.js +122 -0
  11. data/lib/selenium/webdriver/atoms/getAttribute.js +84 -11
  12. data/lib/selenium/webdriver/atoms/isDisplayed.js +100 -0
  13. data/lib/selenium/webdriver/chrome.rb +15 -20
  14. data/lib/selenium/webdriver/chrome/bridge.rb +29 -66
  15. data/lib/selenium/webdriver/{edge/service.rb → chrome/driver.rb} +19 -22
  16. data/lib/selenium/webdriver/chrome/options.rb +221 -0
  17. data/lib/selenium/webdriver/chrome/profile.rb +6 -7
  18. data/lib/selenium/webdriver/chrome/service.rb +20 -20
  19. data/lib/selenium/webdriver/common.rb +19 -11
  20. data/lib/selenium/webdriver/common/action_builder.rb +98 -246
  21. data/lib/selenium/webdriver/common/alert.rb +2 -7
  22. data/lib/selenium/webdriver/common/driver.rb +89 -51
  23. data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +45 -0
  24. data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +50 -0
  25. data/lib/selenium/webdriver/common/driver_extensions/{has_input_devices.rb → has_debugger.rb} +12 -25
  26. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +38 -0
  27. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +3 -5
  28. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +51 -0
  29. data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +3 -3
  30. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +51 -0
  31. data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +2 -2
  32. data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +2 -2
  33. data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +2 -2
  34. data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +4 -4
  35. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +9 -3
  36. data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +3 -5
  37. data/lib/selenium/webdriver/common/element.rb +32 -10
  38. data/lib/selenium/webdriver/common/error.rb +103 -121
  39. data/lib/selenium/webdriver/common/file_reaper.rb +3 -5
  40. data/lib/selenium/webdriver/common/html5/local_storage.rb +2 -2
  41. data/lib/selenium/webdriver/common/html5/session_storage.rb +2 -2
  42. data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +3 -2
  43. data/lib/selenium/webdriver/common/interactions/input_device.rb +54 -0
  44. data/lib/selenium/webdriver/common/interactions/interaction.rb +53 -0
  45. data/lib/selenium/webdriver/{phantomjs.rb → common/interactions/interactions.rb} +17 -20
  46. data/lib/selenium/webdriver/common/interactions/key_actions.rb +145 -0
  47. data/lib/selenium/webdriver/common/interactions/key_input.rb +66 -0
  48. data/lib/selenium/webdriver/common/interactions/none_input.rb +36 -0
  49. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +363 -0
  50. data/lib/selenium/webdriver/common/interactions/pointer_input.rb +139 -0
  51. data/lib/selenium/webdriver/common/keys.rb +37 -15
  52. data/lib/selenium/webdriver/common/log_entry.rb +4 -4
  53. data/lib/selenium/webdriver/common/logger.rb +147 -0
  54. data/lib/selenium/webdriver/common/logs.rb +2 -2
  55. data/lib/selenium/webdriver/common/manager.rb +177 -0
  56. data/lib/selenium/webdriver/common/navigation.rb +2 -2
  57. data/lib/selenium/webdriver/common/options.rb +47 -105
  58. data/lib/selenium/webdriver/common/platform.rb +44 -38
  59. data/lib/selenium/webdriver/common/port_prober.rb +8 -19
  60. data/lib/selenium/webdriver/common/profile_helper.rb +13 -5
  61. data/lib/selenium/webdriver/common/proxy.rb +14 -8
  62. data/lib/selenium/webdriver/common/search_context.rb +16 -20
  63. data/lib/selenium/webdriver/common/service.rb +115 -30
  64. data/lib/selenium/webdriver/common/socket_lock.rb +12 -7
  65. data/lib/selenium/webdriver/common/socket_poller.rb +29 -22
  66. data/lib/selenium/webdriver/common/target_locator.rb +6 -6
  67. data/lib/selenium/webdriver/common/timeouts.rb +2 -2
  68. data/lib/selenium/webdriver/common/wait.rb +14 -8
  69. data/lib/selenium/webdriver/common/window.rb +38 -2
  70. data/lib/selenium/webdriver/common/zipper.rb +3 -5
  71. data/lib/selenium/webdriver/edge.rb +33 -20
  72. data/lib/selenium/webdriver/edge_chrome/bridge.rb +30 -0
  73. data/lib/selenium/webdriver/edge_chrome/driver.rb +38 -0
  74. data/lib/selenium/webdriver/{common/driver_extensions/has_touch_screen.rb → edge_chrome/options.rb} +10 -12
  75. data/lib/selenium/webdriver/edge_chrome/profile.rb +33 -0
  76. data/lib/selenium/webdriver/edge_chrome/service.rb +36 -0
  77. data/lib/selenium/webdriver/edge_html/driver.rb +39 -0
  78. data/lib/selenium/webdriver/edge_html/options.rb +91 -0
  79. data/lib/selenium/webdriver/edge_html/service.rb +47 -0
  80. data/lib/selenium/webdriver/firefox.rb +24 -29
  81. data/lib/selenium/webdriver/firefox/bridge.rb +15 -39
  82. data/lib/selenium/webdriver/firefox/{util.rb → driver.rb} +13 -19
  83. data/lib/selenium/webdriver/firefox/extension.rb +28 -8
  84. data/lib/selenium/webdriver/firefox/options.rb +162 -0
  85. data/lib/selenium/webdriver/firefox/profile.rb +23 -82
  86. data/lib/selenium/webdriver/firefox/profiles_ini.rb +5 -5
  87. data/lib/selenium/webdriver/firefox/service.rb +18 -37
  88. data/lib/selenium/webdriver/ie.rb +13 -19
  89. data/lib/selenium/webdriver/ie/driver.rb +40 -0
  90. data/lib/selenium/webdriver/ie/options.rb +118 -0
  91. data/lib/selenium/webdriver/ie/service.rb +20 -20
  92. data/lib/selenium/webdriver/remote.rb +15 -17
  93. data/lib/selenium/webdriver/remote/bridge.rb +281 -300
  94. data/lib/selenium/webdriver/remote/capabilities.rb +102 -83
  95. data/lib/selenium/webdriver/remote/commands.rb +132 -192
  96. data/lib/selenium/webdriver/remote/driver.rb +52 -0
  97. data/lib/selenium/webdriver/remote/http/common.rb +23 -13
  98. data/lib/selenium/webdriver/remote/http/curb.rb +10 -7
  99. data/lib/selenium/webdriver/remote/http/default.rb +52 -32
  100. data/lib/selenium/webdriver/remote/http/persistent.rb +8 -4
  101. data/lib/selenium/webdriver/remote/response.rb +32 -35
  102. data/lib/selenium/webdriver/remote/server_error.rb +2 -2
  103. data/lib/selenium/webdriver/safari.rb +24 -22
  104. data/lib/selenium/webdriver/safari/bridge.rb +21 -21
  105. data/lib/selenium/webdriver/safari/driver.rb +41 -0
  106. data/lib/selenium/webdriver/safari/options.rb +66 -0
  107. data/lib/selenium/webdriver/safari/service.rb +8 -24
  108. data/lib/selenium/webdriver/support.rb +3 -2
  109. data/lib/selenium/webdriver/support/abstract_event_listener.rb +2 -2
  110. data/lib/selenium/webdriver/support/block_event_listener.rb +3 -3
  111. data/lib/selenium/webdriver/support/color.rb +13 -13
  112. data/lib/selenium/webdriver/support/escaper.rb +2 -2
  113. data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
  114. data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
  115. data/lib/selenium/webdriver/support/select.rb +20 -21
  116. data/lib/selenium/webdriver/version.rb +24 -0
  117. data/selenium-webdriver.gemspec +31 -17
  118. metadata +331 -248
  119. data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
  120. data/lib/selenium/webdriver/common/keyboard.rb +0 -69
  121. data/lib/selenium/webdriver/common/mouse.rb +0 -88
  122. data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -81
  123. data/lib/selenium/webdriver/common/touch_screen.rb +0 -121
  124. data/lib/selenium/webdriver/common/w3c_error.rb +0 -191
  125. data/lib/selenium/webdriver/edge/bridge.rb +0 -76
  126. data/lib/selenium/webdriver/edge/legacy_support.rb +0 -117
  127. data/lib/selenium/webdriver/firefox/binary.rb +0 -186
  128. data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
  129. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  130. data/lib/selenium/webdriver/firefox/launcher.rb +0 -114
  131. data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
  132. data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
  133. data/lib/selenium/webdriver/firefox/w3c_bridge.rb +0 -79
  134. data/lib/selenium/webdriver/ie/bridge.rb +0 -76
  135. data/lib/selenium/webdriver/phantomjs/bridge.rb +0 -65
  136. data/lib/selenium/webdriver/phantomjs/service.rb +0 -66
  137. data/lib/selenium/webdriver/remote/w3c_bridge.rb +0 -682
  138. data/lib/selenium/webdriver/remote/w3c_capabilities.rb +0 -228
  139. data/lib/selenium/webdriver/remote/w3c_commands.rb +0 -135
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -47,16 +47,21 @@ module Selenium
47
47
  private
48
48
 
49
49
  def lock
50
- max_time = Time.now + @timeout
50
+ max_time = current_time + @timeout
51
51
 
52
- sleep 0.1 until can_lock? || Time.now >= max_time
52
+ sleep 0.1 until can_lock? || current_time >= max_time
53
53
 
54
54
  return if did_lock?
55
+
55
56
  raise Error::WebDriverError, "unable to bind to locking port #{@port} within #{@timeout} seconds"
56
57
  end
57
58
 
59
+ def current_time
60
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
61
+ end
62
+
58
63
  def release
59
- @server && @server.close
64
+ @server&.close
60
65
  end
61
66
 
62
67
  def can_lock?
@@ -64,8 +69,8 @@ module Selenium
64
69
  ChildProcess.close_on_exec @server
65
70
 
66
71
  true
67
- rescue SocketError, Errno::EADDRINUSE, Errno::EBADF => ex
68
- $stderr.puts "#{self}: #{ex.message}" if $DEBUG
72
+ rescue SocketError, Errno::EADDRINUSE, Errno::EBADF => e
73
+ WebDriver.logger.debug("#{self}: #{e.message}")
69
74
  false
70
75
  end
71
76
 
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -56,15 +56,18 @@ module Selenium
56
56
 
57
57
  CONNECT_TIMEOUT = 5
58
58
 
59
- NOT_CONNECTED_ERRORS = [Errno::ECONNREFUSED, Errno::ENOTCONN, SocketError]
60
- NOT_CONNECTED_ERRORS << Errno::EPERM if Platform.cygwin?
59
+ NOT_CONNECTED_ERRORS = [Errno::ECONNREFUSED, Errno::ENOTCONN, SocketError].tap { |arr|
60
+ arr << Errno::EPERM if Platform.cygwin?
61
+ }.freeze
61
62
 
62
- CONNECTED_ERRORS = [Errno::EISCONN]
63
- CONNECTED_ERRORS << Errno::EINVAL if Platform.windows?
63
+ CONNECTED_ERRORS = [Errno::EISCONN].tap { |arr|
64
+ arr << Errno::EINVAL if Platform.windows?
65
+ arr << Errno::EALREADY if Platform.wsl?
66
+ }.freeze
64
67
 
65
68
  if Platform.jruby?
66
- # we use a plain TCPSocket here since JRuby has issues select()ing on a connecting socket
67
- # see http://jira.codehaus.org/browse/JRUBY-5165
69
+ # we use a plain TCPSocket here since JRuby has issues closing socket
70
+ # see https://github.com/jruby/jruby/issues/5709
68
71
  def listening?
69
72
  TCPSocket.new(@host, @port).close
70
73
  true
@@ -80,7 +83,7 @@ module Selenium
80
83
  begin
81
84
  sock.connect_nonblock sockaddr
82
85
  rescue Errno::EINPROGRESS
83
- retry if IO.select(nil, [sock], nil, CONNECT_TIMEOUT)
86
+ retry if socket_writable?(sock) && conn_completed?(sock)
84
87
  raise Errno::ECONNREFUSED
85
88
  rescue *CONNECTED_ERRORS
86
89
  # yay!
@@ -89,30 +92,34 @@ module Selenium
89
92
  sock.close
90
93
  true
91
94
  rescue *NOT_CONNECTED_ERRORS
92
- sock.close if sock
93
- $stderr.puts [@host, @port].inspect if $DEBUG
95
+ sock&.close
96
+ WebDriver.logger.debug("polling for socket on #{[@host, @port].inspect}")
94
97
  false
95
98
  end
96
99
  end
97
100
 
101
+ def socket_writable?(sock)
102
+ IO.select(nil, [sock], nil, CONNECT_TIMEOUT)
103
+ end
104
+
105
+ def conn_completed?(sock)
106
+ sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR).int.zero?
107
+ end
108
+
98
109
  def with_timeout
99
- max_time = time_now + @timeout
110
+ max_time = current_time + @timeout
100
111
 
101
- (
112
+ until current_time > max_time
102
113
  return true if yield
103
- wait
104
- ) until time_now > max_time
105
114
 
106
- false
107
- end
115
+ sleep @interval
116
+ end
108
117
 
109
- def wait
110
- sleep @interval
118
+ false
111
119
  end
112
120
 
113
- # for testability
114
- def time_now
115
- Time.now
121
+ def current_time
122
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
116
123
  end
117
124
  end # SocketPoller
118
125
  end # WebDriver
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -57,10 +57,10 @@ module Selenium
57
57
  def window(id)
58
58
  if block_given?
59
59
  original = begin
60
- @bridge.window_handle
61
- rescue Error::NoSuchWindowError
62
- nil
63
- end
60
+ @bridge.window_handle
61
+ rescue Error::NoSuchWindowError
62
+ nil
63
+ end
64
64
 
65
65
  unless @bridge.window_handles.include? id
66
66
  raise Error::NoSuchWindowError, "The specified identifier '#{id}' is not found in the window handle list"
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -43,19 +43,19 @@ module Selenium
43
43
  #
44
44
  # Wait until the given block returns a true value.
45
45
  #
46
- # @raise [Error::TimeOutError]
46
+ # @raise [Error::TimeoutError]
47
47
  # @return [Object] the result of the block
48
48
  #
49
49
 
50
50
  def until
51
- end_time = Time.now + @timeout
51
+ end_time = current_time + @timeout
52
52
  last_error = nil
53
53
 
54
- until Time.now > end_time
54
+ until current_time > end_time
55
55
  begin
56
56
  result = yield
57
57
  return result if result
58
- rescue *@ignored => last_error
58
+ rescue *@ignored => last_error # rubocop:disable Naming/RescuedExceptionsVariableName
59
59
  # swallowed
60
60
  end
61
61
 
@@ -65,12 +65,18 @@ module Selenium
65
65
  msg = if @message
66
66
  @message.dup
67
67
  else
68
- "timed out after #{@timeout} seconds"
68
+ +"timed out after #{@timeout} seconds"
69
69
  end
70
70
 
71
71
  msg << " (#{last_error.message})" if last_error
72
72
 
73
- raise Error::TimeOutError, msg
73
+ raise Error::TimeoutError, msg
74
+ end
75
+
76
+ private
77
+
78
+ def current_time
79
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
74
80
  end
75
81
  end # Wait
76
82
  end # WebDriver
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -82,6 +82,34 @@ module Selenium
82
82
  @bridge.window_position
83
83
  end
84
84
 
85
+ #
86
+ # Sets the current window rect to the given point and position.
87
+ #
88
+ # @param [Selenium::WebDriver::Rectangle, #x, #y, #width, #height] rectangle The new rect.
89
+ #
90
+
91
+ def rect=(rectangle)
92
+ unless %w[x y width height].all? { |val| rectangle.respond_to? val }
93
+ raise ArgumentError, "expected #{rectangle.inspect}:#{rectangle.class}" \
94
+ ' to respond to #x, #y, #width, and #height'
95
+ end
96
+
97
+ @bridge.set_window_rect(x: rectangle.x,
98
+ y: rectangle.y,
99
+ width: rectangle.width,
100
+ height: rectangle.height)
101
+ end
102
+
103
+ #
104
+ # Get the rect of the current window.
105
+ #
106
+ # @return [Selenium::WebDriver::Rectangle] The rectangle.
107
+ #
108
+
109
+ def rect
110
+ @bridge.window_rect
111
+ end
112
+
85
113
  #
86
114
  # Equivalent to #size=, but accepts width and height arguments.
87
115
  #
@@ -115,6 +143,14 @@ module Selenium
115
143
  @bridge.maximize_window
116
144
  end
117
145
 
146
+ #
147
+ # Minimize the current window
148
+ #
149
+
150
+ def minimize
151
+ @bridge.minimize_window
152
+ end
153
+
118
154
  #
119
155
  # Make current window full screen
120
156
  #
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -52,9 +52,7 @@ module Selenium
52
52
  def zip(path)
53
53
  with_tmp_zip do |zip|
54
54
  ::Find.find(path) do |file|
55
- unless File.directory?(file)
56
- add_zip_entry zip, file, file.sub("#{path}/", '')
57
- end
55
+ add_zip_entry zip, file, file.sub("#{path}/", '') unless File.directory?(file)
58
56
  end
59
57
 
60
58
  zip.commit
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -19,32 +19,45 @@
19
19
 
20
20
  require 'net/http'
21
21
 
22
- require 'selenium/webdriver/edge/service'
23
- require 'selenium/webdriver/edge/bridge'
24
-
25
22
  module Selenium
26
23
  module WebDriver
27
- module Edge
28
- MISSING_TEXT = <<-ERROR.tr("\n", '').freeze
29
- Unable to find MicrosoftWebDriver. Please download the server from
30
- https://www.microsoft.com/en-us/download/details.aspx?id=48212 and place it
31
- somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/MicrosoftWebDriver.
32
- ERROR
24
+ module EdgeHtml
25
+ autoload :Driver, 'selenium/webdriver/edge_html/driver'
26
+ autoload :Options, 'selenium/webdriver/edge_html/options'
27
+ autoload :Service, 'selenium/webdriver/edge_html/service'
33
28
 
34
29
  def self.driver_path=(path)
35
- Platform.assert_executable path
36
- @driver_path = path
30
+ WebDriver.logger.deprecate 'Selenium::WebDriver::Edge#driver_path=',
31
+ 'Selenium::WebDriver::Edge::Service#driver_path=',
32
+ id: :driver_path
33
+ Selenium::WebDriver::Edge::Service.driver_path = path
37
34
  end
38
35
 
39
36
  def self.driver_path
40
- @driver_path ||= begin
41
- path = Platform.find_binary('MicrosoftWebDriver')
42
- raise Error::WebDriverError, MISSING_TEXT unless path
43
- Platform.assert_executable path
37
+ WebDriver.logger.deprecate 'Selenium::WebDriver::Edge#driver_path',
38
+ 'Selenium::WebDriver::Edge::Service#driver_path',
39
+ id: :driver_path
40
+ Selenium::WebDriver::Edge::Service.driver_path
41
+ end
42
+ end # EdgeHtml
44
43
 
45
- path
46
- end
44
+ module EdgeChrome
45
+ autoload :Bridge, 'selenium/webdriver/edge_chrome/bridge'
46
+ autoload :Driver, 'selenium/webdriver/edge_chrome/driver'
47
+ autoload :Profile, 'selenium/webdriver/edge_chrome/profile'
48
+ autoload :Options, 'selenium/webdriver/edge_chrome/options'
49
+ autoload :Service, 'selenium/webdriver/edge_chrome/service'
50
+
51
+ def self.path=(path)
52
+ Platform.assert_executable path
53
+ @path = path
47
54
  end
48
- end # Edge
55
+
56
+ def self.path
57
+ @path ||= nil
58
+ end
59
+ end # EdgeChrome
60
+
61
+ Edge = EdgeHtml # Alias EdgeHtml as Edge for now
49
62
  end # WebDriver
50
63
  end # Selenium
@@ -0,0 +1,30 @@
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
+ require 'selenium/webdriver/chrome/bridge'
21
+
22
+ module Selenium
23
+ module WebDriver
24
+ module EdgeChrome
25
+ module Bridge
26
+ include Selenium::WebDriver::Chrome::Bridge
27
+ end # Bridge
28
+ end # EdgeChrome
29
+ end # WebDriver
30
+ end # Selenium
@@ -0,0 +1,38 @@
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
+ require 'selenium/webdriver/chrome/driver'
21
+
22
+ module Selenium
23
+ module WebDriver
24
+ module EdgeChrome
25
+
26
+ #
27
+ # Driver implementation for EdgeChrome.
28
+ # @api private
29
+ #
30
+
31
+ class Driver < Selenium::WebDriver::Chrome::Driver
32
+ def browser
33
+ :edge_chrome
34
+ end
35
+ end # Driver
36
+ end # EdgeChrome
37
+ end # WebDriver
38
+ end # Selenium
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
- #
1
+ # frozen_string_literal: true
2
+
3
3
  # Licensed to the Software Freedom Conservancy (SFC) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -17,20 +17,18 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
+ require 'selenium/webdriver/chrome/options'
21
+
20
22
  module Selenium
21
23
  module WebDriver
22
- module DriverExtensions
23
- module HasTouchScreen
24
- def touch
25
- TouchActionBuilder.new mouse, keyboard, touch_screen
26
- end
27
-
24
+ module EdgeChrome
25
+ class Options < Selenium::WebDriver::Chrome::Options
28
26
  private
29
27
 
30
- def touch_screen
31
- TouchScreen.new @bridge
28
+ def binary_path
29
+ EdgeChrome.path
32
30
  end
33
- end # HasTouchScreen
34
- end # DriverExtensions
31
+ end # Options
32
+ end # EdgeChrome
35
33
  end # WebDriver
36
34
  end # Selenium