selenium-webdriver 4.0.0.alpha1 → 4.0.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES +139 -1
  3. data/LICENSE +1 -1
  4. data/lib/selenium/server.rb +3 -3
  5. data/lib/selenium/webdriver.rb +11 -7
  6. data/lib/selenium/webdriver/atoms/findElements.js +122 -0
  7. data/lib/selenium/webdriver/atoms/getAttribute.js +84 -7
  8. data/lib/selenium/webdriver/atoms/isDisplayed.js +75 -77
  9. data/lib/selenium/webdriver/chrome.rb +10 -9
  10. data/lib/selenium/webdriver/chrome/bridge.rb +20 -4
  11. data/lib/selenium/webdriver/chrome/driver.rb +3 -52
  12. data/lib/selenium/webdriver/chrome/options.rb +97 -57
  13. data/lib/selenium/webdriver/chrome/profile.rb +2 -2
  14. data/lib/selenium/webdriver/chrome/service.rb +0 -4
  15. data/lib/selenium/webdriver/common.rb +3 -0
  16. data/lib/selenium/webdriver/common/driver.rb +76 -17
  17. data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_devtools.rb} +10 -8
  18. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -1
  19. data/lib/selenium/webdriver/common/logger.rb +48 -16
  20. data/lib/selenium/webdriver/common/manager.rb +5 -0
  21. data/lib/selenium/webdriver/common/options.rb +60 -121
  22. data/lib/selenium/webdriver/common/platform.rb +3 -0
  23. data/lib/selenium/webdriver/common/port_prober.rb +4 -6
  24. data/lib/selenium/webdriver/common/profile_helper.rb +10 -2
  25. data/lib/selenium/webdriver/common/proxy.rb +0 -0
  26. data/lib/selenium/webdriver/common/search_context.rb +3 -2
  27. data/lib/selenium/webdriver/common/service.rb +30 -113
  28. data/lib/selenium/webdriver/common/service_manager.rb +151 -0
  29. data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
  30. data/lib/selenium/webdriver/common/wait.rb +1 -1
  31. data/lib/selenium/webdriver/devtools.rb +118 -0
  32. data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
  33. data/lib/selenium/webdriver/devtools/animation.rb +98 -0
  34. data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
  35. data/lib/selenium/webdriver/devtools/audits.rb +61 -0
  36. data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
  37. data/lib/selenium/webdriver/devtools/browser.rb +123 -0
  38. data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
  39. data/lib/selenium/webdriver/devtools/cast.rb +70 -0
  40. data/lib/selenium/webdriver/devtools/console.rb +57 -0
  41. data/lib/selenium/webdriver/devtools/css.rb +165 -0
  42. data/lib/selenium/webdriver/devtools/database.rb +64 -0
  43. data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
  44. data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
  45. data/lib/selenium/webdriver/devtools/dom.rb +320 -0
  46. data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
  47. data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
  48. data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
  49. data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
  50. data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
  51. data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
  52. data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
  53. data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
  54. data/lib/selenium/webdriver/devtools/input.rb +140 -0
  55. data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
  56. data/lib/selenium/webdriver/devtools/io.rb +59 -0
  57. data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
  58. data/lib/selenium/webdriver/devtools/log.rb +66 -0
  59. data/lib/selenium/webdriver/devtools/media.rb +57 -0
  60. data/lib/selenium/webdriver/devtools/memory.rb +86 -0
  61. data/lib/selenium/webdriver/devtools/network.rb +228 -0
  62. data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
  63. data/lib/selenium/webdriver/devtools/page.rb +374 -0
  64. data/lib/selenium/webdriver/devtools/performance.rb +63 -0
  65. data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
  66. data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
  67. data/lib/selenium/webdriver/devtools/schema.rb +46 -0
  68. data/lib/selenium/webdriver/devtools/security.rb +71 -0
  69. data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
  70. data/lib/selenium/webdriver/devtools/storage.rb +95 -0
  71. data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
  72. data/lib/selenium/webdriver/devtools/target.rb +141 -0
  73. data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
  74. data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
  75. data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
  76. data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
  77. data/lib/selenium/webdriver/edge.rb +29 -9
  78. data/lib/selenium/webdriver/{firefox/util.rb → edge_chrome/bridge.rb} +11 -20
  79. data/lib/selenium/webdriver/{common/w3c_options.rb → edge_chrome/driver.rb} +14 -17
  80. data/lib/selenium/webdriver/edge_chrome/options.rb +36 -0
  81. data/lib/selenium/webdriver/edge_chrome/profile.rb +33 -0
  82. data/lib/selenium/webdriver/edge_chrome/service.rb +36 -0
  83. data/lib/selenium/webdriver/{common/w3c_manager.rb → edge_html/driver.rb} +11 -17
  84. data/lib/selenium/webdriver/{edge → edge_html}/options.rb +26 -22
  85. data/lib/selenium/webdriver/{edge → edge_html}/service.rb +2 -6
  86. data/lib/selenium/webdriver/firefox.rb +18 -15
  87. data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
  88. data/lib/selenium/webdriver/firefox/driver.rb +2 -30
  89. data/lib/selenium/webdriver/firefox/extension.rb +8 -0
  90. data/lib/selenium/webdriver/firefox/options.rb +47 -52
  91. data/lib/selenium/webdriver/firefox/profile.rb +7 -78
  92. data/lib/selenium/webdriver/firefox/service.rb +0 -4
  93. data/lib/selenium/webdriver/ie.rb +8 -7
  94. data/lib/selenium/webdriver/ie/driver.rb +0 -32
  95. data/lib/selenium/webdriver/ie/options.rb +10 -33
  96. data/lib/selenium/webdriver/ie/service.rb +5 -9
  97. data/lib/selenium/webdriver/remote.rb +16 -10
  98. data/lib/selenium/webdriver/remote/bridge.rb +34 -42
  99. data/lib/selenium/webdriver/remote/capabilities.rb +22 -6
  100. data/lib/selenium/webdriver/remote/driver.rb +6 -12
  101. data/lib/selenium/webdriver/remote/http/default.rb +9 -4
  102. data/lib/selenium/webdriver/remote/http/persistent.rb +5 -6
  103. data/lib/selenium/webdriver/safari.rb +9 -8
  104. data/lib/selenium/webdriver/safari/bridge.rb +4 -4
  105. data/lib/selenium/webdriver/safari/driver.rb +3 -29
  106. data/lib/selenium/webdriver/safari/options.rb +18 -19
  107. data/lib/selenium/webdriver/safari/service.rb +0 -4
  108. data/lib/selenium/webdriver/support.rb +1 -0
  109. data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
  110. data/lib/selenium/webdriver/support/color.rb +2 -2
  111. data/lib/selenium/webdriver/support/event_firing_bridge.rb +1 -1
  112. data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
  113. data/lib/selenium/webdriver/version.rb +1 -1
  114. data/selenium-webdriver.gemspec +5 -4
  115. metadata +81 -42
  116. data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
  117. data/lib/selenium/webdriver/common/keyboard.rb +0 -70
  118. data/lib/selenium/webdriver/common/mouse.rb +0 -89
  119. data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
  120. data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
  121. data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
  122. data/lib/selenium/webdriver/edge/bridge.rb +0 -76
  123. data/lib/selenium/webdriver/edge/driver.rb +0 -70
  124. data/lib/selenium/webdriver/firefox/binary.rb +0 -110
  125. data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
  126. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  127. data/lib/selenium/webdriver/firefox/launcher.rb +0 -111
  128. data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
  129. data/lib/selenium/webdriver/firefox/marionette/bridge.rb +0 -49
  130. data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
  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/remote/oss/bridge.rb +0 -594
  134. data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
  135. data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
  136. data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
  137. data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
