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.
- checksums.yaml +5 -5
- data/CHANGES +139 -1
- data/LICENSE +1 -1
- data/lib/selenium/server.rb +3 -3
- data/lib/selenium/webdriver.rb +11 -7
- data/lib/selenium/webdriver/atoms/findElements.js +122 -0
- data/lib/selenium/webdriver/atoms/getAttribute.js +84 -7
- data/lib/selenium/webdriver/atoms/isDisplayed.js +75 -77
- data/lib/selenium/webdriver/chrome.rb +10 -9
- data/lib/selenium/webdriver/chrome/bridge.rb +20 -4
- data/lib/selenium/webdriver/chrome/driver.rb +3 -52
- data/lib/selenium/webdriver/chrome/options.rb +97 -57
- data/lib/selenium/webdriver/chrome/profile.rb +2 -2
- data/lib/selenium/webdriver/chrome/service.rb +0 -4
- data/lib/selenium/webdriver/common.rb +3 -0
- data/lib/selenium/webdriver/common/driver.rb +76 -17
- data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_devtools.rb} +10 -8
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -1
- data/lib/selenium/webdriver/common/logger.rb +48 -16
- data/lib/selenium/webdriver/common/manager.rb +5 -0
- data/lib/selenium/webdriver/common/options.rb +60 -121
- data/lib/selenium/webdriver/common/platform.rb +3 -0
- data/lib/selenium/webdriver/common/port_prober.rb +4 -6
- data/lib/selenium/webdriver/common/profile_helper.rb +10 -2
- data/lib/selenium/webdriver/common/proxy.rb +0 -0
- data/lib/selenium/webdriver/common/search_context.rb +3 -2
- data/lib/selenium/webdriver/common/service.rb +30 -113
- data/lib/selenium/webdriver/common/service_manager.rb +151 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/devtools.rb +118 -0
- data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
- data/lib/selenium/webdriver/devtools/animation.rb +98 -0
- data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
- data/lib/selenium/webdriver/devtools/audits.rb +61 -0
- data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
- data/lib/selenium/webdriver/devtools/browser.rb +123 -0
- data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
- data/lib/selenium/webdriver/devtools/cast.rb +70 -0
- data/lib/selenium/webdriver/devtools/console.rb +57 -0
- data/lib/selenium/webdriver/devtools/css.rb +165 -0
- data/lib/selenium/webdriver/devtools/database.rb +64 -0
- data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
- data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
- data/lib/selenium/webdriver/devtools/dom.rb +320 -0
- data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
- data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
- data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
- data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
- data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
- data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
- data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
- data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
- data/lib/selenium/webdriver/devtools/input.rb +140 -0
- data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
- data/lib/selenium/webdriver/devtools/io.rb +59 -0
- data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
- data/lib/selenium/webdriver/devtools/log.rb +66 -0
- data/lib/selenium/webdriver/devtools/media.rb +57 -0
- data/lib/selenium/webdriver/devtools/memory.rb +86 -0
- data/lib/selenium/webdriver/devtools/network.rb +228 -0
- data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
- data/lib/selenium/webdriver/devtools/page.rb +374 -0
- data/lib/selenium/webdriver/devtools/performance.rb +63 -0
- data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
- data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
- data/lib/selenium/webdriver/devtools/schema.rb +46 -0
- data/lib/selenium/webdriver/devtools/security.rb +71 -0
- data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
- data/lib/selenium/webdriver/devtools/storage.rb +95 -0
- data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
- data/lib/selenium/webdriver/devtools/target.rb +141 -0
- data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
- data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
- data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
- data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
- data/lib/selenium/webdriver/edge.rb +29 -9
- data/lib/selenium/webdriver/{firefox/util.rb → edge_chrome/bridge.rb} +11 -20
- data/lib/selenium/webdriver/{common/w3c_options.rb → edge_chrome/driver.rb} +14 -17
- data/lib/selenium/webdriver/edge_chrome/options.rb +36 -0
- data/lib/selenium/webdriver/edge_chrome/profile.rb +33 -0
- data/lib/selenium/webdriver/edge_chrome/service.rb +36 -0
- data/lib/selenium/webdriver/{common/w3c_manager.rb → edge_html/driver.rb} +11 -17
- data/lib/selenium/webdriver/{edge → edge_html}/options.rb +26 -22
- data/lib/selenium/webdriver/{edge → edge_html}/service.rb +2 -6
- data/lib/selenium/webdriver/firefox.rb +18 -15
- data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
- data/lib/selenium/webdriver/firefox/driver.rb +2 -30
- data/lib/selenium/webdriver/firefox/extension.rb +8 -0
- data/lib/selenium/webdriver/firefox/options.rb +47 -52
- data/lib/selenium/webdriver/firefox/profile.rb +7 -78
- data/lib/selenium/webdriver/firefox/service.rb +0 -4
- data/lib/selenium/webdriver/ie.rb +8 -7
- data/lib/selenium/webdriver/ie/driver.rb +0 -32
- data/lib/selenium/webdriver/ie/options.rb +10 -33
- data/lib/selenium/webdriver/ie/service.rb +5 -9
- data/lib/selenium/webdriver/remote.rb +16 -10
- data/lib/selenium/webdriver/remote/bridge.rb +34 -42
- data/lib/selenium/webdriver/remote/capabilities.rb +22 -6
- data/lib/selenium/webdriver/remote/driver.rb +6 -12
- data/lib/selenium/webdriver/remote/http/default.rb +9 -4
- data/lib/selenium/webdriver/remote/http/persistent.rb +5 -6
- data/lib/selenium/webdriver/safari.rb +9 -8
- data/lib/selenium/webdriver/safari/bridge.rb +4 -4
- data/lib/selenium/webdriver/safari/driver.rb +3 -29
- data/lib/selenium/webdriver/safari/options.rb +18 -19
- data/lib/selenium/webdriver/safari/service.rb +0 -4
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
- data/lib/selenium/webdriver/support/color.rb +2 -2
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +1 -1
- data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +5 -4
- metadata +81 -42
- data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
- data/lib/selenium/webdriver/common/keyboard.rb +0 -70
- data/lib/selenium/webdriver/common/mouse.rb +0 -89
- data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
- data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
- data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
- data/lib/selenium/webdriver/edge/bridge.rb +0 -76
- data/lib/selenium/webdriver/edge/driver.rb +0 -70
- data/lib/selenium/webdriver/firefox/binary.rb +0 -110
- data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +0 -111
- data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
- data/lib/selenium/webdriver/firefox/marionette/bridge.rb +0 -49
- data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/remote/oss/bridge.rb +0 -594
- data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
- data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
- data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
- data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
@@ -0,0 +1,62 @@
|
|
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 accessibility
|
25
|
+
@accessibility ||= Accessibility.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Accessibility
|
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["Accessibility.#{event}"] << block
|
37
|
+
end
|
38
|
+
|
39
|
+
def disable
|
40
|
+
@devtools.send_cmd('Accessibility.disable')
|
41
|
+
end
|
42
|
+
|
43
|
+
def enable
|
44
|
+
@devtools.send_cmd('Accessibility.enable')
|
45
|
+
end
|
46
|
+
|
47
|
+
def get_partial_axtree(node_id: nil, backend_node_id: nil, object_id: nil, fetch_relatives: nil)
|
48
|
+
@devtools.send_cmd('Accessibility.getPartialAXTree',
|
49
|
+
nodeId: node_id,
|
50
|
+
backendNodeId: backend_node_id,
|
51
|
+
objectId: object_id,
|
52
|
+
fetchRelatives: fetch_relatives)
|
53
|
+
end
|
54
|
+
|
55
|
+
def get_full_axtree
|
56
|
+
@devtools.send_cmd('Accessibility.getFullAXTree')
|
57
|
+
end
|
58
|
+
|
59
|
+
end # Accessibility
|
60
|
+
end # DevTools
|
61
|
+
end # WebDriver
|
62
|
+
end # Selenium
|
@@ -0,0 +1,98 @@
|
|
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 animation
|
25
|
+
@animation ||= Animation.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Animation
|
29
|
+
EVENTS = {
|
30
|
+
animation_canceled: 'animationCanceled',
|
31
|
+
animation_created: 'animationCreated',
|
32
|
+
animation_started: 'animationStarted',
|
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["Animation.#{event}"] << block
|
42
|
+
end
|
43
|
+
|
44
|
+
def disable
|
45
|
+
@devtools.send_cmd('Animation.disable')
|
46
|
+
end
|
47
|
+
|
48
|
+
def enable
|
49
|
+
@devtools.send_cmd('Animation.enable')
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_current_time(id:)
|
53
|
+
@devtools.send_cmd('Animation.getCurrentTime',
|
54
|
+
id: id)
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_playback_rate
|
58
|
+
@devtools.send_cmd('Animation.getPlaybackRate')
|
59
|
+
end
|
60
|
+
|
61
|
+
def release_animations(animations:)
|
62
|
+
@devtools.send_cmd('Animation.releaseAnimations',
|
63
|
+
animations: animations)
|
64
|
+
end
|
65
|
+
|
66
|
+
def resolve_animation(animation_id:)
|
67
|
+
@devtools.send_cmd('Animation.resolveAnimation',
|
68
|
+
animationId: animation_id)
|
69
|
+
end
|
70
|
+
|
71
|
+
def seek_animations(animations:, current_time:)
|
72
|
+
@devtools.send_cmd('Animation.seekAnimations',
|
73
|
+
animations: animations,
|
74
|
+
currentTime: current_time)
|
75
|
+
end
|
76
|
+
|
77
|
+
def set_paused(animations:, paused:)
|
78
|
+
@devtools.send_cmd('Animation.setPaused',
|
79
|
+
animations: animations,
|
80
|
+
paused: paused)
|
81
|
+
end
|
82
|
+
|
83
|
+
def set_playback_rate(playback_rate:)
|
84
|
+
@devtools.send_cmd('Animation.setPlaybackRate',
|
85
|
+
playbackRate: playback_rate)
|
86
|
+
end
|
87
|
+
|
88
|
+
def set_timing(animation_id:, duration:, delay:)
|
89
|
+
@devtools.send_cmd('Animation.setTiming',
|
90
|
+
animationId: animation_id,
|
91
|
+
duration: duration,
|
92
|
+
delay: delay)
|
93
|
+
end
|
94
|
+
|
95
|
+
end # Animation
|
96
|
+
end # DevTools
|
97
|
+
end # WebDriver
|
98
|
+
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 application_cache
|
25
|
+
@application_cache ||= ApplicationCache.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class ApplicationCache
|
29
|
+
EVENTS = {
|
30
|
+
application_cache_status_updated: 'applicationCacheStatusUpdated',
|
31
|
+
network_state_updated: 'networkStateUpdated',
|
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["ApplicationCache.#{event}"] << block
|
41
|
+
end
|
42
|
+
|
43
|
+
def enable
|
44
|
+
@devtools.send_cmd('ApplicationCache.enable')
|
45
|
+
end
|
46
|
+
|
47
|
+
def get_application_cache_for_frame(frame_id:)
|
48
|
+
@devtools.send_cmd('ApplicationCache.getApplicationCacheForFrame',
|
49
|
+
frameId: frame_id)
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_frames_with_manifests
|
53
|
+
@devtools.send_cmd('ApplicationCache.getFramesWithManifests')
|
54
|
+
end
|
55
|
+
|
56
|
+
def get_manifest_for_frame(frame_id:)
|
57
|
+
@devtools.send_cmd('ApplicationCache.getManifestForFrame',
|
58
|
+
frameId: frame_id)
|
59
|
+
end
|
60
|
+
|
61
|
+
end # ApplicationCache
|
62
|
+
end # DevTools
|
63
|
+
end # WebDriver
|
64
|
+
end # Selenium
|
@@ -0,0 +1,61 @@
|
|
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 audits
|
25
|
+
@audits ||= Audits.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Audits
|
29
|
+
EVENTS = {
|
30
|
+
issue_added: 'issueAdded',
|
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["Audits.#{event}"] << block
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_encoded_response(request_id:, encoding:, quality: nil, size_only: nil)
|
43
|
+
@devtools.send_cmd('Audits.getEncodedResponse',
|
44
|
+
requestId: request_id,
|
45
|
+
encoding: encoding,
|
46
|
+
quality: quality,
|
47
|
+
sizeOnly: size_only)
|
48
|
+
end
|
49
|
+
|
50
|
+
def disable
|
51
|
+
@devtools.send_cmd('Audits.disable')
|
52
|
+
end
|
53
|
+
|
54
|
+
def enable
|
55
|
+
@devtools.send_cmd('Audits.enable')
|
56
|
+
end
|
57
|
+
|
58
|
+
end # Audits
|
59
|
+
end # DevTools
|
60
|
+
end # WebDriver
|
61
|
+
end # Selenium
|
@@ -0,0 +1,67 @@
|
|
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 background_service
|
25
|
+
@background_service ||= BackgroundService.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class BackgroundService
|
29
|
+
EVENTS = {
|
30
|
+
recording_state_changed: 'recordingStateChanged',
|
31
|
+
background_service_event_received: 'backgroundServiceEventReceived',
|
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["BackgroundService.#{event}"] << block
|
41
|
+
end
|
42
|
+
|
43
|
+
def start_observing(service:)
|
44
|
+
@devtools.send_cmd('BackgroundService.startObserving',
|
45
|
+
service: service)
|
46
|
+
end
|
47
|
+
|
48
|
+
def stop_observing(service:)
|
49
|
+
@devtools.send_cmd('BackgroundService.stopObserving',
|
50
|
+
service: service)
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_recording(should_record:, service:)
|
54
|
+
@devtools.send_cmd('BackgroundService.setRecording',
|
55
|
+
shouldRecord: should_record,
|
56
|
+
service: service)
|
57
|
+
end
|
58
|
+
|
59
|
+
def clear_events(service:)
|
60
|
+
@devtools.send_cmd('BackgroundService.clearEvents',
|
61
|
+
service: service)
|
62
|
+
end
|
63
|
+
|
64
|
+
end # BackgroundService
|
65
|
+
end # DevTools
|
66
|
+
end # WebDriver
|
67
|
+
end # Selenium
|
@@ -0,0 +1,123 @@
|
|
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 browser
|
25
|
+
@browser ||= Browser.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Browser
|
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["Browser.#{event}"] << block
|
37
|
+
end
|
38
|
+
|
39
|
+
def set_permission(permission:, setting:, origin: nil, browser_context_id: nil)
|
40
|
+
@devtools.send_cmd('Browser.setPermission',
|
41
|
+
permission: permission,
|
42
|
+
setting: setting,
|
43
|
+
origin: origin,
|
44
|
+
browserContextId: browser_context_id)
|
45
|
+
end
|
46
|
+
|
47
|
+
def grant_permissions(permissions:, origin: nil, browser_context_id: nil)
|
48
|
+
@devtools.send_cmd('Browser.grantPermissions',
|
49
|
+
permissions: permissions,
|
50
|
+
origin: origin,
|
51
|
+
browserContextId: browser_context_id)
|
52
|
+
end
|
53
|
+
|
54
|
+
def reset_permissions(browser_context_id: nil)
|
55
|
+
@devtools.send_cmd('Browser.resetPermissions',
|
56
|
+
browserContextId: browser_context_id)
|
57
|
+
end
|
58
|
+
|
59
|
+
def set_download_behavior(behavior:, browser_context_id: nil, download_path: nil)
|
60
|
+
@devtools.send_cmd('Browser.setDownloadBehavior',
|
61
|
+
behavior: behavior,
|
62
|
+
browserContextId: browser_context_id,
|
63
|
+
downloadPath: download_path)
|
64
|
+
end
|
65
|
+
|
66
|
+
def close
|
67
|
+
@devtools.send_cmd('Browser.close')
|
68
|
+
end
|
69
|
+
|
70
|
+
def crash
|
71
|
+
@devtools.send_cmd('Browser.crash')
|
72
|
+
end
|
73
|
+
|
74
|
+
def crash_gpu_process
|
75
|
+
@devtools.send_cmd('Browser.crashGpuProcess')
|
76
|
+
end
|
77
|
+
|
78
|
+
def get_version
|
79
|
+
@devtools.send_cmd('Browser.getVersion')
|
80
|
+
end
|
81
|
+
|
82
|
+
def get_browser_command_line
|
83
|
+
@devtools.send_cmd('Browser.getBrowserCommandLine')
|
84
|
+
end
|
85
|
+
|
86
|
+
def get_histograms(query: nil, delta: nil)
|
87
|
+
@devtools.send_cmd('Browser.getHistograms',
|
88
|
+
query: query,
|
89
|
+
delta: delta)
|
90
|
+
end
|
91
|
+
|
92
|
+
def get_histogram(name:, delta: nil)
|
93
|
+
@devtools.send_cmd('Browser.getHistogram',
|
94
|
+
name: name,
|
95
|
+
delta: delta)
|
96
|
+
end
|
97
|
+
|
98
|
+
def get_window_bounds(window_id:)
|
99
|
+
@devtools.send_cmd('Browser.getWindowBounds',
|
100
|
+
windowId: window_id)
|
101
|
+
end
|
102
|
+
|
103
|
+
def get_window_for_target(target_id: nil)
|
104
|
+
@devtools.send_cmd('Browser.getWindowForTarget',
|
105
|
+
targetId: target_id)
|
106
|
+
end
|
107
|
+
|
108
|
+
def set_window_bounds(window_id:, bounds:)
|
109
|
+
@devtools.send_cmd('Browser.setWindowBounds',
|
110
|
+
windowId: window_id,
|
111
|
+
bounds: bounds)
|
112
|
+
end
|
113
|
+
|
114
|
+
def set_dock_tile(badge_label: nil, image: nil)
|
115
|
+
@devtools.send_cmd('Browser.setDockTile',
|
116
|
+
badgeLabel: badge_label,
|
117
|
+
image: image)
|
118
|
+
end
|
119
|
+
|
120
|
+
end # Browser
|
121
|
+
end # DevTools
|
122
|
+
end # WebDriver
|
123
|
+
end # Selenium
|