selenium-webdriver 4.0.0.alpha6 → 4.0.0.beta4

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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +137 -4
  3. data/Gemfile +3 -1
  4. data/LICENSE +1 -1
  5. data/NOTICE +2 -0
  6. data/README.md +4 -5
  7. data/lib/selenium/server.rb +18 -26
  8. data/lib/selenium/webdriver.rb +1 -4
  9. data/lib/selenium/webdriver/atoms/findElements.js +93 -93
  10. data/lib/selenium/webdriver/atoms/getAttribute.js +75 -59
  11. data/lib/selenium/webdriver/atoms/isDisplayed.js +72 -72
  12. data/lib/selenium/webdriver/atoms/mutationListener.js +55 -0
  13. data/lib/selenium/webdriver/chrome.rb +1 -1
  14. data/lib/selenium/webdriver/chrome/driver.rb +25 -10
  15. data/lib/selenium/webdriver/chrome/{bridge.rb → features.rb} +3 -3
  16. data/lib/selenium/webdriver/chrome/options.rb +51 -39
  17. data/lib/selenium/webdriver/chrome/profile.rb +6 -3
  18. data/lib/selenium/webdriver/chrome/service.rb +4 -2
  19. data/lib/selenium/webdriver/common.rb +8 -2
  20. data/lib/selenium/webdriver/common/driver.rb +36 -8
  21. data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +43 -0
  22. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +89 -0
  23. data/lib/selenium/webdriver/{edge_html/driver.rb → common/driver_extensions/has_cdp.rb} +12 -13
  24. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +6 -1
  25. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +5 -8
  26. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +149 -0
  27. data/lib/selenium/webdriver/common/driver_extensions/has_logs.rb +30 -0
  28. data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +6 -27
  29. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +67 -0
  30. data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +1 -0
  31. data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
  32. data/lib/selenium/webdriver/common/element.rb +66 -12
  33. data/lib/selenium/webdriver/common/interactions/interaction.rb +4 -1
  34. data/lib/selenium/webdriver/common/logger.rb +5 -2
  35. data/lib/selenium/webdriver/common/manager.rb +6 -1
  36. data/lib/selenium/webdriver/common/options.rb +76 -14
  37. data/lib/selenium/webdriver/common/platform.rb +3 -1
  38. data/lib/selenium/webdriver/common/proxy.rb +6 -3
  39. data/lib/selenium/webdriver/common/search_context.rb +4 -1
  40. data/lib/selenium/webdriver/common/service.rb +1 -8
  41. data/lib/selenium/webdriver/common/service_manager.rb +1 -1
  42. data/lib/selenium/webdriver/common/socket_poller.rb +19 -30
  43. data/lib/selenium/webdriver/common/takes_screenshot.rb +66 -0
  44. data/lib/selenium/webdriver/common/target_locator.rb +4 -4
  45. data/lib/selenium/webdriver/devtools.rb +44 -18
  46. data/lib/selenium/webdriver/devtools/console_event.rb +38 -0
  47. data/lib/selenium/webdriver/devtools/exception_event.rb +36 -0
  48. data/lib/selenium/webdriver/devtools/mutation_event.rb +37 -0
  49. data/lib/selenium/webdriver/devtools/{console.rb → request.rb} +22 -22
  50. data/lib/selenium/webdriver/edge.rb +7 -29
  51. data/lib/selenium/webdriver/{edge_chrome → edge}/driver.rb +8 -6
  52. data/lib/selenium/webdriver/{edge_chrome/bridge.rb → edge/features.rb} +9 -7
  53. data/lib/selenium/webdriver/{edge_chrome → edge}/options.rb +11 -4
  54. data/lib/selenium/webdriver/{edge_chrome → edge}/profile.rb +2 -2
  55. data/lib/selenium/webdriver/{edge_chrome → edge}/service.rb +2 -2
  56. data/lib/selenium/webdriver/firefox.rb +5 -1
  57. data/lib/selenium/webdriver/firefox/driver.rb +18 -5
  58. data/lib/selenium/webdriver/firefox/{bridge.rb → features.rb} +9 -4
  59. data/lib/selenium/webdriver/firefox/options.rb +20 -21
  60. data/lib/selenium/webdriver/firefox/profile.rb +12 -2
  61. data/lib/selenium/webdriver/firefox/service.rb +1 -1
  62. data/lib/selenium/webdriver/ie/driver.rb +1 -2
  63. data/lib/selenium/webdriver/ie/options.rb +1 -11
  64. data/lib/selenium/webdriver/ie/service.rb +4 -2
  65. data/lib/selenium/webdriver/remote/bridge.rb +48 -30
  66. data/lib/selenium/webdriver/remote/capabilities.rb +105 -64
  67. data/lib/selenium/webdriver/remote/commands.rb +3 -0
  68. data/lib/selenium/webdriver/remote/driver.rb +10 -3
  69. data/lib/selenium/webdriver/remote/http/common.rb +0 -5
  70. data/lib/selenium/webdriver/remote/http/default.rb +8 -7
  71. data/lib/selenium/webdriver/remote/http/persistent.rb +6 -0
  72. data/lib/selenium/webdriver/safari.rb +8 -1
  73. data/lib/selenium/webdriver/safari/driver.rb +3 -8
  74. data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +3 -3
  75. data/lib/selenium/webdriver/safari/options.rb +0 -25
  76. data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
  77. data/lib/selenium/webdriver/support/cdp/domain.rb.erb +63 -0
  78. data/lib/selenium/webdriver/support/cdp_client_generator.rb +44 -13
  79. data/lib/selenium/webdriver/support/event_firing_bridge.rb +1 -1
  80. data/lib/selenium/webdriver/support/guards.rb +95 -0
  81. data/lib/selenium/webdriver/support/guards/guard.rb +89 -0
  82. data/lib/selenium/webdriver/support/guards/guard_condition.rb +52 -0
  83. data/lib/selenium/webdriver/support/select.rb +2 -2
  84. data/lib/selenium/webdriver/version.rb +1 -1
  85. data/selenium-webdriver.gemspec +26 -12
  86. metadata +91 -108
  87. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +0 -65
  88. data/lib/selenium/webdriver/devtools/accessibility.rb +0 -62
  89. data/lib/selenium/webdriver/devtools/animation.rb +0 -98
  90. data/lib/selenium/webdriver/devtools/application_cache.rb +0 -64
  91. data/lib/selenium/webdriver/devtools/audits.rb +0 -61
  92. data/lib/selenium/webdriver/devtools/background_service.rb +0 -67
  93. data/lib/selenium/webdriver/devtools/browser.rb +0 -123
  94. data/lib/selenium/webdriver/devtools/cache_storage.rb +0 -73
  95. data/lib/selenium/webdriver/devtools/cast.rb +0 -70
  96. data/lib/selenium/webdriver/devtools/css.rb +0 -165
  97. data/lib/selenium/webdriver/devtools/database.rb +0 -64
  98. data/lib/selenium/webdriver/devtools/debugger.rb +0 -229
  99. data/lib/selenium/webdriver/devtools/device_orientation.rb +0 -53
  100. data/lib/selenium/webdriver/devtools/dom.rb +0 -320
  101. data/lib/selenium/webdriver/devtools/domdebugger.rb +0 -93
  102. data/lib/selenium/webdriver/devtools/domsnapshot.rb +0 -65
  103. data/lib/selenium/webdriver/devtools/domstorage.rb +0 -79
  104. data/lib/selenium/webdriver/devtools/emulation.rb +0 -180
  105. data/lib/selenium/webdriver/devtools/fetch.rb +0 -97
  106. data/lib/selenium/webdriver/devtools/headless_experimental.rb +0 -61
  107. data/lib/selenium/webdriver/devtools/heap_profiler.rb +0 -107
  108. data/lib/selenium/webdriver/devtools/indexed_db.rb +0 -100
  109. data/lib/selenium/webdriver/devtools/input.rb +0 -140
  110. data/lib/selenium/webdriver/devtools/inspector.rb +0 -55
  111. data/lib/selenium/webdriver/devtools/io.rb +0 -59
  112. data/lib/selenium/webdriver/devtools/layer_tree.rb +0 -95
  113. data/lib/selenium/webdriver/devtools/log.rb +0 -66
  114. data/lib/selenium/webdriver/devtools/media.rb +0 -57
  115. data/lib/selenium/webdriver/devtools/memory.rb +0 -86
  116. data/lib/selenium/webdriver/devtools/network.rb +0 -228
  117. data/lib/selenium/webdriver/devtools/overlay.rb +0 -157
  118. data/lib/selenium/webdriver/devtools/page.rb +0 -374
  119. data/lib/selenium/webdriver/devtools/performance.rb +0 -63
  120. data/lib/selenium/webdriver/devtools/profiler.rb +0 -111
  121. data/lib/selenium/webdriver/devtools/runtime.rb +0 -193
  122. data/lib/selenium/webdriver/devtools/schema.rb +0 -46
  123. data/lib/selenium/webdriver/devtools/security.rb +0 -71
  124. data/lib/selenium/webdriver/devtools/service_worker.rb +0 -116
  125. data/lib/selenium/webdriver/devtools/storage.rb +0 -95
  126. data/lib/selenium/webdriver/devtools/system_info.rb +0 -50
  127. data/lib/selenium/webdriver/devtools/target.rb +0 -141
  128. data/lib/selenium/webdriver/devtools/tethering.rb +0 -55
  129. data/lib/selenium/webdriver/devtools/tracing.rb +0 -76
  130. data/lib/selenium/webdriver/devtools/web_audio.rb +0 -70
  131. data/lib/selenium/webdriver/devtools/web_authn.rb +0 -94
  132. data/lib/selenium/webdriver/edge_html/options.rb +0 -84
  133. data/lib/selenium/webdriver/edge_html/service.rb +0 -47
