selenium-webdriver 4.0.0.alpha5 → 4.0.0.alpha6

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +38 -0
  3. data/LICENSE +1 -1
  4. data/lib/selenium/webdriver/atoms/findElements.js +1 -1
  5. data/lib/selenium/webdriver/chrome/bridge.rb +4 -6
  6. data/lib/selenium/webdriver/chrome/driver.rb +4 -0
  7. data/lib/selenium/webdriver/chrome/options.rb +24 -19
  8. data/lib/selenium/webdriver/common.rb +1 -0
  9. data/lib/selenium/webdriver/common/driver.rb +55 -23
  10. data/lib/selenium/webdriver/common/logger.rb +1 -1
  11. data/lib/selenium/webdriver/common/manager.rb +5 -0
  12. data/lib/selenium/webdriver/common/options.rb +32 -9
  13. data/lib/selenium/webdriver/common/port_prober.rb +4 -6
  14. data/lib/selenium/webdriver/common/service.rb +12 -106
  15. data/lib/selenium/webdriver/common/service_manager.rb +151 -0
  16. data/lib/selenium/webdriver/devtools.rb +118 -0
  17. data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
  18. data/lib/selenium/webdriver/devtools/animation.rb +98 -0
  19. data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
  20. data/lib/selenium/webdriver/devtools/audits.rb +61 -0
  21. data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
  22. data/lib/selenium/webdriver/devtools/browser.rb +123 -0
  23. data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
  24. data/lib/selenium/webdriver/devtools/cast.rb +70 -0
  25. data/lib/selenium/webdriver/devtools/console.rb +57 -0
  26. data/lib/selenium/webdriver/devtools/css.rb +165 -0
  27. data/lib/selenium/webdriver/devtools/database.rb +64 -0
  28. data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
  29. data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
  30. data/lib/selenium/webdriver/devtools/dom.rb +320 -0
  31. data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
  32. data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
  33. data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
  34. data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
  35. data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
  36. data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
  37. data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
  38. data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
  39. data/lib/selenium/webdriver/devtools/input.rb +140 -0
  40. data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
  41. data/lib/selenium/webdriver/devtools/io.rb +59 -0
  42. data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
  43. data/lib/selenium/webdriver/devtools/log.rb +66 -0
  44. data/lib/selenium/webdriver/devtools/media.rb +57 -0
  45. data/lib/selenium/webdriver/devtools/memory.rb +86 -0
  46. data/lib/selenium/webdriver/devtools/network.rb +228 -0
  47. data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
  48. data/lib/selenium/webdriver/devtools/page.rb +374 -0
  49. data/lib/selenium/webdriver/devtools/performance.rb +63 -0
  50. data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
  51. data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
  52. data/lib/selenium/webdriver/devtools/schema.rb +46 -0
  53. data/lib/selenium/webdriver/devtools/security.rb +71 -0
  54. data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
  55. data/lib/selenium/webdriver/devtools/storage.rb +95 -0
  56. data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
  57. data/lib/selenium/webdriver/devtools/target.rb +141 -0
  58. data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
  59. data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
  60. data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
  61. data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
  62. data/lib/selenium/webdriver/edge_chrome/bridge.rb +9 -2
  63. data/lib/selenium/webdriver/edge_chrome/driver.rb +4 -0
  64. data/lib/selenium/webdriver/edge_chrome/options.rb +2 -0
  65. data/lib/selenium/webdriver/edge_html/options.rb +2 -9
  66. data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
  67. data/lib/selenium/webdriver/firefox/driver.rb +4 -0
  68. data/lib/selenium/webdriver/firefox/options.rb +5 -10
  69. data/lib/selenium/webdriver/ie/options.rb +7 -10
  70. data/lib/selenium/webdriver/remote/bridge.rb +3 -13
  71. data/lib/selenium/webdriver/remote/capabilities.rb +11 -6
  72. data/lib/selenium/webdriver/safari/bridge.rb +1 -1
  73. data/lib/selenium/webdriver/safari/driver.rb +4 -0
  74. data/lib/selenium/webdriver/safari/options.rb +1 -8
  75. data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
  76. data/lib/selenium/webdriver/support/color.rb +2 -2
  77. data/lib/selenium/webdriver/version.rb +1 -1
  78. data/selenium-webdriver.gemspec +2 -2
  79. metadata +53 -5