@@ -0,0 +1,73 @@
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 cache_storage
25
+ @cache_storage ||= CacheStorage.new(self)
26
+ end
27
+
28
+ class CacheStorage
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["CacheStorage.#{event}"] << block
37
+ end
38
+
39
+ def delete_cache(cache_id:)
40
+ @devtools.send_cmd('CacheStorage.deleteCache',
41
+ cacheId: cache_id)
42
+ end
43
+
44
+ def delete_entry(cache_id:, request:)
45
+ @devtools.send_cmd('CacheStorage.deleteEntry',
46
+ cacheId: cache_id,
47
+ request: request)
48
+ end
49
+
50
+ def request_cache_names(security_origin:)
51
+ @devtools.send_cmd('CacheStorage.requestCacheNames',
52
+ securityOrigin: security_origin)
53
+ end
54
+
55
+ def request_cached_response(cache_id:, request_url:, request_headers:)
56
+ @devtools.send_cmd('CacheStorage.requestCachedResponse',
57
+ cacheId: cache_id,
58
+ requestURL: request_url,
59
+ requestHeaders: request_headers)
60
+ end
61
+
62
+ def request_entries(cache_id:, skip_count: nil, page_size: nil, path_filter: nil)
63
+ @devtools.send_cmd('CacheStorage.requestEntries',
64
+ cacheId: cache_id,
65
+ skipCount: skip_count,
66
+ pageSize: page_size,
67
+ pathFilter: path_filter)
68
+ end
69
+
70
+ end # CacheStorage
71
+ end # DevTools
72
+ end # WebDriver
73
+ end # Selenium
@@ -0,0 +1,70 @@
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 cast
25
+ @cast ||= Cast.new(self)
26
+ end
27
+
28
+ class Cast
29
+ EVENTS = {
30
+ sinks_updated: 'sinksUpdated',
31
+ issue_updated: 'issueUpdated',
32
+ }
33
+
34
+ def initialize(devtools)
35
+ @devtools = devtools
36
+ end
37
+
38
+ def on(event, &block)
39
+ event = EVENTS[event] if event.is_a?(Symbol)
40
+ @devtools.callbacks["Cast.#{event}"] << block
41
+ end
42
+
43
+ def enable(presentation_url: nil)
44
+ @devtools.send_cmd('Cast.enable',
45
+ presentationUrl: presentation_url)
46
+ end
47
+
48
+ def disable
49
+ @devtools.send_cmd('Cast.disable')
50
+ end
51
+
52
+ def set_sink_to_use(sink_name:)
53
+ @devtools.send_cmd('Cast.setSinkToUse',
54
+ sinkName: sink_name)
55
+ end
56
+
57
+ def start_tab_mirroring(sink_name:)
58
+ @devtools.send_cmd('Cast.startTabMirroring',
59
+ sinkName: sink_name)
60
+ end
61
+
62
+ def stop_casting(sink_name:)
63
+ @devtools.send_cmd('Cast.stopCasting',
64
+ sinkName: sink_name)
65
+ end
66
+
67
+ end # Cast
68
+ end # DevTools
69
+ end # WebDriver
70
+ end # Selenium
@@ -0,0 +1,57 @@
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 console
25
+ @console ||= Console.new(self)
26
+ end
27
+
28
+ class Console
29
+ EVENTS = {
30
+ message_added: 'messageAdded',
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["Console.#{event}"] << block
40
+ end
41
+
42
+ def clear_messages
43
+ @devtools.send_cmd('Console.clearMessages')
44
+ end
45
+
46
+ def disable
47
+ @devtools.send_cmd('Console.disable')
48
+ end
49
+
50
+ def enable
51
+ @devtools.send_cmd('Console.enable')
52
+ end
53
+
54
+ end # Console
55
+ end # DevTools
56
+ end # WebDriver
57
+ end # Selenium
@@ -0,0 +1,165 @@
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 css
25
+ @css ||= CSS.new(self)
26
+ end
27
+
28
+ class CSS
29
+ EVENTS = {
30
+ fonts_updated: 'fontsUpdated',
31
+ media_query_result_changed: 'mediaQueryResultChanged',
32
+ style_sheet_added: 'styleSheetAdded',
33
+ style_sheet_changed: 'styleSheetChanged',
34
+ style_sheet_removed: 'styleSheetRemoved',
35
+ }
36
+
37
+ def initialize(devtools)
38
+ @devtools = devtools
39
+ end
40
+
41
+ def on(event, &block)
42
+ event = EVENTS[event] if event.is_a?(Symbol)
43
+ @devtools.callbacks["CSS.#{event}"] << block
44
+ end
45
+
46
+ def add_rule(style_sheet_id:, rule_text:, location:)
47
+ @devtools.send_cmd('CSS.addRule',
48
+ styleSheetId: style_sheet_id,
49
+ ruleText: rule_text,
50
+ location: location)
51
+ end
52
+
53
+ def collect_class_names(style_sheet_id:)
54
+ @devtools.send_cmd('CSS.collectClassNames',
55
+ styleSheetId: style_sheet_id)
56
+ end
57
+
58
+ def create_style_sheet(frame_id:)
59
+ @devtools.send_cmd('CSS.createStyleSheet',
60
+ frameId: frame_id)
61
+ end
62
+
63
+ def disable
64
+ @devtools.send_cmd('CSS.disable')
65
+ end
66
+
67
+ def enable
68
+ @devtools.send_cmd('CSS.enable')
69
+ end
70
+
71
+ def force_pseudo_state(node_id:, forced_pseudo_classes:)
72
+ @devtools.send_cmd('CSS.forcePseudoState',
73
+ nodeId: node_id,
74
+ forcedPseudoClasses: forced_pseudo_classes)
75
+ end
76
+
77
+ def get_background_colors(node_id:)
78
+ @devtools.send_cmd('CSS.getBackgroundColors',
79
+ nodeId: node_id)
80
+ end
81
+
82
+ def get_computed_style_for_node(node_id:)
83
+ @devtools.send_cmd('CSS.getComputedStyleForNode',
84
+ nodeId: node_id)
85
+ end
86
+
87
+ def get_inline_styles_for_node(node_id:)
88
+ @devtools.send_cmd('CSS.getInlineStylesForNode',
89
+ nodeId: node_id)
90
+ end
91
+
92
+ def get_matched_styles_for_node(node_id:)
93
+ @devtools.send_cmd('CSS.getMatchedStylesForNode',
94
+ nodeId: node_id)
95
+ end
96
+
97
+ def get_media_queries
98
+ @devtools.send_cmd('CSS.getMediaQueries')
99
+ end
100
+
101
+ def get_platform_fonts_for_node(node_id:)
102
+ @devtools.send_cmd('CSS.getPlatformFontsForNode',
103
+ nodeId: node_id)
104
+ end
105
+
106
+ def get_style_sheet_text(style_sheet_id:)
107
+ @devtools.send_cmd('CSS.getStyleSheetText',
108
+ styleSheetId: style_sheet_id)
109
+ end
110
+
111
+ def set_effective_property_value_for_node(node_id:, property_name:, value:)
112
+ @devtools.send_cmd('CSS.setEffectivePropertyValueForNode',
113
+ nodeId: node_id,
114
+ propertyName: property_name,
115
+ value: value)
116
+ end
117
+
118
+ def set_keyframe_key(style_sheet_id:, range:, key_text:)
119
+ @devtools.send_cmd('CSS.setKeyframeKey',
120
+ styleSheetId: style_sheet_id,
121
+ range: range,
122
+ keyText: key_text)
123
+ end
124
+
125
+ def set_media_text(style_sheet_id:, range:, text:)
126
+ @devtools.send_cmd('CSS.setMediaText',
127
+ styleSheetId: style_sheet_id,
128
+ range: range,
129
+ text: text)
130
+ end
131
+
132
+ def set_rule_selector(style_sheet_id:, range:, selector:)
133
+ @devtools.send_cmd('CSS.setRuleSelector',
134
+ styleSheetId: style_sheet_id,
135
+ range: range,
136
+ selector: selector)
137
+ end
138
+
139
+ def set_style_sheet_text(style_sheet_id:, text:)
140
+ @devtools.send_cmd('CSS.setStyleSheetText',
141
+ styleSheetId: style_sheet_id,
142
+ text: text)
143
+ end
144
+
145
+ def set_style_texts(edits:)
146
+ @devtools.send_cmd('CSS.setStyleTexts',
147
+ edits: edits)
148
+ end
149
+
150
+ def start_rule_usage_tracking
151
+ @devtools.send_cmd('CSS.startRuleUsageTracking')
152
+ end
153
+
154
+ def stop_rule_usage_tracking
155
+ @devtools.send_cmd('CSS.stopRuleUsageTracking')
156
+ end
157
+
158
+ def take_coverage_delta
159
+ @devtools.send_cmd('CSS.takeCoverageDelta')
160
+ end
161
+
162
+ end # CSS
163
+ end # DevTools
164
+ end # WebDriver
165
+ end # Selenium
@@ -0,0 +1,64 @@
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 database
25
+ @database ||= Database.new(self)
26
+ end
27
+
28
+ class Database
29
+ EVENTS = {
30
+ add_database: 'addDatabase',
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["Database.#{event}"] << block
40
+ end
41
+
42
+ def disable
43
+ @devtools.send_cmd('Database.disable')
44
+ end
45
+
46
+ def enable
47
+ @devtools.send_cmd('Database.enable')
48
+ end
49
+
50
+ def execute_sql(database_id:, query:)
51
+ @devtools.send_cmd('Database.executeSQL',
52
+ databaseId: database_id,
53
+ query: query)
54
+ end
55
+
56
+ def get_database_table_names(database_id:)
57
+ @devtools.send_cmd('Database.getDatabaseTableNames',
58
+ databaseId: database_id)
59
+ end
60
+
61
+ end # Database
62
+ end # DevTools
63
+ end # WebDriver
64
+ end # Selenium
@@ -0,0 +1,229 @@
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 debugger
25
+ @debugger ||= Debugger.new(self)
26
+ end
27
+
28
+ class Debugger
29
+ EVENTS = {
30
+ breakpoint_resolved: 'breakpointResolved',
31
+ paused: 'paused',
32
+ resumed: 'resumed',
33
+ script_failed_to_parse: 'scriptFailedToParse',
34
+ script_parsed: 'scriptParsed',
35
+ }
36
+
37
+ def initialize(devtools)
38
+ @devtools = devtools
39
+ end
40
+
41
+ def on(event, &block)
42
+ event = EVENTS[event] if event.is_a?(Symbol)
43
+ @devtools.callbacks["Debugger.#{event}"] << block
44
+ end
45
+
46
+ def continue_to_location(location:, target_call_frames: nil)
47
+ @devtools.send_cmd('Debugger.continueToLocation',
48
+ location: location,
49
+ targetCallFrames: target_call_frames)
50
+ end
51
+
52
+ def disable
53
+ @devtools.send_cmd('Debugger.disable')
54
+ end
55
+
56
+ def enable(max_scripts_cache_size: nil)
57
+ @devtools.send_cmd('Debugger.enable',
58
+ maxScriptsCacheSize: max_scripts_cache_size)
59
+ end
60
+
61
+ def evaluate_on_call_frame(call_frame_id:, expression:, object_group: nil, include_command_line_api: nil, silent: nil, return_by_value: nil, generate_preview: nil, throw_on_side_effect: nil, timeout: nil)
62
+ @devtools.send_cmd('Debugger.evaluateOnCallFrame',
63
+ callFrameId: call_frame_id,
64
+ expression: expression,
65
+ objectGroup: object_group,
66
+ includeCommandLineAPI: include_command_line_api,
67
+ silent: silent,
68
+ returnByValue: return_by_value,
69
+ generatePreview: generate_preview,
70
+ throwOnSideEffect: throw_on_side_effect,
71
+ timeout: timeout)
72
+ end
73
+
74
+ def execute_wasm_evaluator(call_frame_id:, evaluator:, timeout: nil)
75
+ @devtools.send_cmd('Debugger.executeWasmEvaluator',
76
+ callFrameId: call_frame_id,
77
+ evaluator: evaluator,
78
+ timeout: timeout)
79
+ end
80
+
81
+ def get_possible_breakpoints(start:, _end: nil, restrict_to_function: nil)
82
+ @devtools.send_cmd('Debugger.getPossibleBreakpoints',
83
+ start: start,
84
+ end: _end,
85
+ restrictToFunction: restrict_to_function)
86
+ end
87
+
88
+ def get_script_source(script_id:)
89
+ @devtools.send_cmd('Debugger.getScriptSource',
90
+ scriptId: script_id)
91
+ end
92
+
93
+ def get_wasm_bytecode(script_id:)
94
+ @devtools.send_cmd('Debugger.getWasmBytecode',
95
+ scriptId: script_id)
96
+ end
97
+
98
+ def get_stack_trace(stack_trace_id:)
99
+ @devtools.send_cmd('Debugger.getStackTrace',
100
+ stackTraceId: stack_trace_id)
101
+ end
102
+
103
+ def pause
104
+ @devtools.send_cmd('Debugger.pause')
105
+ end
106
+
107
+ def pause_on_async_call(parent_stack_trace_id:)
108
+ @devtools.send_cmd('Debugger.pauseOnAsyncCall',
109
+ parentStackTraceId: parent_stack_trace_id)
110
+ end
111
+
112
+ def remove_breakpoint(breakpoint_id:)
113
+ @devtools.send_cmd('Debugger.removeBreakpoint',
114
+ breakpointId: breakpoint_id)
115
+ end
116
+
117
+ def restart_frame(call_frame_id:)
118
+ @devtools.send_cmd('Debugger.restartFrame',
119
+ callFrameId: call_frame_id)
120
+ end
121
+
122
+ def resume(terminate_on_resume: nil)
123
+ @devtools.send_cmd('Debugger.resume',
124
+ terminateOnResume: terminate_on_resume)
125
+ end
126
+
127
+ def search_in_content(script_id:, query:, case_sensitive: nil, is_regex: nil)
128
+ @devtools.send_cmd('Debugger.searchInContent',
129
+ scriptId: script_id,
130
+ query: query,
131
+ caseSensitive: case_sensitive,
132
+ isRegex: is_regex)
133
+ end
134
+
135
+ def set_async_call_stack_depth(max_depth:)
136
+ @devtools.send_cmd('Debugger.setAsyncCallStackDepth',
137
+ maxDepth: max_depth)
138
+ end
139
+
140
+ def set_blackbox_patterns(patterns:)
141
+ @devtools.send_cmd('Debugger.setBlackboxPatterns',
142
+ patterns: patterns)
143
+ end
144
+
145
+ def set_blackboxed_ranges(script_id:, positions:)
146
+ @devtools.send_cmd('Debugger.setBlackboxedRanges',
147
+ scriptId: script_id,
148
+ positions: positions)
149
+ end
150
+
151
+ def set_breakpoint(location:, condition: nil)
152
+ @devtools.send_cmd('Debugger.setBreakpoint',
153
+ location: location,
154
+ condition: condition)
155
+ end
156
+
157
+ def set_instrumentation_breakpoint(instrumentation:)
158
+ @devtools.send_cmd('Debugger.setInstrumentationBreakpoint',
159
+ instrumentation: instrumentation)
160
+ end
161
+
162
+ def set_breakpoint_by_url(line_number:, url: nil, url_regex: nil, script_hash: nil, column_number: nil, condition: nil)
163
+ @devtools.send_cmd('Debugger.setBreakpointByUrl',
164
+ lineNumber: line_number,
165
+ url: url,
166
+ urlRegex: url_regex,
167
+ scriptHash: script_hash,
168
+ columnNumber: column_number,
169
+ condition: condition)
170
+ end
171
+
172
+ def set_breakpoint_on_function_call(object_id:, condition: nil)
173
+ @devtools.send_cmd('Debugger.setBreakpointOnFunctionCall',
174
+ objectId: object_id,
175
+ condition: condition)
176
+ end
177
+
178
+ def set_breakpoints_active(active:)
179
+ @devtools.send_cmd('Debugger.setBreakpointsActive',
180
+ active: active)
181
+ end
182
+
183
+ def set_pause_on_exceptions(state:)
184
+ @devtools.send_cmd('Debugger.setPauseOnExceptions',
185
+ state: state)
186
+ end
187
+
188
+ def set_return_value(new_value:)
189
+ @devtools.send_cmd('Debugger.setReturnValue',
190
+ newValue: new_value)
191
+ end
192
+
193
+ def set_script_source(script_id:, script_source:, dry_run: nil)
194
+ @devtools.send_cmd('Debugger.setScriptSource',
195
+ scriptId: script_id,
196
+ scriptSource: script_source,
197
+ dryRun: dry_run)
198
+ end
199
+
200
+ def set_skip_all_pauses(skip:)
201
+ @devtools.send_cmd('Debugger.setSkipAllPauses',
202
+ skip: skip)
203
+ end
204
+
205
+ def set_variable_value(scope_number:, variable_name:, new_value:, call_frame_id:)
206
+ @devtools.send_cmd('Debugger.setVariableValue',
207
+ scopeNumber: scope_number,
208
+ variableName: variable_name,
209
+ newValue: new_value,
210
+ callFrameId: call_frame_id)
211
+ end
212
+
213
+ def step_into(break_on_async_call: nil)
214
+ @devtools.send_cmd('Debugger.stepInto',
215
+ breakOnAsyncCall: break_on_async_call)
216
+ end
217
+
218
+ def step_out
219
+ @devtools.send_cmd('Debugger.stepOut')
220
+ end
221
+
222
+ def step_over
223
+ @devtools.send_cmd('Debugger.stepOver')
224
+ end
225
+
226
+ end # Debugger
227
+ end # DevTools
228
+ end # WebDriver
229
+ end # Selenium