@@ -1,76 +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
- # This file is automatically generated. Any changes will be lost!
21
- module Selenium
22
- module WebDriver
23
- class DevTools
24
- def tracing
25
- @tracing ||= Tracing.new(self)
26
- end
27
-
28
- class Tracing
29
- EVENTS = {
30
- buffer_usage: 'bufferUsage',
31
- data_collected: 'dataCollected',
32
- tracing_complete: 'tracingComplete',
33
- }
34
-
35
- def initialize(devtools)
36
- @devtools = devtools
37
- end
38
-
39
- def on(event, &block)
40
- event = EVENTS[event] if event.is_a?(Symbol)
41
- @devtools.callbacks["Tracing.#{event}"] << block
42
- end
43
-
44
- def _end
45
- @devtools.send_cmd('Tracing.end')
46
- end
47
-
48
- def get_categories
49
- @devtools.send_cmd('Tracing.getCategories')
50
- end
51
-
52
- def record_clock_sync_marker(sync_id:)
53
- @devtools.send_cmd('Tracing.recordClockSyncMarker',
54
- syncId: sync_id)
55
- end
56
-
57
- def request_memory_dump(deterministic: nil)
58
- @devtools.send_cmd('Tracing.requestMemoryDump',
59
- deterministic: deterministic)
60
- end
61
-
62
- def start(categories: nil, options: nil, buffer_usage_reporting_interval: nil, transfer_mode: nil, stream_format: nil, stream_compression: nil, trace_config: nil)
63
- @devtools.send_cmd('Tracing.start',
64
- categories: categories,
65
- options: options,
66
- bufferUsageReportingInterval: buffer_usage_reporting_interval,
67
- transferMode: transfer_mode,
68
- streamFormat: stream_format,
69
- streamCompression: stream_compression,
70
- traceConfig: trace_config)
71
- end
72
-
73
- end # Tracing
74
- end # DevTools
75
- end # WebDriver
76
- end # Selenium
@@ -1,70 +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
- # This file is automatically generated. Any changes will be lost!
21
- module Selenium
22
- module WebDriver
23
- class DevTools
24
- def web_audio
25
- @web_audio ||= WebAudio.new(self)
26
- end
27
-
28
- class WebAudio
29
- EVENTS = {
30
- context_created: 'contextCreated',
31
- context_will_be_destroyed: 'contextWillBeDestroyed',
32
- context_changed: 'contextChanged',
33
- audio_listener_created: 'audioListenerCreated',
34
- audio_listener_will_be_destroyed: 'audioListenerWillBeDestroyed',
35
- audio_node_created: 'audioNodeCreated',
36
- audio_node_will_be_destroyed: 'audioNodeWillBeDestroyed',
37
- audio_param_created: 'audioParamCreated',
38
- audio_param_will_be_destroyed: 'audioParamWillBeDestroyed',
39
- nodes_connected: 'nodesConnected',
40
- nodes_disconnected: 'nodesDisconnected',
41
- node_param_connected: 'nodeParamConnected',
42
- node_param_disconnected: 'nodeParamDisconnected',
43
- }
44
-
45
- def initialize(devtools)
46
- @devtools = devtools
47
- end
48
-
49
- def on(event, &block)
50
- event = EVENTS[event] if event.is_a?(Symbol)
51
- @devtools.callbacks["WebAudio.#{event}"] << block
52
- end
53
-
54
- def enable
55
- @devtools.send_cmd('WebAudio.enable')
56
- end
57
-
58
- def disable
59
- @devtools.send_cmd('WebAudio.disable')
60
- end
61
-
62
- def get_realtime_data(context_id:)
63
- @devtools.send_cmd('WebAudio.getRealtimeData',
64
- contextId: context_id)
65
- end
66
-
67
- end # WebAudio
68
- end # DevTools
69
- end # WebDriver
70
- end # Selenium
@@ -1,94 +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
- # This file is automatically generated. Any changes will be lost!
21
- module Selenium
22
- module WebDriver
23
- class DevTools
24
- def web_authn
25
- @web_authn ||= WebAuthn.new(self)
26
- end
27
-
28
- class WebAuthn
29
-
30
- def initialize(devtools)
31
- @devtools = devtools
32
- end
33
-
34
- def on(event, &block)
35
- event = EVENTS[event] if event.is_a?(Symbol)
36
- @devtools.callbacks["WebAuthn.#{event}"] << block
37
- end
38
-
39
- def enable
40
- @devtools.send_cmd('WebAuthn.enable')
41
- end
42
-
43
- def disable
44
- @devtools.send_cmd('WebAuthn.disable')
45
- end
46
-
47
- def add_virtual_authenticator(options:)
48
- @devtools.send_cmd('WebAuthn.addVirtualAuthenticator',
49
- options: options)
50
- end
51
-
52
- def remove_virtual_authenticator(authenticator_id:)
53
- @devtools.send_cmd('WebAuthn.removeVirtualAuthenticator',
54
- authenticatorId: authenticator_id)
55
- end
56
-
57
- def add_credential(authenticator_id:, credential:)
58
- @devtools.send_cmd('WebAuthn.addCredential',
59
- authenticatorId: authenticator_id,
60
- credential: credential)
61
- end
62
-
63
- def get_credential(authenticator_id:, credential_id:)
64
- @devtools.send_cmd('WebAuthn.getCredential',
65
- authenticatorId: authenticator_id,
66
- credentialId: credential_id)
67
- end
68
-
69
- def get_credentials(authenticator_id:)
70
- @devtools.send_cmd('WebAuthn.getCredentials',
71
- authenticatorId: authenticator_id)
72
- end
73
-
74
- def remove_credential(authenticator_id:, credential_id:)
75
- @devtools.send_cmd('WebAuthn.removeCredential',
76
- authenticatorId: authenticator_id,
77
- credentialId: credential_id)
78
- end
79
-
80
- def clear_credentials(authenticator_id:)
81
- @devtools.send_cmd('WebAuthn.clearCredentials',
82
- authenticatorId: authenticator_id)
83
- end
84
-
85
- def set_user_verified(authenticator_id:, is_user_verified:)
86
- @devtools.send_cmd('WebAuthn.setUserVerified',
87
- authenticatorId: authenticator_id,
88
- isUserVerified: is_user_verified)
89
- end
90
-
91
- end # WebAuthn
92
- end # DevTools
93
- end # WebDriver
94
- end # Selenium
@@ -1,84 +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 EdgeHtml
23
- class Options < WebDriver::Options
24
- # see https://docs.microsoft.com/en-us/microsoft-edge/webdriver#capabilities
25
- CAPABILITIES = {in_private: 'ms:inPrivate',
26
- extension_paths: 'ms:extensionPaths',
27
- start_page: 'ms:startPage'}.freeze
28
- BROWSER = 'MicrosoftEdge'
29
-
30
- CAPABILITIES.each_key do |key|
31
- define_method key do
32
- @options[key]
33
- end
34
-
35
- define_method "#{key}=" do |value|
36
- @options[key] = value
37
- end
38
- end
39
-
40
- #
41
- # Create a new Options instance for Edge.
42
- #
43
- # @example
44
- # options = Selenium::WebDriver::Edge::Options.new(in_private: true)
45
- # driver = Selenium::WebDriver.for :edge, options: options
46
- #
47
- # @param [Hash] opts the pre-defined options to create the Edge::Options with
48
- # @option opts [Boolean] :in_private Start in private mode. Default is false
49
- # @option opts [Array<String>] :extension_paths A list of full paths to extensions to install on startup
50
- # @option opts [String] :start_page Default page to start with
51
- #
52
- # @see https://docs.microsoft.com/en-us/microsoft-edge/webdriver
53
- #
54
-
55
- def initialize(**opts)
56
- super(**opts)
57
- @options[:extensions]&.each(&method(:validate_extension))
58
- end
59
-
60
- #
61
- # Add an extension by local path.
62
- #
63
- # @example
64
- # options = Selenium::WebDriver::Edge::Options.new
65
- # options.add_extension_path('C:\path\to\extension')
66
- #
67
- # @param [String] path The local path to the extension folder
68
- #
69
-
70
- def add_extension_path(path)
71
- validate_extension(path)
72
- @options[:extension_paths] ||= []
73
- @options[:extension_paths] << path
74
- end
75
-
76
- private
77
-
78
- def validate_extension(path)
79
- raise Error::WebDriverError, "could not find extension at #{path.inspect}" unless File.directory?(path)
80
- end
81
- end # Options
82
- end # EdgeHtml
83
- end # WebDriver
84
- 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 EdgeHtml
23
- class Service < WebDriver::Service
24
- DEFAULT_PORT = 17556
25
- EXECUTABLE = 'MicrosoftWebDriver'
26
- MISSING_TEXT = <<~ERROR
27
- Unable to find MicrosoftWebDriver. Please install it following instructions
28
- at https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/.
29
- ERROR
30
- SHUTDOWN_SUPPORTED = false
31
-
32
- private
33
-
34
- # Note: This processing is deprecated
35
- def extract_service_args(driver_opts)
36
- driver_args = super
37
- driver_opts = driver_opts.dup
38
- driver_args << "--host=#{driver_opts[:host]}" if driver_opts.key? :host
39
- driver_args << "--package=#{driver_opts[:package]}" if driver_opts.key? :package
40
- driver_args << "--silent" if driver_opts[:silent] == true
41
- driver_args << "--verbose" if driver_opts[:verbose] == true
42
- driver_args
43
- end
44
- end # Service
45
- end # EdgeHtml
46
- end # WebDriver
47
- end # Service