@@ -0,0 +1,63 @@
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 performance
25
+ @performance ||= Performance.new(self)
26
+ end
27
+
28
+ class Performance
29
+ EVENTS = {
30
+ metrics: 'metrics',
31
+ }
32
+
33
+ def initialize(devtools)
34
+ @devtools = devtools
35
+ end
36
+
37
+ def on(event, &block)
38
+ event = EVENTS[event] if event.is_a?(Symbol)
39
+ @devtools.callbacks["Performance.#{event}"] << block
40
+ end
41
+
42
+ def disable
43
+ @devtools.send_cmd('Performance.disable')
44
+ end
45
+
46
+ def enable(time_domain: nil)
47
+ @devtools.send_cmd('Performance.enable',
48
+ timeDomain: time_domain)
49
+ end
50
+
51
+ def set_time_domain(time_domain:)
52
+ @devtools.send_cmd('Performance.setTimeDomain',
53
+ timeDomain: time_domain)
54
+ end
55
+
56
+ def get_metrics
57
+ @devtools.send_cmd('Performance.getMetrics')
58
+ end
59
+
60
+ end # Performance
61
+ end # DevTools
62
+ end # WebDriver
63
+ end # Selenium
@@ -0,0 +1,111 @@
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 profiler
25
+ @profiler ||= Profiler.new(self)
26
+ end
27
+
28
+ class Profiler
29
+ EVENTS = {
30
+ console_profile_finished: 'consoleProfileFinished',
31
+ console_profile_started: 'consoleProfileStarted',
32
+ precise_coverage_delta_update: 'preciseCoverageDeltaUpdate',
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["Profiler.#{event}"] << block
42
+ end
43
+
44
+ def disable
45
+ @devtools.send_cmd('Profiler.disable')
46
+ end
47
+
48
+ def enable
49
+ @devtools.send_cmd('Profiler.enable')
50
+ end
51
+
52
+ def get_best_effort_coverage
53
+ @devtools.send_cmd('Profiler.getBestEffortCoverage')
54
+ end
55
+
56
+ def set_sampling_interval(interval:)
57
+ @devtools.send_cmd('Profiler.setSamplingInterval',
58
+ interval: interval)
59
+ end
60
+
61
+ def start
62
+ @devtools.send_cmd('Profiler.start')
63
+ end
64
+
65
+ def start_precise_coverage(call_count: nil, detailed: nil, allow_triggered_updates: nil)
66
+ @devtools.send_cmd('Profiler.startPreciseCoverage',
67
+ callCount: call_count,
68
+ detailed: detailed,
69
+ allowTriggeredUpdates: allow_triggered_updates)
70
+ end
71
+
72
+ def start_type_profile
73
+ @devtools.send_cmd('Profiler.startTypeProfile')
74
+ end
75
+
76
+ def stop
77
+ @devtools.send_cmd('Profiler.stop')
78
+ end
79
+
80
+ def stop_precise_coverage
81
+ @devtools.send_cmd('Profiler.stopPreciseCoverage')
82
+ end
83
+
84
+ def stop_type_profile
85
+ @devtools.send_cmd('Profiler.stopTypeProfile')
86
+ end
87
+
88
+ def take_precise_coverage
89
+ @devtools.send_cmd('Profiler.takePreciseCoverage')
90
+ end
91
+
92
+ def take_type_profile
93
+ @devtools.send_cmd('Profiler.takeTypeProfile')
94
+ end
95
+
96
+ def enable_runtime_call_stats
97
+ @devtools.send_cmd('Profiler.enableRuntimeCallStats')
98
+ end
99
+
100
+ def disable_runtime_call_stats
101
+ @devtools.send_cmd('Profiler.disableRuntimeCallStats')
102
+ end
103
+
104
+ def get_runtime_call_stats
105
+ @devtools.send_cmd('Profiler.getRuntimeCallStats')
106
+ end
107
+
108
+ end # Profiler
109
+ end # DevTools
110
+ end # WebDriver
111
+ end # Selenium
@@ -0,0 +1,193 @@
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 runtime
25
+ @runtime ||= Runtime.new(self)
26
+ end
27
+
28
+ class Runtime
29
+ EVENTS = {
30
+ binding_called: 'bindingCalled',
31
+ console_apicalled: 'consoleAPICalled',
32
+ exception_revoked: 'exceptionRevoked',
33
+ exception_thrown: 'exceptionThrown',
34
+ execution_context_created: 'executionContextCreated',
35
+ execution_context_destroyed: 'executionContextDestroyed',
36
+ execution_contexts_cleared: 'executionContextsCleared',
37
+ inspect_requested: 'inspectRequested',
38
+ }
39
+
40
+ def initialize(devtools)
41
+ @devtools = devtools
42
+ end
43
+
44
+ def on(event, &block)
45
+ event = EVENTS[event] if event.is_a?(Symbol)
46
+ @devtools.callbacks["Runtime.#{event}"] << block
47
+ end
48
+
49
+ def await_promise(promise_object_id:, return_by_value: nil, generate_preview: nil)
50
+ @devtools.send_cmd('Runtime.awaitPromise',
51
+ promiseObjectId: promise_object_id,
52
+ returnByValue: return_by_value,
53
+ generatePreview: generate_preview)
54
+ end
55
+
56
+ def call_function_on(function_declaration:, object_id: nil, arguments: nil, silent: nil, return_by_value: nil, generate_preview: nil, user_gesture: nil, await_promise: nil, execution_context_id: nil, object_group: nil)
57
+ @devtools.send_cmd('Runtime.callFunctionOn',
58
+ functionDeclaration: function_declaration,
59
+ objectId: object_id,
60
+ arguments: arguments,
61
+ silent: silent,
62
+ returnByValue: return_by_value,
63
+ generatePreview: generate_preview,
64
+ userGesture: user_gesture,
65
+ awaitPromise: await_promise,
66
+ executionContextId: execution_context_id,
67
+ objectGroup: object_group)
68
+ end
69
+
70
+ def compile_script(expression:, source_url:, persist_script:, execution_context_id: nil)
71
+ @devtools.send_cmd('Runtime.compileScript',
72
+ expression: expression,
73
+ sourceURL: source_url,
74
+ persistScript: persist_script,
75
+ executionContextId: execution_context_id)
76
+ end
77
+
78
+ def disable
79
+ @devtools.send_cmd('Runtime.disable')
80
+ end
81
+
82
+ def discard_console_entries
83
+ @devtools.send_cmd('Runtime.discardConsoleEntries')
84
+ end
85
+
86
+ def enable
87
+ @devtools.send_cmd('Runtime.enable')
88
+ end
89
+
90
+ def evaluate(expression:, object_group: nil, include_command_line_api: nil, silent: nil, context_id: nil, return_by_value: nil, generate_preview: nil, user_gesture: nil, await_promise: nil, throw_on_side_effect: nil, timeout: nil, disable_breaks: nil, repl_mode: nil)
91
+ @devtools.send_cmd('Runtime.evaluate',
92
+ expression: expression,
93
+ objectGroup: object_group,
94
+ includeCommandLineAPI: include_command_line_api,
95
+ silent: silent,
96
+ contextId: context_id,
97
+ returnByValue: return_by_value,
98
+ generatePreview: generate_preview,
99
+ userGesture: user_gesture,
100
+ awaitPromise: await_promise,
101
+ throwOnSideEffect: throw_on_side_effect,
102
+ timeout: timeout,
103
+ disableBreaks: disable_breaks,
104
+ replMode: repl_mode)
105
+ end
106
+
107
+ def get_isolate_id
108
+ @devtools.send_cmd('Runtime.getIsolateId')
109
+ end
110
+
111
+ def get_heap_usage
112
+ @devtools.send_cmd('Runtime.getHeapUsage')
113
+ end
114
+
115
+ def get_properties(object_id:, own_properties: nil, accessor_properties_only: nil, generate_preview: nil)
116
+ @devtools.send_cmd('Runtime.getProperties',
117
+ objectId: object_id,
118
+ ownProperties: own_properties,
119
+ accessorPropertiesOnly: accessor_properties_only,
120
+ generatePreview: generate_preview)
121
+ end
122
+
123
+ def global_lexical_scope_names(execution_context_id: nil)
124
+ @devtools.send_cmd('Runtime.globalLexicalScopeNames',
125
+ executionContextId: execution_context_id)
126
+ end
127
+
128
+ def query_objects(prototype_object_id:, object_group: nil)
129
+ @devtools.send_cmd('Runtime.queryObjects',
130
+ prototypeObjectId: prototype_object_id,
131
+ objectGroup: object_group)
132
+ end
133
+
134
+ def release_object(object_id:)
135
+ @devtools.send_cmd('Runtime.releaseObject',
136
+ objectId: object_id)
137
+ end
138
+
139
+ def release_object_group(object_group:)
140
+ @devtools.send_cmd('Runtime.releaseObjectGroup',
141
+ objectGroup: object_group)
142
+ end
143
+
144
+ def run_if_waiting_for_debugger
145
+ @devtools.send_cmd('Runtime.runIfWaitingForDebugger')
146
+ end
147
+
148
+ def run_script(script_id:, execution_context_id: nil, object_group: nil, silent: nil, include_command_line_api: nil, return_by_value: nil, generate_preview: nil, await_promise: nil)
149
+ @devtools.send_cmd('Runtime.runScript',
150
+ scriptId: script_id,
151
+ executionContextId: execution_context_id,
152
+ objectGroup: object_group,
153
+ silent: silent,
154
+ includeCommandLineAPI: include_command_line_api,
155
+ returnByValue: return_by_value,
156
+ generatePreview: generate_preview,
157
+ awaitPromise: await_promise)
158
+ end
159
+
160
+ def set_async_call_stack_depth(max_depth:)
161
+ @devtools.send_cmd('Runtime.setAsyncCallStackDepth',
162
+ maxDepth: max_depth)
163
+ end
164
+
165
+ def set_custom_object_formatter_enabled(enabled:)
166
+ @devtools.send_cmd('Runtime.setCustomObjectFormatterEnabled',
167
+ enabled: enabled)
168
+ end
169
+
170
+ def set_max_call_stack_size_to_capture(size:)
171
+ @devtools.send_cmd('Runtime.setMaxCallStackSizeToCapture',
172
+ size: size)
173
+ end
174
+
175
+ def terminate_execution
176
+ @devtools.send_cmd('Runtime.terminateExecution')
177
+ end
178
+
179
+ def add_binding(name:, execution_context_id: nil)
180
+ @devtools.send_cmd('Runtime.addBinding',
181
+ name: name,
182
+ executionContextId: execution_context_id)
183
+ end
184
+
185
+ def remove_binding(name:)
186
+ @devtools.send_cmd('Runtime.removeBinding',
187
+ name: name)
188
+ end
189
+
190
+ end # Runtime
191
+ end # DevTools
192
+ end # WebDriver
193
+ end # Selenium
@@ -0,0 +1,46 @@
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 schema
25
+ @schema ||= Schema.new(self)
26
+ end
27
+
28
+ class Schema
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["Schema.#{event}"] << block
37
+ end
38
+
39
+ def get_domains
40
+ @devtools.send_cmd('Schema.getDomains')
41
+ end
42
+
43
+ end # Schema
44
+ end # DevTools
45
+ end # WebDriver
46
+ end # Selenium
@@ -0,0 +1,71 @@
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 security
25
+ @security ||= Security.new(self)
26
+ end
27
+
28
+ class Security
29
+ EVENTS = {
30
+ certificate_error: 'certificateError',
31
+ visible_security_state_changed: 'visibleSecurityStateChanged',
32
+ security_state_changed: 'securityStateChanged',
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["Security.#{event}"] << block
42
+ end
43
+
44
+ def disable
45
+ @devtools.send_cmd('Security.disable')
46
+ end
47
+
48
+ def enable
49
+ @devtools.send_cmd('Security.enable')
50
+ end
51
+
52
+ def set_ignore_certificate_errors(ignore:)
53
+ @devtools.send_cmd('Security.setIgnoreCertificateErrors',
54
+ ignore: ignore)
55
+ end
56
+
57
+ def handle_certificate_error(event_id:, action:)
58
+ @devtools.send_cmd('Security.handleCertificateError',
59
+ eventId: event_id,
60
+ action: action)
61
+ end
62
+
63
+ def set_override_certificate_errors(override:)
64
+ @devtools.send_cmd('Security.setOverrideCertificateErrors',
65
+ override: override)
66
+ end
67
+
68
+ end # Security
69
+ end # DevTools
70
+ end # WebDriver
71
+ end # Selenium