selenium-webdriver 4.0.0.alpha6 → 4.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +137 -4
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/NOTICE +2 -0
- data/README.md +4 -5
- data/lib/selenium/server.rb +18 -26
- data/lib/selenium/webdriver.rb +1 -4
- data/lib/selenium/webdriver/atoms/findElements.js +93 -93
- data/lib/selenium/webdriver/atoms/getAttribute.js +75 -59
- data/lib/selenium/webdriver/atoms/isDisplayed.js +72 -72
- data/lib/selenium/webdriver/atoms/mutationListener.js +55 -0
- data/lib/selenium/webdriver/chrome.rb +1 -1
- data/lib/selenium/webdriver/chrome/driver.rb +25 -10
- data/lib/selenium/webdriver/chrome/{bridge.rb → features.rb} +3 -3
- data/lib/selenium/webdriver/chrome/options.rb +51 -39
- data/lib/selenium/webdriver/chrome/profile.rb +6 -3
- data/lib/selenium/webdriver/chrome/service.rb +4 -2
- data/lib/selenium/webdriver/common.rb +8 -2
- data/lib/selenium/webdriver/common/driver.rb +36 -8
- data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +43 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +89 -0
- data/lib/selenium/webdriver/{edge_html/driver.rb → common/driver_extensions/has_cdp.rb} +12 -13
- data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +6 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +5 -8
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +149 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_logs.rb +30 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +6 -27
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +67 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +1 -0
- data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
- data/lib/selenium/webdriver/common/element.rb +66 -12
- data/lib/selenium/webdriver/common/interactions/interaction.rb +4 -1
- data/lib/selenium/webdriver/common/logger.rb +5 -2
- data/lib/selenium/webdriver/common/manager.rb +6 -1
- data/lib/selenium/webdriver/common/options.rb +76 -14
- data/lib/selenium/webdriver/common/platform.rb +3 -1
- data/lib/selenium/webdriver/common/proxy.rb +6 -3
- data/lib/selenium/webdriver/common/search_context.rb +4 -1
- data/lib/selenium/webdriver/common/service.rb +1 -8
- data/lib/selenium/webdriver/common/service_manager.rb +1 -1
- data/lib/selenium/webdriver/common/socket_poller.rb +19 -30
- data/lib/selenium/webdriver/common/takes_screenshot.rb +66 -0
- data/lib/selenium/webdriver/common/target_locator.rb +4 -4
- data/lib/selenium/webdriver/devtools.rb +44 -18
- data/lib/selenium/webdriver/devtools/console_event.rb +38 -0
- data/lib/selenium/webdriver/devtools/exception_event.rb +36 -0
- data/lib/selenium/webdriver/devtools/mutation_event.rb +37 -0
- data/lib/selenium/webdriver/devtools/{console.rb → request.rb} +22 -22
- data/lib/selenium/webdriver/edge.rb +7 -29
- data/lib/selenium/webdriver/{edge_chrome → edge}/driver.rb +8 -6
- data/lib/selenium/webdriver/{edge_chrome/bridge.rb → edge/features.rb} +9 -7
- data/lib/selenium/webdriver/{edge_chrome → edge}/options.rb +11 -4
- data/lib/selenium/webdriver/{edge_chrome → edge}/profile.rb +2 -2
- data/lib/selenium/webdriver/{edge_chrome → edge}/service.rb +2 -2
- data/lib/selenium/webdriver/firefox.rb +5 -1
- data/lib/selenium/webdriver/firefox/driver.rb +18 -5
- data/lib/selenium/webdriver/firefox/{bridge.rb → features.rb} +9 -4
- data/lib/selenium/webdriver/firefox/options.rb +20 -21
- data/lib/selenium/webdriver/firefox/profile.rb +12 -2
- data/lib/selenium/webdriver/firefox/service.rb +1 -1
- data/lib/selenium/webdriver/ie/driver.rb +1 -2
- data/lib/selenium/webdriver/ie/options.rb +1 -11
- data/lib/selenium/webdriver/ie/service.rb +4 -2
- data/lib/selenium/webdriver/remote/bridge.rb +48 -30
- data/lib/selenium/webdriver/remote/capabilities.rb +105 -64
- data/lib/selenium/webdriver/remote/commands.rb +3 -0
- data/lib/selenium/webdriver/remote/driver.rb +10 -3
- data/lib/selenium/webdriver/remote/http/common.rb +0 -5
- data/lib/selenium/webdriver/remote/http/default.rb +8 -7
- data/lib/selenium/webdriver/remote/http/persistent.rb +6 -0
- data/lib/selenium/webdriver/safari.rb +8 -1
- data/lib/selenium/webdriver/safari/driver.rb +3 -8
- data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +3 -3
- data/lib/selenium/webdriver/safari/options.rb +0 -25
- data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
- data/lib/selenium/webdriver/support/cdp/domain.rb.erb +63 -0
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +44 -13
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +1 -1
- data/lib/selenium/webdriver/support/guards.rb +95 -0
- data/lib/selenium/webdriver/support/guards/guard.rb +89 -0
- data/lib/selenium/webdriver/support/guards/guard_condition.rb +52 -0
- data/lib/selenium/webdriver/support/select.rb +2 -2
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +26 -12
- metadata +91 -108
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +0 -65
- data/lib/selenium/webdriver/devtools/accessibility.rb +0 -62
- data/lib/selenium/webdriver/devtools/animation.rb +0 -98
- data/lib/selenium/webdriver/devtools/application_cache.rb +0 -64
- data/lib/selenium/webdriver/devtools/audits.rb +0 -61
- data/lib/selenium/webdriver/devtools/background_service.rb +0 -67
- data/lib/selenium/webdriver/devtools/browser.rb +0 -123
- data/lib/selenium/webdriver/devtools/cache_storage.rb +0 -73
- data/lib/selenium/webdriver/devtools/cast.rb +0 -70
- data/lib/selenium/webdriver/devtools/css.rb +0 -165
- data/lib/selenium/webdriver/devtools/database.rb +0 -64
- data/lib/selenium/webdriver/devtools/debugger.rb +0 -229
- data/lib/selenium/webdriver/devtools/device_orientation.rb +0 -53
- data/lib/selenium/webdriver/devtools/dom.rb +0 -320
- data/lib/selenium/webdriver/devtools/domdebugger.rb +0 -93
- data/lib/selenium/webdriver/devtools/domsnapshot.rb +0 -65
- data/lib/selenium/webdriver/devtools/domstorage.rb +0 -79
- data/lib/selenium/webdriver/devtools/emulation.rb +0 -180
- data/lib/selenium/webdriver/devtools/fetch.rb +0 -97
- data/lib/selenium/webdriver/devtools/headless_experimental.rb +0 -61
- data/lib/selenium/webdriver/devtools/heap_profiler.rb +0 -107
- data/lib/selenium/webdriver/devtools/indexed_db.rb +0 -100
- data/lib/selenium/webdriver/devtools/input.rb +0 -140
- data/lib/selenium/webdriver/devtools/inspector.rb +0 -55
- data/lib/selenium/webdriver/devtools/io.rb +0 -59
- data/lib/selenium/webdriver/devtools/layer_tree.rb +0 -95
- data/lib/selenium/webdriver/devtools/log.rb +0 -66
- data/lib/selenium/webdriver/devtools/media.rb +0 -57
- data/lib/selenium/webdriver/devtools/memory.rb +0 -86
- data/lib/selenium/webdriver/devtools/network.rb +0 -228
- data/lib/selenium/webdriver/devtools/overlay.rb +0 -157
- data/lib/selenium/webdriver/devtools/page.rb +0 -374
- data/lib/selenium/webdriver/devtools/performance.rb +0 -63
- data/lib/selenium/webdriver/devtools/profiler.rb +0 -111
- data/lib/selenium/webdriver/devtools/runtime.rb +0 -193
- data/lib/selenium/webdriver/devtools/schema.rb +0 -46
- data/lib/selenium/webdriver/devtools/security.rb +0 -71
- data/lib/selenium/webdriver/devtools/service_worker.rb +0 -116
- data/lib/selenium/webdriver/devtools/storage.rb +0 -95
- data/lib/selenium/webdriver/devtools/system_info.rb +0 -50
- data/lib/selenium/webdriver/devtools/target.rb +0 -141
- data/lib/selenium/webdriver/devtools/tethering.rb +0 -55
- data/lib/selenium/webdriver/devtools/tracing.rb +0 -76
- data/lib/selenium/webdriver/devtools/web_audio.rb +0 -70
- data/lib/selenium/webdriver/devtools/web_authn.rb +0 -94
- data/lib/selenium/webdriver/edge_html/options.rb +0 -84
- data/lib/selenium/webdriver/edge_html/service.rb +0 -47
@@ -1,107 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
# This file is automatically generated. Any changes will be lost!
|
21
|
-
module Selenium
|
22
|
-
module WebDriver
|
23
|
-
class DevTools
|
24
|
-
def heap_profiler
|
25
|
-
@heap_profiler ||= HeapProfiler.new(self)
|
26
|
-
end
|
27
|
-
|
28
|
-
class HeapProfiler
|
29
|
-
EVENTS = {
|
30
|
-
add_heap_snapshot_chunk: 'addHeapSnapshotChunk',
|
31
|
-
heap_stats_update: 'heapStatsUpdate',
|
32
|
-
last_seen_object_id: 'lastSeenObjectId',
|
33
|
-
report_heap_snapshot_progress: 'reportHeapSnapshotProgress',
|
34
|
-
reset_profiles: 'resetProfiles',
|
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["HeapProfiler.#{event}"] << block
|
44
|
-
end
|
45
|
-
|
46
|
-
def add_inspected_heap_object(heap_object_id:)
|
47
|
-
@devtools.send_cmd('HeapProfiler.addInspectedHeapObject',
|
48
|
-
heapObjectId: heap_object_id)
|
49
|
-
end
|
50
|
-
|
51
|
-
def collect_garbage
|
52
|
-
@devtools.send_cmd('HeapProfiler.collectGarbage')
|
53
|
-
end
|
54
|
-
|
55
|
-
def disable
|
56
|
-
@devtools.send_cmd('HeapProfiler.disable')
|
57
|
-
end
|
58
|
-
|
59
|
-
def enable
|
60
|
-
@devtools.send_cmd('HeapProfiler.enable')
|
61
|
-
end
|
62
|
-
|
63
|
-
def get_heap_object_id(object_id:)
|
64
|
-
@devtools.send_cmd('HeapProfiler.getHeapObjectId',
|
65
|
-
objectId: object_id)
|
66
|
-
end
|
67
|
-
|
68
|
-
def get_object_by_heap_object_id(object_id:, object_group: nil)
|
69
|
-
@devtools.send_cmd('HeapProfiler.getObjectByHeapObjectId',
|
70
|
-
objectId: object_id,
|
71
|
-
objectGroup: object_group)
|
72
|
-
end
|
73
|
-
|
74
|
-
def get_sampling_profile
|
75
|
-
@devtools.send_cmd('HeapProfiler.getSamplingProfile')
|
76
|
-
end
|
77
|
-
|
78
|
-
def start_sampling(sampling_interval: nil)
|
79
|
-
@devtools.send_cmd('HeapProfiler.startSampling',
|
80
|
-
samplingInterval: sampling_interval)
|
81
|
-
end
|
82
|
-
|
83
|
-
def start_tracking_heap_objects(track_allocations: nil)
|
84
|
-
@devtools.send_cmd('HeapProfiler.startTrackingHeapObjects',
|
85
|
-
trackAllocations: track_allocations)
|
86
|
-
end
|
87
|
-
|
88
|
-
def stop_sampling
|
89
|
-
@devtools.send_cmd('HeapProfiler.stopSampling')
|
90
|
-
end
|
91
|
-
|
92
|
-
def stop_tracking_heap_objects(report_progress: nil, treat_global_objects_as_roots: nil)
|
93
|
-
@devtools.send_cmd('HeapProfiler.stopTrackingHeapObjects',
|
94
|
-
reportProgress: report_progress,
|
95
|
-
treatGlobalObjectsAsRoots: treat_global_objects_as_roots)
|
96
|
-
end
|
97
|
-
|
98
|
-
def take_heap_snapshot(report_progress: nil, treat_global_objects_as_roots: nil)
|
99
|
-
@devtools.send_cmd('HeapProfiler.takeHeapSnapshot',
|
100
|
-
reportProgress: report_progress,
|
101
|
-
treatGlobalObjectsAsRoots: treat_global_objects_as_roots)
|
102
|
-
end
|
103
|
-
|
104
|
-
end # HeapProfiler
|
105
|
-
end # DevTools
|
106
|
-
end # WebDriver
|
107
|
-
end # Selenium
|
@@ -1,100 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
# This file is automatically generated. Any changes will be lost!
|
21
|
-
module Selenium
|
22
|
-
module WebDriver
|
23
|
-
class DevTools
|
24
|
-
def indexed_db
|
25
|
-
@indexed_db ||= IndexedDB.new(self)
|
26
|
-
end
|
27
|
-
|
28
|
-
class IndexedDB
|
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["IndexedDB.#{event}"] << block
|
37
|
-
end
|
38
|
-
|
39
|
-
def clear_object_store(security_origin:, database_name:, object_store_name:)
|
40
|
-
@devtools.send_cmd('IndexedDB.clearObjectStore',
|
41
|
-
securityOrigin: security_origin,
|
42
|
-
databaseName: database_name,
|
43
|
-
objectStoreName: object_store_name)
|
44
|
-
end
|
45
|
-
|
46
|
-
def delete_database(security_origin:, database_name:)
|
47
|
-
@devtools.send_cmd('IndexedDB.deleteDatabase',
|
48
|
-
securityOrigin: security_origin,
|
49
|
-
databaseName: database_name)
|
50
|
-
end
|
51
|
-
|
52
|
-
def delete_object_store_entries(security_origin:, database_name:, object_store_name:, key_range:)
|
53
|
-
@devtools.send_cmd('IndexedDB.deleteObjectStoreEntries',
|
54
|
-
securityOrigin: security_origin,
|
55
|
-
databaseName: database_name,
|
56
|
-
objectStoreName: object_store_name,
|
57
|
-
keyRange: key_range)
|
58
|
-
end
|
59
|
-
|
60
|
-
def disable
|
61
|
-
@devtools.send_cmd('IndexedDB.disable')
|
62
|
-
end
|
63
|
-
|
64
|
-
def enable
|
65
|
-
@devtools.send_cmd('IndexedDB.enable')
|
66
|
-
end
|
67
|
-
|
68
|
-
def request_data(security_origin:, database_name:, object_store_name:, index_name:, skip_count:, page_size:, key_range: nil)
|
69
|
-
@devtools.send_cmd('IndexedDB.requestData',
|
70
|
-
securityOrigin: security_origin,
|
71
|
-
databaseName: database_name,
|
72
|
-
objectStoreName: object_store_name,
|
73
|
-
indexName: index_name,
|
74
|
-
skipCount: skip_count,
|
75
|
-
pageSize: page_size,
|
76
|
-
keyRange: key_range)
|
77
|
-
end
|
78
|
-
|
79
|
-
def get_metadata(security_origin:, database_name:, object_store_name:)
|
80
|
-
@devtools.send_cmd('IndexedDB.getMetadata',
|
81
|
-
securityOrigin: security_origin,
|
82
|
-
databaseName: database_name,
|
83
|
-
objectStoreName: object_store_name)
|
84
|
-
end
|
85
|
-
|
86
|
-
def request_database(security_origin:, database_name:)
|
87
|
-
@devtools.send_cmd('IndexedDB.requestDatabase',
|
88
|
-
securityOrigin: security_origin,
|
89
|
-
databaseName: database_name)
|
90
|
-
end
|
91
|
-
|
92
|
-
def request_database_names(security_origin:)
|
93
|
-
@devtools.send_cmd('IndexedDB.requestDatabaseNames',
|
94
|
-
securityOrigin: security_origin)
|
95
|
-
end
|
96
|
-
|
97
|
-
end # IndexedDB
|
98
|
-
end # DevTools
|
99
|
-
end # WebDriver
|
100
|
-
end # Selenium
|
@@ -1,140 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
# This file is automatically generated. Any changes will be lost!
|
21
|
-
module Selenium
|
22
|
-
module WebDriver
|
23
|
-
class DevTools
|
24
|
-
def input
|
25
|
-
@input ||= Input.new(self)
|
26
|
-
end
|
27
|
-
|
28
|
-
class Input
|
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["Input.#{event}"] << block
|
37
|
-
end
|
38
|
-
|
39
|
-
def dispatch_key_event(type:, modifiers: nil, timestamp: nil, text: nil, unmodified_text: nil, key_identifier: nil, code: nil, key: nil, windows_virtual_key_code: nil, native_virtual_key_code: nil, auto_repeat: nil, is_keypad: nil, is_system_key: nil, location: nil)
|
40
|
-
@devtools.send_cmd('Input.dispatchKeyEvent',
|
41
|
-
type: type,
|
42
|
-
modifiers: modifiers,
|
43
|
-
timestamp: timestamp,
|
44
|
-
text: text,
|
45
|
-
unmodifiedText: unmodified_text,
|
46
|
-
keyIdentifier: key_identifier,
|
47
|
-
code: code,
|
48
|
-
key: key,
|
49
|
-
windowsVirtualKeyCode: windows_virtual_key_code,
|
50
|
-
nativeVirtualKeyCode: native_virtual_key_code,
|
51
|
-
autoRepeat: auto_repeat,
|
52
|
-
isKeypad: is_keypad,
|
53
|
-
isSystemKey: is_system_key,
|
54
|
-
location: location)
|
55
|
-
end
|
56
|
-
|
57
|
-
def insert_text(text:)
|
58
|
-
@devtools.send_cmd('Input.insertText',
|
59
|
-
text: text)
|
60
|
-
end
|
61
|
-
|
62
|
-
def dispatch_mouse_event(type:, x:, y:, modifiers: nil, timestamp: nil, button: nil, buttons: nil, click_count: nil, delta_x: nil, delta_y: nil, pointer_type: nil)
|
63
|
-
@devtools.send_cmd('Input.dispatchMouseEvent',
|
64
|
-
type: type,
|
65
|
-
x: x,
|
66
|
-
y: y,
|
67
|
-
modifiers: modifiers,
|
68
|
-
timestamp: timestamp,
|
69
|
-
button: button,
|
70
|
-
buttons: buttons,
|
71
|
-
clickCount: click_count,
|
72
|
-
deltaX: delta_x,
|
73
|
-
deltaY: delta_y,
|
74
|
-
pointerType: pointer_type)
|
75
|
-
end
|
76
|
-
|
77
|
-
def dispatch_touch_event(type:, touch_points:, modifiers: nil, timestamp: nil)
|
78
|
-
@devtools.send_cmd('Input.dispatchTouchEvent',
|
79
|
-
type: type,
|
80
|
-
touchPoints: touch_points,
|
81
|
-
modifiers: modifiers,
|
82
|
-
timestamp: timestamp)
|
83
|
-
end
|
84
|
-
|
85
|
-
def emulate_touch_from_mouse_event(type:, x:, y:, button:, timestamp: nil, delta_x: nil, delta_y: nil, modifiers: nil, click_count: nil)
|
86
|
-
@devtools.send_cmd('Input.emulateTouchFromMouseEvent',
|
87
|
-
type: type,
|
88
|
-
x: x,
|
89
|
-
y: y,
|
90
|
-
button: button,
|
91
|
-
timestamp: timestamp,
|
92
|
-
deltaX: delta_x,
|
93
|
-
deltaY: delta_y,
|
94
|
-
modifiers: modifiers,
|
95
|
-
clickCount: click_count)
|
96
|
-
end
|
97
|
-
|
98
|
-
def set_ignore_input_events(ignore:)
|
99
|
-
@devtools.send_cmd('Input.setIgnoreInputEvents',
|
100
|
-
ignore: ignore)
|
101
|
-
end
|
102
|
-
|
103
|
-
def synthesize_pinch_gesture(x:, y:, scale_factor:, relative_speed: nil, gesture_source_type: nil)
|
104
|
-
@devtools.send_cmd('Input.synthesizePinchGesture',
|
105
|
-
x: x,
|
106
|
-
y: y,
|
107
|
-
scaleFactor: scale_factor,
|
108
|
-
relativeSpeed: relative_speed,
|
109
|
-
gestureSourceType: gesture_source_type)
|
110
|
-
end
|
111
|
-
|
112
|
-
def synthesize_scroll_gesture(x:, y:, x_distance: nil, y_distance: nil, x_overscroll: nil, y_overscroll: nil, prevent_fling: nil, speed: nil, gesture_source_type: nil, repeat_count: nil, repeat_delay_ms: nil, interaction_marker_name: nil)
|
113
|
-
@devtools.send_cmd('Input.synthesizeScrollGesture',
|
114
|
-
x: x,
|
115
|
-
y: y,
|
116
|
-
xDistance: x_distance,
|
117
|
-
yDistance: y_distance,
|
118
|
-
xOverscroll: x_overscroll,
|
119
|
-
yOverscroll: y_overscroll,
|
120
|
-
preventFling: prevent_fling,
|
121
|
-
speed: speed,
|
122
|
-
gestureSourceType: gesture_source_type,
|
123
|
-
repeatCount: repeat_count,
|
124
|
-
repeatDelayMs: repeat_delay_ms,
|
125
|
-
interactionMarkerName: interaction_marker_name)
|
126
|
-
end
|
127
|
-
|
128
|
-
def synthesize_tap_gesture(x:, y:, duration: nil, tap_count: nil, gesture_source_type: nil)
|
129
|
-
@devtools.send_cmd('Input.synthesizeTapGesture',
|
130
|
-
x: x,
|
131
|
-
y: y,
|
132
|
-
duration: duration,
|
133
|
-
tapCount: tap_count,
|
134
|
-
gestureSourceType: gesture_source_type)
|
135
|
-
end
|
136
|
-
|
137
|
-
end # Input
|
138
|
-
end # DevTools
|
139
|
-
end # WebDriver
|
140
|
-
end # Selenium
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
# This file is automatically generated. Any changes will be lost!
|
21
|
-
module Selenium
|
22
|
-
module WebDriver
|
23
|
-
class DevTools
|
24
|
-
def inspector
|
25
|
-
@inspector ||= Inspector.new(self)
|
26
|
-
end
|
27
|
-
|
28
|
-
class Inspector
|
29
|
-
EVENTS = {
|
30
|
-
detached: 'detached',
|
31
|
-
target_crashed: 'targetCrashed',
|
32
|
-
target_reloaded_after_crash: 'targetReloadedAfterCrash',
|
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["Inspector.#{event}"] << block
|
42
|
-
end
|
43
|
-
|
44
|
-
def disable
|
45
|
-
@devtools.send_cmd('Inspector.disable')
|
46
|
-
end
|
47
|
-
|
48
|
-
def enable
|
49
|
-
@devtools.send_cmd('Inspector.enable')
|
50
|
-
end
|
51
|
-
|
52
|
-
end # Inspector
|
53
|
-
end # DevTools
|
54
|
-
end # WebDriver
|
55
|
-
end # Selenium
|
@@ -1,59 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
5
|
-
# distributed with this work for additional information
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
8
|
-
# "License"); you may not use this file except in compliance
|
9
|
-
# with the License. You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
14
|
-
# software distributed under the License is distributed on an
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
-
# KIND, either express or implied. See the License for the
|
17
|
-
# specific language governing permissions and limitations
|
18
|
-
# under the License.
|
19
|
-
|
20
|
-
# This file is automatically generated. Any changes will be lost!
|
21
|
-
module Selenium
|
22
|
-
module WebDriver
|
23
|
-
class DevTools
|
24
|
-
def io
|
25
|
-
@io ||= IO.new(self)
|
26
|
-
end
|
27
|
-
|
28
|
-
class IO
|
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["IO.#{event}"] << block
|
37
|
-
end
|
38
|
-
|
39
|
-
def close(handle:)
|
40
|
-
@devtools.send_cmd('IO.close',
|
41
|
-
handle: handle)
|
42
|
-
end
|
43
|
-
|
44
|
-
def read(handle:, offset: nil, size: nil)
|
45
|
-
@devtools.send_cmd('IO.read',
|
46
|
-
handle: handle,
|
47
|
-
offset: offset,
|
48
|
-
size: size)
|
49
|
-
end
|
50
|
-
|
51
|
-
def resolve_blob(object_id:)
|
52
|
-
@devtools.send_cmd('IO.resolveBlob',
|
53
|
-
objectId: object_id)
|
54
|
-
end
|
55
|
-
|
56
|
-
end # IO
|
57
|
-
end # DevTools
|
58
|
-
end # WebDriver
|
59
|
-
end # Selenium
|