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,116 @@
|
|
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 service_worker
|
25
|
+
@service_worker ||= ServiceWorker.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class ServiceWorker
|
29
|
+
EVENTS = {
|
30
|
+
worker_error_reported: 'workerErrorReported',
|
31
|
+
worker_registration_updated: 'workerRegistrationUpdated',
|
32
|
+
worker_version_updated: 'workerVersionUpdated',
|
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["ServiceWorker.#{event}"] << block
|
42
|
+
end
|
43
|
+
|
44
|
+
def deliver_push_message(origin:, registration_id:, data:)
|
45
|
+
@devtools.send_cmd('ServiceWorker.deliverPushMessage',
|
46
|
+
origin: origin,
|
47
|
+
registrationId: registration_id,
|
48
|
+
data: data)
|
49
|
+
end
|
50
|
+
|
51
|
+
def disable
|
52
|
+
@devtools.send_cmd('ServiceWorker.disable')
|
53
|
+
end
|
54
|
+
|
55
|
+
def dispatch_sync_event(origin:, registration_id:, tag:, last_chance:)
|
56
|
+
@devtools.send_cmd('ServiceWorker.dispatchSyncEvent',
|
57
|
+
origin: origin,
|
58
|
+
registrationId: registration_id,
|
59
|
+
tag: tag,
|
60
|
+
lastChance: last_chance)
|
61
|
+
end
|
62
|
+
|
63
|
+
def dispatch_periodic_sync_event(origin:, registration_id:, tag:)
|
64
|
+
@devtools.send_cmd('ServiceWorker.dispatchPeriodicSyncEvent',
|
65
|
+
origin: origin,
|
66
|
+
registrationId: registration_id,
|
67
|
+
tag: tag)
|
68
|
+
end
|
69
|
+
|
70
|
+
def enable
|
71
|
+
@devtools.send_cmd('ServiceWorker.enable')
|
72
|
+
end
|
73
|
+
|
74
|
+
def inspect_worker(version_id:)
|
75
|
+
@devtools.send_cmd('ServiceWorker.inspectWorker',
|
76
|
+
versionId: version_id)
|
77
|
+
end
|
78
|
+
|
79
|
+
def set_force_update_on_page_load(force_update_on_page_load:)
|
80
|
+
@devtools.send_cmd('ServiceWorker.setForceUpdateOnPageLoad',
|
81
|
+
forceUpdateOnPageLoad: force_update_on_page_load)
|
82
|
+
end
|
83
|
+
|
84
|
+
def skip_waiting(scope_url:)
|
85
|
+
@devtools.send_cmd('ServiceWorker.skipWaiting',
|
86
|
+
scopeURL: scope_url)
|
87
|
+
end
|
88
|
+
|
89
|
+
def start_worker(scope_url:)
|
90
|
+
@devtools.send_cmd('ServiceWorker.startWorker',
|
91
|
+
scopeURL: scope_url)
|
92
|
+
end
|
93
|
+
|
94
|
+
def stop_all_workers
|
95
|
+
@devtools.send_cmd('ServiceWorker.stopAllWorkers')
|
96
|
+
end
|
97
|
+
|
98
|
+
def stop_worker(version_id:)
|
99
|
+
@devtools.send_cmd('ServiceWorker.stopWorker',
|
100
|
+
versionId: version_id)
|
101
|
+
end
|
102
|
+
|
103
|
+
def unregister(scope_url:)
|
104
|
+
@devtools.send_cmd('ServiceWorker.unregister',
|
105
|
+
scopeURL: scope_url)
|
106
|
+
end
|
107
|
+
|
108
|
+
def update_registration(scope_url:)
|
109
|
+
@devtools.send_cmd('ServiceWorker.updateRegistration',
|
110
|
+
scopeURL: scope_url)
|
111
|
+
end
|
112
|
+
|
113
|
+
end # ServiceWorker
|
114
|
+
end # DevTools
|
115
|
+
end # WebDriver
|
116
|
+
end # Selenium
|
@@ -0,0 +1,95 @@
|
|
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 storage
|
25
|
+
@storage ||= Storage.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Storage
|
29
|
+
EVENTS = {
|
30
|
+
cache_storage_content_updated: 'cacheStorageContentUpdated',
|
31
|
+
cache_storage_list_updated: 'cacheStorageListUpdated',
|
32
|
+
indexed_dbcontent_updated: 'indexedDBContentUpdated',
|
33
|
+
indexed_dblist_updated: 'indexedDBListUpdated',
|
34
|
+
}
|
35
|
+
|
36
|
+
def initialize(devtools)
|
37
|
+
@devtools = devtools
|
38
|
+
end
|
39
|
+
|
40
|
+
def on(event, &block)
|
41
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
42
|
+
@devtools.callbacks["Storage.#{event}"] << block
|
43
|
+
end
|
44
|
+
|
45
|
+
def clear_data_for_origin(origin:, storage_types:)
|
46
|
+
@devtools.send_cmd('Storage.clearDataForOrigin',
|
47
|
+
origin: origin,
|
48
|
+
storageTypes: storage_types)
|
49
|
+
end
|
50
|
+
|
51
|
+
def get_cookies(browser_context_id: nil)
|
52
|
+
@devtools.send_cmd('Storage.getCookies',
|
53
|
+
browserContextId: browser_context_id)
|
54
|
+
end
|
55
|
+
|
56
|
+
def set_cookies(cookies:, browser_context_id: nil)
|
57
|
+
@devtools.send_cmd('Storage.setCookies',
|
58
|
+
cookies: cookies,
|
59
|
+
browserContextId: browser_context_id)
|
60
|
+
end
|
61
|
+
|
62
|
+
def clear_cookies(browser_context_id: nil)
|
63
|
+
@devtools.send_cmd('Storage.clearCookies',
|
64
|
+
browserContextId: browser_context_id)
|
65
|
+
end
|
66
|
+
|
67
|
+
def get_usage_and_quota(origin:)
|
68
|
+
@devtools.send_cmd('Storage.getUsageAndQuota',
|
69
|
+
origin: origin)
|
70
|
+
end
|
71
|
+
|
72
|
+
def track_cache_storage_for_origin(origin:)
|
73
|
+
@devtools.send_cmd('Storage.trackCacheStorageForOrigin',
|
74
|
+
origin: origin)
|
75
|
+
end
|
76
|
+
|
77
|
+
def track_indexed_dbfor_origin(origin:)
|
78
|
+
@devtools.send_cmd('Storage.trackIndexedDBForOrigin',
|
79
|
+
origin: origin)
|
80
|
+
end
|
81
|
+
|
82
|
+
def untrack_cache_storage_for_origin(origin:)
|
83
|
+
@devtools.send_cmd('Storage.untrackCacheStorageForOrigin',
|
84
|
+
origin: origin)
|
85
|
+
end
|
86
|
+
|
87
|
+
def untrack_indexed_dbfor_origin(origin:)
|
88
|
+
@devtools.send_cmd('Storage.untrackIndexedDBForOrigin',
|
89
|
+
origin: origin)
|
90
|
+
end
|
91
|
+
|
92
|
+
end # Storage
|
93
|
+
end # DevTools
|
94
|
+
end # WebDriver
|
95
|
+
end # Selenium
|
@@ -0,0 +1,50 @@
|
|
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 system_info
|
25
|
+
@system_info ||= SystemInfo.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class SystemInfo
|
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["SystemInfo.#{event}"] << block
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_info
|
40
|
+
@devtools.send_cmd('SystemInfo.getInfo')
|
41
|
+
end
|
42
|
+
|
43
|
+
def get_process_info
|
44
|
+
@devtools.send_cmd('SystemInfo.getProcessInfo')
|
45
|
+
end
|
46
|
+
|
47
|
+
end # SystemInfo
|
48
|
+
end # DevTools
|
49
|
+
end # WebDriver
|
50
|
+
end # Selenium
|
@@ -0,0 +1,141 @@
|
|
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 target
|
25
|
+
@target ||= Target.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Target
|
29
|
+
EVENTS = {
|
30
|
+
attached_to_target: 'attachedToTarget',
|
31
|
+
detached_from_target: 'detachedFromTarget',
|
32
|
+
received_message_from_target: 'receivedMessageFromTarget',
|
33
|
+
target_created: 'targetCreated',
|
34
|
+
target_destroyed: 'targetDestroyed',
|
35
|
+
target_crashed: 'targetCrashed',
|
36
|
+
target_info_changed: 'targetInfoChanged',
|
37
|
+
}
|
38
|
+
|
39
|
+
def initialize(devtools)
|
40
|
+
@devtools = devtools
|
41
|
+
end
|
42
|
+
|
43
|
+
def on(event, &block)
|
44
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
45
|
+
@devtools.callbacks["Target.#{event}"] << block
|
46
|
+
end
|
47
|
+
|
48
|
+
def activate_target(target_id:)
|
49
|
+
@devtools.send_cmd('Target.activateTarget',
|
50
|
+
targetId: target_id)
|
51
|
+
end
|
52
|
+
|
53
|
+
def attach_to_target(target_id:, flatten: nil)
|
54
|
+
@devtools.send_cmd('Target.attachToTarget',
|
55
|
+
targetId: target_id,
|
56
|
+
flatten: flatten)
|
57
|
+
end
|
58
|
+
|
59
|
+
def attach_to_browser_target
|
60
|
+
@devtools.send_cmd('Target.attachToBrowserTarget')
|
61
|
+
end
|
62
|
+
|
63
|
+
def close_target(target_id:)
|
64
|
+
@devtools.send_cmd('Target.closeTarget',
|
65
|
+
targetId: target_id)
|
66
|
+
end
|
67
|
+
|
68
|
+
def expose_dev_tools_protocol(target_id:, binding_name: nil)
|
69
|
+
@devtools.send_cmd('Target.exposeDevToolsProtocol',
|
70
|
+
targetId: target_id,
|
71
|
+
bindingName: binding_name)
|
72
|
+
end
|
73
|
+
|
74
|
+
def create_browser_context(dispose_on_detach: nil)
|
75
|
+
@devtools.send_cmd('Target.createBrowserContext',
|
76
|
+
disposeOnDetach: dispose_on_detach)
|
77
|
+
end
|
78
|
+
|
79
|
+
def get_browser_contexts
|
80
|
+
@devtools.send_cmd('Target.getBrowserContexts')
|
81
|
+
end
|
82
|
+
|
83
|
+
def create_target(url:, width: nil, height: nil, browser_context_id: nil, enable_begin_frame_control: nil, new_window: nil, background: nil)
|
84
|
+
@devtools.send_cmd('Target.createTarget',
|
85
|
+
url: url,
|
86
|
+
width: width,
|
87
|
+
height: height,
|
88
|
+
browserContextId: browser_context_id,
|
89
|
+
enableBeginFrameControl: enable_begin_frame_control,
|
90
|
+
newWindow: new_window,
|
91
|
+
background: background)
|
92
|
+
end
|
93
|
+
|
94
|
+
def detach_from_target(session_id: nil, target_id: nil)
|
95
|
+
@devtools.send_cmd('Target.detachFromTarget',
|
96
|
+
sessionId: session_id,
|
97
|
+
targetId: target_id)
|
98
|
+
end
|
99
|
+
|
100
|
+
def dispose_browser_context(browser_context_id:)
|
101
|
+
@devtools.send_cmd('Target.disposeBrowserContext',
|
102
|
+
browserContextId: browser_context_id)
|
103
|
+
end
|
104
|
+
|
105
|
+
def get_target_info(target_id: nil)
|
106
|
+
@devtools.send_cmd('Target.getTargetInfo',
|
107
|
+
targetId: target_id)
|
108
|
+
end
|
109
|
+
|
110
|
+
def get_targets
|
111
|
+
@devtools.send_cmd('Target.getTargets')
|
112
|
+
end
|
113
|
+
|
114
|
+
def send_message_to_target(message:, session_id: nil, target_id: nil)
|
115
|
+
@devtools.send_cmd('Target.sendMessageToTarget',
|
116
|
+
message: message,
|
117
|
+
sessionId: session_id,
|
118
|
+
targetId: target_id)
|
119
|
+
end
|
120
|
+
|
121
|
+
def set_auto_attach(auto_attach:, wait_for_debugger_on_start:, flatten: nil)
|
122
|
+
@devtools.send_cmd('Target.setAutoAttach',
|
123
|
+
autoAttach: auto_attach,
|
124
|
+
waitForDebuggerOnStart: wait_for_debugger_on_start,
|
125
|
+
flatten: flatten)
|
126
|
+
end
|
127
|
+
|
128
|
+
def set_discover_targets(discover:)
|
129
|
+
@devtools.send_cmd('Target.setDiscoverTargets',
|
130
|
+
discover: discover)
|
131
|
+
end
|
132
|
+
|
133
|
+
def set_remote_locations(locations:)
|
134
|
+
@devtools.send_cmd('Target.setRemoteLocations',
|
135
|
+
locations: locations)
|
136
|
+
end
|
137
|
+
|
138
|
+
end # Target
|
139
|
+
end # DevTools
|
140
|
+
end # WebDriver
|
141
|
+
end # Selenium
|
@@ -0,0 +1,55 @@
|
|
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 tethering
|
25
|
+
@tethering ||= Tethering.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Tethering
|
29
|
+
EVENTS = {
|
30
|
+
accepted: 'accepted',
|
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["Tethering.#{event}"] << block
|
40
|
+
end
|
41
|
+
|
42
|
+
def bind(port:)
|
43
|
+
@devtools.send_cmd('Tethering.bind',
|
44
|
+
port: port)
|
45
|
+
end
|
46
|
+
|
47
|
+
def unbind(port:)
|
48
|
+
@devtools.send_cmd('Tethering.unbind',
|
49
|
+
port: port)
|
50
|
+
end
|
51
|
+
|
52
|
+
end # Tethering
|
53
|
+
end # DevTools
|
54
|
+
end # WebDriver
|
55
|
+
end # Selenium
|